shader: use a uniform mesh mask proof inside a narrowed lane skip (Part of #3703) #3948
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3948
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3946"
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?
@mumba17 on GitHub · 2026-12-03 16:15 UTC · original
mumba17:shader/mesh-readfirstlane-r1→main· +21 −1 · 2 files · 1 commits · merged 2026-12-03 16:26 UTCPart of #3705 (row R1,
v_readfirstlane_b32; claim: #3705).Problem
mask_uniformrecords that a lane mask has the same bit on every lane of a lane set: an EXEC-or-zero mask (s_cselect_b64 sN, exec, 0), a compare of uniform values, and their complements and ORs.v_cndmask_b32on such a mask with uniform sources is then uniform on the active lanes, and a followingv_readfirstlane_b32reads it without a broadcast. The cndmask accepted the proof only when the current lane set was exactly the mask's (first==lane_active). When the select runs inside a per-lane CMPX skip nested under the mask's lanes, the proof was dropped. The read then needed the groupshared broadcast, which a per-lane skip cannot use, and was refused withunsupported mesh instruction or EXEC state: v_readfirstlane_b32.Change
Use
covered_by(lane_active, mask_uniform.at(bit).first), the check the SAVEEXEC, CMPX-parent and VCC-branch proofs on the same map already use. Every lane in a set narrowed from the mask's lanes has the mask's bit, so the select still picks one uniform source. Nothing else changes; a select on a per-lane mask is still refused inside the skip.Tests (
native_direct_mesh)uniform-exec-mask-in-lane-skip:s_cselect_b64 s[30:31], exec, 0under full EXEC, then a per-lanev_cmpxskip withs_cbranch_execz, and inside itv_cndmask_b32 v6, 0, 1, s[30:31]andv_readfirstlane_b32 s18, v6. It translates with nomeshReadFirstLaneslot and no barrier, and the read lowers to a select on the scalar condition.varying-exec-mask-in-lane-skip: the same with the mask from a per-lanev_cmp_eq_u32 s[30:31], 0, v0. Still refused.uniform-exec-mask-in-lane-skipfails with thev_readfirstlane_b32refusal.Census
Our native Mesh86 capture (RTX 3090, 600 s): 6,685 distinct
.m86programs, each run once throughcompile_dxil … gfx1013-container-ms-texture-heap.mainc6a0b036: 2,163 translate; 160 stop atv_readfirstlane_b32.v_cmpx_lt_u32(that form is not the wide SAVEEXEC one in #3924: the 99 still stop there with #3924 stacked). No other program's first refusal changes.Counts only; request bytes stay local.
Checks
Windows 11 build 26300, MSVC (VS Build Tools 14.44), SDK/DXC 10.0.26100.
ctest --preset pron this commit (rebased onmainac81f34e): 349/351 pass,native_direct_meshincluded. The two local failures,native_compute_implicit_lod_controlsandnative_wave_virtual_derivative_controls, are the local SDK validator 1.7 vs DXIL 1.8 and fail onmaintoo. The census was measured onc6a0b036and not rerun after the rebase.AI-assisted (Claude Code).
🤖 Generated with Claude Code
s_bitset1_b32, then stop at a scalar loop #3705@R0Y00 on GitHub · 2026-12-03 16:22 UTC · original · approved these changes
Reviewed
ab63fb4f. The mask proof is inherited only along the existing lane-mask ancestry check and both selected values still require uniform proofs. A varying mask still refuses the in-skip readfirstlane. Independently rebuilt compile_dxil in MSVC Debug and ran ctest --test-dir out/build/review --no-tests=error -R '^native_direct_mesh$' --output-on-failure (1/1, no skips). Reverting the ancestry check to exact mask equality made uniform-exec-mask-in-lane-skip fail at +0x44 with the prior v_readfirstlane_b32 refusal. This is source-built compile and emitted-DXIL evidence.github-bot referenced this pull request2026-12-03 16:50:01 +00:00