Shaders/structure: preserve EXEC in s_bcnt1_i32_b* SCC tracking and require matching wave width #788
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/788"
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-25T07:35:36Z.
Summary
Fix two
s_bcnt1_i32_b*SCC tracking bugs incrates/victory-shader/src/structure.rs(Lanes::step):Preserving narrowed
EXECinscc_lane(exitsandscc_some).Lanes::step()previously insertedown = self.b.given(m, e)intoself.scc_laneinstead ofm. WhenEXECwas narrowed inside the block (for examplev_cmp_eq_u32 vcc, 0, v0; s_and_saveexec_b32 s0, vcc_lo; s_bcnt1_i32_b32 s1, exec_lo),given(Lane(vcc), Lane(vcc))collapsed toBool::TRUE, erasingEXEC.s_cbranch_scc0lowered towhen = Bool::FALSE(dead skip branch / unguarded fallthrough even whenEXEC == 0), andStructured::scc_some[scc]evaluated to constanttrue(waveAnyTrue(true)) instead ofwaveAnyTrue(Lane(vcc)).mdirectly (self.scc_lane.insert(scc, m)).finish()still simplifiesb.given(when, cond[b])to a ballot-free uniform condition wheneverEXECmatches block reach, while preserving narrowedEXECin bothexitsandscc_some.Wave-width matching for
s_bcnt1_i32_b{32,64}.name.starts_with("s_bcnt1_i32_b")matcheds_bcnt1_i32_b64in wave32 (ignoring the high dword) ands_bcnt1_i32_b32in wave64 (counting only lanes0..31whileoperand()read the 64-bit pair).name.strip_prefix("s_bcnt1_i32_b") == Some(width), matchings_cmp_eq/lg_u{32,64}directly above.Verification
cargo test -p victory-shader --locked -- structure:::14 passed; 0 failed; 0 ignored(including news_bcnt1_preserves_narrowed_exec_in_exits_and_scc_someands_bcnt1_ignores_mismatched_wave_width).cargo test -p victory-shader --locked -- emit::tests:12 passed; 0 failed; 0 ignored.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.