shader: lower host-wave lane-mask joins and EXEC-masked skip reads (#444) #452
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!452
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Sheffy007 on GitHub · 2026-11-27 19:53 UTC · original
Sheffy007:feat/host-lanes-mask-joins→main· +599 −16 · 5 files · 1 commits · openCloses #448
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
cb9b1d7397tofa47d4c6f3@Olima34 on GitHub · 2026-11-28 02:00 UTC · original
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 #452 alone. In the combination, 6 vertex shaders of that class translate, and #470 alone translates them too.
Merging: #452 and #470 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 #422 #470 #424 #413 #452 #437 #499 #501 on
86cefd22(a local integration build, plus the pass-trace fix from #513):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.