shader: accept purely commutative non-returning 32-bit integer LDS atomics in Wave32 regions #2358
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2358
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2358"
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?
@nidea1 on GitHub · 2026-11-29 12:21 UTC · original
nidea1:feat/lds-wave32-atomics→main· +247 −21 · 1 files · 1 commits · openWhat it changes
Adds Refinement C to the static LDS hazard analysis in
crates/victory-shader/src/emit/lds.rs(region_commutative_atomics):!all(lane-branch) LDS regions where every LDS access is a non-returning, commutative and associative 32-bit integer atomic (ds_add_u32,ds_sub_u32,ds_and_b32,ds_or_b32,ds_xor_b32,ds_min_i32,ds_max_i32,ds_min_u32,ds_max_u32), with zero plain reads, zero plain writes, and zero returning (_rtn) or order-sensitive atomics (ds_inc_u32,ds_cmpst_*,ds_add_f32, etc.).ds_add_u32andds_or_b32), requires provably disjoint constant byte offsets on a shared group-uniform base; same-offset mixes are refused.lds::analyzeinserts host-wavemeetbarriers around!allregion entries and exits and 32-bit LDS atomics operate on single aligned dwords (addr >> 2), any Wave32 interleaving produces the exact same final LDS bits as Wave64 — complementingLdsOrder::loopedfor acyclic!allbranches and for loops preceded byall-block writes without an explicits_barrier.How it was tested
commutative_atomic_reduction_runs_on_wave32_gpu)!allregions with non-returning commutative integer atomics (e.g.,if (tid.x < N) { ds_add_u32(LDS[0], ...); }) failedlds::analyzewithRefusal::AtomicWithoutPlainReadand fell back to Wave64 (or requiredVICTORY_LDS_WRITE_ONLY_OK=1)emit::lds::tests::verifies both Wave32 acceptance/GPU execution and Wave64 refusal cases)cargo testpassed for the crates it touches: yes (cargo test -p victory-shader --lib --locked emit::lds::tests::— 23 passed, 0 failed)Checked for overlap
lds.rs; this PR only adds commutative non-returning 32-bit integer atomic analysis and does not overlap #1773)@Lyrnc on GitHub · 2026-11-29 23:23 UTC · original
Hardware check of this PR's pattern on a gfx1036 oracle (native wave64), against the 32-lane result on an RTX 5080 and a Radeon 680M. Hand-written wave64 cases matched in every case. On main those cases only translated through the folded form; with this PR they go to the plain split. Rebased onto current main together with the other LDS proof PR, the
ldstests pass (51), and so does the full victory-shader lib apart from 3 failures that main has too.#3441 is built on this PR and #2358/#1773 (the two conflict with each other; the resolution is in #3441). It adds two more proofs and takes the refused/folded count from 181 (main) via 162 (this pair) to 139.
AI use: Claude Code (Claude Opus 5.5).
@nidea1 on GitHub · 2026-11-30 00:15 UTC · original
Thanks @Lyrnc for the native Wave64 gfx1036 oracle verification against RTX 5080 and Radeon 680M, and for keeping the commit/authorship intact in #3441!
I'll leave #2358 open and untouched so #3441 stays cleanly stacked on top; if #1773 lands on
mainfirst, I'm happy to rebase #2358 right away.@dyshay on GitHub · 2026-11-30 03:12 UTC · original
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch
janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with--profile diag --features diagnostics. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.58aab72c31to242623c21a@nidea1 on GitHub · 2026-11-30 16:08 UTC · original
Rebased onto \main\ (\
c71899d9, now including #1773) at \242623c2; \cargo test -p victory-shader --locked --lib emit::lds::\ passes 26/26.242623c21atod1ec3dd32ad1ec3dd32atob103b42869View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.