Shaders: track spilled lane masks, Atom::Phi back-edges, and carry masks #2347
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2347
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2347/head"
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?
@DenRakEiw on GitHub · 2026-11-25 11:17 UTC · original
fix/lane-mask-spills-joins-carries→main· +259 −75 · 2 files · 1 commits · closed without merging## Summary
Closes the lane-mask tracking and lowering gaps identified in #2268 item 4 (separate from #2289's data-phi mask resolution):
Spilled lane masks (
v_writelane_b32/v_readlane_b32):structure.rs:Lanes::stepnow checksself.restoredforFields::Sopso scalar mask ops reading a restored mask keep mask tracking, and tracks Wave32v_readlane_b32restores of tracked masks inself.masks(without markingactiveat the restore block).lower.rs:mask_dwordforwardsst.restoredto the original mask value so ballots are taken at the original write block;mask_numberalso supportsandn1/orn1.Lane-mask phi joins (
Atom::Phi):structure.rs: records incoming arguments ofAtom::Phijoins inphi_joinsand resolves every edge (including loop back-edges) inwrong_joins.lower.rs:pending_masksinfill_phisskipsnever_takenedges, maps Wave64 high args viast.highs, and looks upst.masksorst.other(unblocking constant-initialized mask phis such ass_mov_b32 s0, 0before a loop).Carry-in & carry-out masks:
structure.rs:Lanes::stepresolvessrc[2]viaself.mask(k)for*_co_ci_u32instructions as well asv_cndmask_b32.lower.rs: unifiesv_cndmask_b32and*_co_ci_u32throughmask_operand(supportingNULL,st.masks,st.other, and inline constants), and emits the signed 64-bit overflow carry forv_mad_i64_i32intolane_bits.Testing
structure::tests(restored_mask_feeds_sop_mask_op,loop_mask_phi_with_zero_init_resolves_all_args,carry_in_from_constant_is_tracked) and 3 inemit::lower::tests(loop_mask_phi_initialized_to_zero_lowers,spilled_mask_feeds_sop_and_reads_as_data,carry_in_constant_and_mad_i64_carry_out_lower).cargo test -p victory-shader structure::tests: 14/14 passed (RTX 5090 & WARP).cargo test -p victory-shader emit::lower::tests: 24/24 passed (RTX 5090 & WARP,dxil.dllvalidated).cargo clippy -p victory-shader --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.Related to #2268, #1633.
AI-assisted (Gemini 4 Neon).
@Marvisak on GitHub · 2026-11-25 15:30 UTC · original · edited 2026-11-25 16:00 UTC
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-shader/src/emit/lower.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (needs-work) was for an older state ofmain.Generated by Claude Code
@DenRakEiw on GitHub · 2026-11-26 00:53 UTC · original
Closing this PR — stepping back from code contributions on this account. Feel free to reuse the approach if helpful.
Pull request closed