compute: accept dword buffer atomics through a byte-window raw UAV #3171
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!3171
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3169"
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-27 19:58 UTC · original
Leyukaka:atomic-byte-window→main· +71 −21 · 3 files · 3 commits · merged 2026-11-27 21:25 UTCFixes #3170. Part of #2935. Target branch
main.Change (
src/gfx1013_compute_native.cpp,Emit::binding): the byte-window case of a raw UAV now also covers non-indexedbuffer_atomic_*(idxen clear), not onlybuffer_store_raw.byte_descriptor_fieldtracks.gfx1013_direct_compute.inlalready issues dword atomics on the same raw UAV asbuffer_store_raw, so the binding and the host window are the same.indexed_atomic_uav, so they never satisfy the raw-UAV test of this condition and stay refused. The idxen test inside the condition is a second guard.buffer_atomic()has no_x2entry and refuses them before binding.Tests. The setup was Windows 11 build 26300.9974 with an NVIDIA GeForce RTX 5080 (driver 32.0.16.2101) and DXC from the Windows SDK 10.0.26100, on
main6057071bplus this commit.native_bytewin_store_hardwarenow also reads back, through the rewritten descriptor and against a CPU reference with untouched sentinels:buffer_atomic_addwith and without GLC;buffer_atomic_umin;buffer_atomic_cmpswap.native_bytewin_store_controlskeeps an indexed atomic and a 64-bit atomic through the byte window refused..sadword 4 bit 20 (wave32, #2999). The store cases are unchanged.native_direct_container,startup_compute_buffer_atomics,startup_compute_buffer_atomics_hardware,startup_compute_buffer_atomics_warp,compute_store_aot_gfx1013_buffer_atomics_hardwareandcompute_store_aot_gfx1013_buffer_atomics_warppass.native_bytewin_store_hardware;Measured on a local capture (counts and instruction shape only) with
compile_dxil --jobs 8 gfx1013-direct-cs@36 --requestsonmain6057071b.buffer_atomic_add, 3buffer_atomic_uminand 1buffer_atomic_cmpswap.buffer_atomic_addand 2buffer_atomic_umin. Two of those are dispatched in the start-up run, 5 times in all. The onebuffer_atomic_cmpswaprequest is among the 3 still refused, so compare-and-swap is covered by the synthetic fixture only.AI-assisted.
@tedin7 on GitHub · 2026-11-27 21:25 UTC · original · reviewed
Review of
305500f9b8(updated with main). Comment only.The byte-window raw UAV path in
gfx1013_compute_native.cppnow acceptsbuffer_atomic_*next tobuffer_store_raw, but only for 4-byte accesses and only when GLC (bit 13 of the first dword) is clear, so returning atomics keep their refusal. The change reuses the existing byte-window descriptor rewrite, so the atomic lands on the same rewritten view a store would use. The atomic readback innative_bytewin_store_hardwareneeds a wave32 adapter and skips on our WARP host, so it rests on the RTX 5080 run in the description, which also shows that dropping the atomic case fails it.src/gfx1013_compute_native.cppis also changed oncpp-migration; this merges cleanly there and the native sweep on that merge is in the comment below.Commands:
git diff origin/main...pull/3169/head(read),git merge-tree --write-tree origin/cpp-migration pull/3169/head, plus the Windows commands in the comment below.AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-27 21:25 UTC · original
Windows Server 2025 verification of
305500f9b83032db006ff5b508a0950156bc14f0(D3D12 WARP, MSVC 14.44.35207):cmake --build --preset dev --target compile_dxil native_store_replay native_compute_ir_dump;ctest --preset dev -R <native sweep>: 100% tests passed out of 146 (84 passed, 62 skipped), includingnative_bytewin_store_controlsandnative_direct_container--preset release;ctest --preset release -R <native sweep>: 100% tests passed out of 146 (84 passed, 62 skipped)cpp-migration(a0f67731): 100% tests passed out of 146 in both presets<native sweep>= everynative_*test exceptnative_startup_request_cache_hardware, which fails on WARP-only hosts with or without this PR.AI-assisted; commands listed were executed locally.