shaders: keep native Wave64 when VICTORY_WAVE32_RELAX is on #96
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ReTerryDavis--ReVIctory!96
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-95"
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?
@SovietBearz0r on GitHub · 2026-12-05 11:54 UTC · original
SovietBearz0r:wave32-relax-guard→main· +5 −1 · 1 files · 1 commits · merged 2026-12-05 17:40 UTCFix a correctness bug in the
VICTORY_WAVE32_RELAX=1path on native Wave64 GPUs (AMD RDNA 2/3/4).What was wrong
When a console wave64 compute program either crosses 32-lane halves or shares LDS across a group of more than 32 threads, the relaxation path cannot use plain 32-lane waves and falls into the split emulation: two host waves of 32 with a group barrier before every LDS access and a cross-half exchange pair for lane numbers/masks. That emulation only makes sense on 32-lane-max hosts (NVIDIA), where a 64-lane wave cannot be requested.
On a native Wave64 host with
VICTORY_WAVE32_RELAX=1, the same code nevertheless built that emulation, injecting barriers the hardware wave does not need and an LDS exchange pair no wave uses — exactly what can hang or read the wrong half. The fork this was found in (ReVictory-RDNA3's RX 7000 edition) guards the branch withhost_max_wave() == 32, so a native 64-lane host keeps its hardware Wave64.Change
crates/victory-shader/src/emit/lower/mod.rs: the split-wave branch is now taken only whenhost_max_wave() == 32, with a comment recording why.VICTORY_WAVE32_RELAX=1the program keeps 64-lane waves instead of the split emulation.Verification
cargo test -p victory-shader --lib: 320 passed, 2 ignored, 0 failed.VICTORY_WAVE32_RELAXis a process-static env switch (a test cannot flip it after the first read), and the split path runs only during lowering of a real LDS-heavy wave64 program; the fix is a host-capability guard rather than new lowering behaviour. Behaviour on NVIDIA (all CI hosts here are 64-lane AMD, so the 32-lane branch is reasoned) is untouched.crates/victory-shader/src/emit/lower/mod.rs(RX 7000 edition).