shader: support multi-store and constant-SGPR compute kernels in compute_store_aot #539
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!539
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/539/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?
@alexander-src on GitHub · 2026-11-22 10:10 UTC · original
alexander-src:shader/compute-multi-store-aot→main· +134 −28 · 3 files · 1 commits · merged 2026-11-22 10:18 UTCChange
Extend
tools/compute_store_aot.pyto lower compute kernels with multiple non-overlapping raw UAV stores and general constant SGPR values:buffer_store_dword,buffer_store_dwordx2,buffer_store_dwordx3andbuffer_store_dwordx4stores per invocation in source order, rejecting overlapping byte spans within the same invocation so write-order aliasing cannot slip through.s_mov_b32immediates, sign-extended 16-bits_movk_i32immediates andv_mov_b32[_e32|_e64]copies from tracked constant SGPRs and VGPRs while rejecting pending or non-constant sources (table,group,local).s_clausehints within the 6-bit field limit (<= 0x3f) ands_waitcnt vmcnt(0)or combinedlgkmcnt(0)+vmcnt(0)waits.MULTI_FIXED(numthreads(1,1,1), two stores at offsets 8 and 32) andMULTI_INDEXED(numthreads(32,1,1), stride 12 with stores at offsets 0 and 8 leaving the gap word at offset 4 untouched as sentinel) fixtures plus seven new negative controls intests/compute_store_check.py, and updatedocs/experiments.md.No shared interface changed; existing single-store HLSL output is unchanged.
Verification
Tested on Linux x64 at commit
a5ac416(based on914d241) with Python 3 (requirements-dev.txtinstalled) and LLVM 23.1.4 (llvm-mc,llvm-objcopy,/usr/lib/libLLVM.so):python -B tests/compute_store_check.py binary llvm-mc llvm-objcopy /usr/lib/libLLVM.so: passed (all positive fixtures, assemble/disassemble round trips, CLI check and negative controls).python -B tests/form_coverage_check.py: passed.python -B tests/docs_links_check.py: passed (10 Markdown files, 112 links).python -B tests/bidi_controls_check.py: passed (506 tracked files).Could not run DXC / D3D12 WARP or hardware dispatch locally on Linux (missing Windows SDK, DXC and D3D12 runtime); Windows CI runs
compute_store_aot_warpandcompute_store_aot_hardwareviacompute_check.cpp(MULTI_INDEXEDuses3 * 32 * 3 = 288words, within the 320-word buffer limit).Evidence and follow-up
All new fixtures (
MULTI_FIXEDandMULTI_INDEXED) are synthetic gfx1013 compute shaders written directly intests/compute_store_check.py(MIT). Non-overlapping store checking assumes disjoint byte offsets per invocation; kernels that rewrite the same offset or compute data-dependent values from loads remain rejected for follow-up work.Checklist
AI-assisted: yes.