Shaders/wave: seed EXEC in uni map and validate full wave64 mask pairs #759
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/759"
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 fxceless/victory-fork. Originally posted by AscilCH on 2026-11-25T06:44:43Z.
Problem
Two soundness bugs in whole-wave section simulation (
crates/victory-shader/src/emit/wave.rs):EXECentries inuni:simulate()never inserted section-startEXEC/EXEC+1SSA values or mid-sections_mov_b*writes toEXEC/EXEC+1intouni. An in-section read ofexec_lo/exec_hi(e.g.s_mov_b32 s8, exec_loorv_mov_b32 v2, exec_lo) fell back toSym::Uni(exec_val)->Shape::Value(exec_val), which lowering turned into the divergent hostwaveActiveBallot(true)(or failed to lower) instead of the section's constant mask (0xFFFF_FFFFor the mid-section constant).sections()accepted 32-bits_or_saveexec_b32/s_nand_saveexec_b32and 32-bitexec_lo-only restores in wave64 even though lanes 32..63 are untouched.simulate()accepted 32-bits_and_b32in wave64 and checked only the low dwordValueins_and_b64andv_cndmask_b32, so overwriting the high dword of a saved or derived wave64 mask still produced a validSym::Red.Fix
uniwith section-startEXEC/EXEC+1constant values (u32::MAX) and updateunion mid-section constants_mov_b*writes toEXEC/EXEC+1.(Value, Option<Value>)mask pairs inmasked, require 64-bit start, restore, ands_and_b64in wave64, and match both low and high dwords ins_and_b64andv_cndmask_b32.Verification
cargo test -p victory-shader --locked -- emit::wave emit::wave64_tests:15 passed; 0 failed(including new testsin_section_exec_reads_export_section_constantsandwave64_mask_checks_high_dword_and_rejects_32bit_ops).cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings: 0 warnings.cargo xtask policy:171 files ok.(AI-assisted; synthetic unit tests only, no game data.)
View 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.