compute: accept GLC, DLC and SLC on raw buffer loads and stores in direct compute #3253
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3253
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3251"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Leyukaka on GitHub · 2026-11-28 01:48 UTC · original
Leyukaka:raw-load-glc-dlc→main· +227 −6 · 8 files · 2 commits · merged 2026-11-28 04:02 UTCPart of #2935, claimed in #3226 (item 3 of my third comment there). Target branch
main. Two commits. This goes further than that claim: it also accepts SLC, and the second commit does the same for raw stores.Change (
src/gfx1013_compute_native.cpp, plus one sentence indocs/experiments/native-bytewin-store.md): the direct compute decoder no longer refuses raw buffer loads and stores for the cache-policy bits GLC (word 0 bit 14), DLC (word 0 bit 15) and SLC (word 1 bit 22).tools/startup/gfx2hlsl.pyalready treats them that way for MUBUF loads.globallycoherentis not modelled.tests/native_global_srv_heap_replay_check.pyretires its two GLC and SLC load refusal cases, which the new tests turn into positive coverage.Tests. The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, Release, on
main7364e6a9plus these commits.New
native_raw_load_cache_bits_hardwarereads back, against a CPU reference:Its refusal controls are LDS and TFE.
New
native_raw_store_cache_bits_hardwarereads back:New
native_raw_store_cache_bits_controlschecks the IDXEN, LDS and TFE refusals.tests/native_bytewin_store_check.pygains achecks=keyword so the new test reuses its fixture.With
main'scompile_dxil, the load cases stop at "raw buffer load needs a linear byte offset and no modifiers".Mutation checks by hand: putting GLC back into either mask fails the matching hardware test.
Measured with
compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests,main7364e6a9against these commits.AI-assisted.
@pigalot on GitHub · 2026-11-28 04:02 UTC · original · approved these changes
I reviewed
774646cfmerged overmain152e93b4. The merge is clean (tree2c73d46c) andgit diff --cached --checkis clean.What I traced. In direct compute (
direct && !graphics), the raw MUBUF masks now drop only the cache-policy bits:0x0203e000to0x02032000, dropping GLC (bit 14) and DLC (bit 15). Word 1 goes from0x00e00000to0x00a00000, dropping SLC (bit 22).0x3e000to0x32000and word 1 from0xe00000to0xa00000, the same three bits.The lowering does not read these bits. Raw loads lower to
raw_vector_srv/byte_window_srvloads, and raw stores toraw_buffer_uavstores (gfx1013_direct_compute.inlaround line 683), so the emitted DXIL is the same with or without them.What I ran. I built
compile_dxil native_store_replay native_global_srv_heap_replay native_compute_ir_dump native_compute_manifest_reasonsindevandrelease, then ran:_warptests skip with 77 (WARP capability skips), in both Debug and Release/O2. The skips includenative_global_srv_heap_replay_warp,native_image_store_exact_width_warp_*andnative_descriptor_scc_warp. This PR's tests have no_warpvariant.native_global_srv_heap_replay_hardwarewith the two retired GLC/SLC refusal cases.main's,native_raw_load_cache_bits_hardwarefails. With the store mask set back tomain's,native_raw_store_cache_bits_hardwarefails.Mutants. Each was rebuilt in
dev, then I ran the matching new test:native_raw_load_cache_bits_hardwarenative_raw_load_cache_bits_hardware(refusal controls)native_raw_store_cache_bits_hardwarenative_raw_store_cache_bits_controlsRestored and rebuilt afterwards;
git diff --quietis clean.Non-blocking. A GLC load that expects to see another workgroup's store from the same dispatch used to be refused. Now it compiles, and it reads through an SRV with no cross-group visibility guarantee. The description says
globallycoherentis not modelled. And a load through an SRV could not be coherent anyway, so this doesn't change what the lowering can express. But a spin-wait on a flag written by another group would now fail silently instead of being refused. If that pattern turns up in the request sets, a refusal or agloballycoherentUAV path for it would be a follow-up.Verdict: approve on
774646cf.Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088 and WARP, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Windows SDK 10.0.28000.0 DXC, Python 3.12.10, wave32; I did not check the debug-layer status.
CI:
Build and test on Windowspasses on774646cf.This reply was AI-assisted.