shader: lower host-wave lane-mask joins and EXEC-masked skip reads (#444) #448
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/448"
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 LakshanSivakumar/Native-Victory-macOS. Originally posted by Sheffy007 on 2026-11-27T19:53:11Z.
Closes #444
Refs #4, #258
Summary
MaskData::Host) lane-mask joins between tracked masks (st.masks) and untracked host-wave masks (s_bitset0(mask, s_ff1(mask))waterfall peel loops, uniform0/-1broadcasts from width-1s_bfe_i32/s_bfe_i64,s_mul_i32by-1, ands_bitreplicate_b64_b32of quad-invariant bitmasks) viaLower::host_number, pluss_bfe_i64SOP2 scalar lowering and uniform loop-header mask joins in mesh programs (MaskData::None).MaskData::Hostjoins viaLower::host_uniform_join(Bools::literal+ BDDmeetcheck verifying no two lanes at the join with equalAtom::Uniformvalues take different incoming edges), keeping divergent per-lane jump arms refused.Lower::unneeded_edges(keeps_exec_read) sos_cbranch_execzskip edges carrying stale SGPR data are recognized as unneeded when the joined mask is read under the narrowedEXEConly byv_cndmask_b32,s_nor_*,s_orn2_*/s_andn2_*withEXECin either operand slot, ors_*_{saveexec,wrexec}_*.gfx_refusal_tests(positive + negative cases) and an end-to-end Metal GPU readback test (scaled_vertex_tests::pixel_waterfall_and_exec_skip_mask_joins_run_on_the_gpu) covering wave32 and wave64 pixel shaders.Verification
cargo test -p victory-hle -p victory -p victory-gpu -p victory-metal -p victory-shader -p xtaskcargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warningscargo clippy --workspace --all-targets --all-features --target x86_64-pc-windows-gnullvm -- -D warningscargo xtask policycc @Olima34
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T02:00:34Z.
Thanks for this PR! An offline check of
cb9b1d73. The current headfa47d4c6has the same non-test code.Measured offline on main
86cefd22withexamples/sweep+tools/corpus/compare.sh, on our 21,600-shader world corpus. The PR alone was swept over the 10,319 world shaders that the combination below changes. "Passes/frame" is an estimate from four traced world frames of an earlier preview run: the dropped passes whose only refused shader this PR translates.#448 alone:
The world shaders refused for "… data, on the host's lanes" are not translated by #448 alone. In the combination, 6 vertex shaders of that class translate, and #466 alone translates them too.
Merging: #448 and #466 add code at the same spot in
emit/lower.rs. Keeping both sides compiles, so whichever lands second needs only a trivial rebase.In combination with #418 #466 #420 #409 #448 #433 #495 #497 on
86cefd22(a local integration build, plus the pass-trace fix from #509):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.