victory-shader: fix Wave64 wave size, scc_some widening, and raw VCC branches #356
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/356"
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?
Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T15:45:13Z.
Fixes P0 RDNA4 / Wave64 shader lowering findings #6, #7, and #8 from #282 (related: #276).
Summary
crates/victory-shader/src/emit/lower.rs):v_readfirstlane_b32(in groups with> 1thread) inconsole_lanes, ensuring[WaveSize(64)]is emitted on Wave64 hosts while leaving waterfall descriptor reads untouched.x.native.wave64 && s.lds_dwords > 0) inlds_waveso Wave64 hosts emit[WaveSize(64)]and Wave32-only hosts entersplit_lds.crates/victory-shader/src/emit/lower.rs):Err(MASK_ELSEWHERE)+need(made)) whenscc_somereads an SCC value with bits outsideEXECbuilt in a non-all_lane_blocks_nativeblock on native waves, triggering branch/loop widening instead of reading bogus inactive bits.crates/victory-shader/src/structure.rs,emit/lower.rs,emit/mod.rs):s_cbranch_vccz/s_cbranch_vccnzagainst rawvccinstead ofvcc & exec.vcc_outside_execacross single-predecessorEXECstate inLanes, reject un-widened native branches/exits whoseVCCcan hold bits outsideEXECor inactive lanes (Err(MASK_ELSEWHERE)), and teachwiden()to widen conditional VCC branch blocks viawave_any.Verification
cargo clippy -p victory-shader --all-targets --locked -- -D warnings(passed)cargo run -p xtask --locked -- policy(325 files ok)cargo test -p victory-shader --lib -- --test-threads=1suites including new regression tests (structure::tests,emit::lower::tests,emit::wave64_tests,emit::size_tests,emit::waterfall_tests,emit::lds_sub_tests,emit::threading::tests,ir::tests,resource::tests,spill::tests,bvh::tests,dxbc::tests,dxil::tests,emit::bitcode::tests,emit::own_bits::tests,emit::container::tests,emit::cost::tests,emit::atomic_tests)Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T16:07:51Z.
Automated triage for the maintainers (not an approval).
Verdict:
needs-rebase· CI (check):noneThis PR no longer merges cleanly into
main.To change the verdict: Rebase onto current
mainand resolve conflicts; CI and triage will run again automatically.Generated with Antigravity CLI (
agy).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T17:04:16Z.
Holding merge (
triage: needs work) per Deep Static Audit Pass #2 (#282comment7352688269, P1 finding #22):lds_wavemulti-wavex.native.wave64expansion breaks 32 KiB TGSM shaders on NVIDIA — restrict multi-wave expansion tohost_max_wave() >= 64and re-run CI before merge.Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T17:33:15Z.
Finding #22 fix (
host_max_wave() >= 64guard on multi-wavelds_wave) looks clean! However,b56e2809now conflicts with merged#358(likelylower_tests.rs) and has no CI run yet (checks=[]). Please rebase ontomainto resolve the conflict and trigger CI -> ready to merge once CI is green!Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T22:03:03Z.
Rebased cleanly onto
main(c31bbebc), Deep Static Audit Pass #3 (#282comment7355749301) verified Finding#22resolved (host_max_wave() >= 64guard, zero NVIDIA Wave32 regressions), and CI46979442126is GREEN. Merging RDNA 4 Wave64 +scc_some+ raw VCC branch fixes tomain.