shader: lower gfx1030 fixed-address atomic exchanges #1384
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!1384
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1384/head"
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?
@stan495 on GitHub · 2026-11-24 10:03 UTC · original
stan495:codex/gfx1030-mubuf-atomic-exchanges-upstream→main· +131 −9 · 5 files · 1 commits · merged 2026-11-24 10:33 UTCBehavior
Lower
buffer_atomic_swap,buffer_atomic_cmpswapand their_x2variants for fixed, aligned addresses in a caller-supplied in-range raw UAV. The compare-swap lowering maps the ISA replacement and comparison operands to the HLSL comparison and replacement arguments. The profile accepts one atomic UAV instruction, with no return flag or extra cache flags. The_x2forms use SM 6.6 and requireInt64ShaderOps. Builds on #1372.Verification
Tested clean head
85523e79447d6ae665f5372557fe1d855dcb2181from7261ab67537b1c4547a640ca805f5b613a1621ee.CTest passed 56 tests with zero failures and zero capability skips. Both widths and both adapters recorded the four forms from passing execution fixtures. The run covered 59 of 73 gfx1030 MUBUF forms within the tested profiles. The documentation and coverage-tool checks passed.
The execution fixtures run translated DXIL. One and two groups compare all 320 words with a CPU reference, including matches, misses and untouched words. The shifted swap first differs at word 0, expected
c5c5c5c5, actual89abcdef. Reversing compare-swap operands first differs at word 2, expected89abcdef, actualc5c5c5c5. Windows build 26300.9974 used Microsoft Basic Render Driver 10.0.26100.9818 for WARP and Intel Arc B390 driver 32.0.101.8509 for hardware. The debug layer was unavailable on both.The assembly, disassembly, container CLI and rejection checks passed on Ubuntu 22.04.5 with LLVM 15.0.7.
git diff --checkandgit merge-tree --write-tree 7261ab67537b1c4547a640ca805f5b613a1621ee HEADpassed. Merge simulation with #1379 and ordered replay of the queued atomic batches completed without conflicts.@tedin7 on GitHub · 2026-11-24 10:31 UTC · original · reviewed
Reviewed
85523e79(shader: lower gfx1030 fixed-address atomic exchanges).git diff --checkclean; 100% title-neutral.tools/compute_store_aot.py: extendsMUBUF_ATOMIC_METHODSwithswap -> Exchangeandcmpswap -> CompareExchange(plus64suffix for_x2), handles 1/2/4-VGPRvdataranges (width = 2 if wide else 1,count = 2 * width if op == "cmpswap" else width), reorderscmpswapoperands from ISA(replacement, compare)to HLSL(compare, replacement), discards the old value intoignoredAtomic(matchingglcclear), and rejectsglcand other unsupported forms.tests/compute_store_check.py: addsmubuf_exchange_cases/mubuf_exchange_controls/mubuf_exchange_drawcovering 32-bit and 64-bitswapandcmpswap, matching and non-matching compare cases, address/operand-order negative controls, andglc/missing-word/bad-range rejections.tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: passed (assembles and disassemblesbuffer_atomic_swap,buffer_atomic_cmpswap,buffer_atomic_swap_x2,buffer_atomic_cmpswap_x2and runs controls).tests/pso_readiness_check.py,tests/docs_links_check.py(16 Markdown files, 311 links),tests/bidi_controls_check.py(1161 tracked files): all passed.85523e79447d6ae665f5372557fe1d855dcb2181:--preset dev): 4/4 passed (compute_store_aot_mubuf_exchange_hardware3.27s,compute_store_aot_mubuf_exchange-x2_hardware3.30s,compute_store_aot_mubuf_exchange-x2_warp3.36s,compute_store_aot_mubuf_exchange_warp3.40s)./O2(--preset release): 4/4 passed (compute_store_aot_mubuf_exchange-x2_hardware3.33s,compute_store_aot_mubuf_exchange_hardware3.41s,compute_store_aot_mubuf_exchange-x2_warp3.45s,compute_store_aot_mubuf_exchange_warp3.47s).