shader: lower host-wave lane-mask joins and EXEC-masked skip reads on the host's lanes #444
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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:20:57Z.
Problem
In the
#4world-run refusal summary (18distinct shaders:17graphics +1compute), pixel, vertex, mesh, and wave32 compute shaders running with!self.console_lanesfail atfill_phis(lower.rs:15069) with:a lane-mask join of an untracked mask: data, on the host's lanesThree gaps cause valid host-wave-safe lane-mask joins to hit
HOST_LANES:pending_masks(lower.rs:14999-15070) does not lowerMaskData::Hostmasks at host-uniform joins (and restrictsmeshto non-loop two-predecessor forward branches):data_phis(lower.rs:14917) andAtom::Opaque(lower.rs:3692) accept proven host-wave-safe masks (is_host_wave_mask:s_bitset0(rem, s_ff1(rem)),rem & (rem - 1),1 << s_ff1(rem),0 - flag,s_ashr_i32 x, 31, quad-periodic masks, etc.),pending_maskssetsnumber = self.console_lanes && uniform || mesh_number, which isfalsefor all pixel and vertex shaders (and for uniform loops in mesh shaders).s_wqm, excluded fromst.otherbecauseAtom::Quadis a derivative shortcut) falls through toHOST_LANES.st.bools.given(edge_cond, st.reach[b])alongsideuniform_joinproves that every reachable edge intobis host-wave-uniform relative tob(rejecting multi-block per-laneif/elsearms ending in unconditional jumps while accepting uniform loops and multi-block uniform branches).is_host_wave_maskandis_uniform_bitmask32misss_wqm_b32/s_wqm_b64, 1-bit sign-extendings_bfe_i32/s_bfe_i64,s_mul_i32(flag * -1), and quad-periodics_bitreplicate_b64_b32:s_wqmexpands aligned 4-lane quads identically on 32-lane and 64-lane host waves and is already lowered per-quad inMaskData::Host.s_bfe_i32/s_bfe_i64with width1((imm >> 16 & 0x7F) == 1) ands_mul_i32by-1of a0/1scalar flag produce uniform all-0 / all-1 masks across all lanes.unneeded_edges(keeps_exec_read,lower.rs:11308) missesv_cndmask_b32,s_*_saveexec_*/s_*_wrexec_*,s_nor_*, andsrc[0] == EXECoperand order:s_cbranch_execzskip edge carries stale scalar data is frequently consumed directly byv_cndmask_b32ors_and_saveexec_*under the narrowedEXEC(where none of the skipping lanes are active). Recognizing thoseEXEC-masked consumers marks the skip edge unneeded without requiring console lanes.Refs #4, #258
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Sheffy007 on 2026-11-27T19:20:58Z.
/claim
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T19:21:09Z.
Claimed by @Sheffy007. Open a draft pull request with
Refs #444in its description within 24 hours, or the claim expires.