shader: accept an inverted VCC as a mesh lane mask before SAVEEXEC (Part of #3703) #3706
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3706"
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 R0Y00/Xbox2Windows. Originally posted by mumba17 on 2026-12-01T06:55:52Z.
Part of #3703 (item 5). Refs #3641, #2413.
Problem
Slot 86 mesh programs open an "if not VCC" region like this:
The mesh frontend's mask-complement path (
s_not_b64/s_xor_b64 sD, sS, -1) only took an even SGPR pair as the source. With VCC as the source these programs stopped atunsupported mesh instruction or EXEC state: s_xor_b64. @lukaslw-lab found this as the next refusal of the 6idxen offenrequests, once #3702, #3704 and #3705 are applied.Change
src/gfx1013_direct_mesh.inl: the complement path now also accepts VCC (106) as the source. The lane bit comes fromgraphics_lane_mask, which already returns this lane's VCC bit. The wave words come from the VCC word slots, the same ones the SAVEEXEC narrowing reads. Inactive lanes come out set, as they do on the GPU, and the AND with EXEC in the following SAVEEXEC drops them. Everything else is unchanged: the result is an ordinary lane-mask pair, so the existing in-skip and top-level SAVEEXEC paths take it as their mask.vcc_hi, and any second operand other than -1, still refuse.Tests
tests/native_direct_mesh_check.py:saveexec-not-vcc(if/else inside a lane skip): the branch takesxor(vcc bit, 1), the then arm gives 2, the else arm 3.saveexec-paired-not-vcc: paired-EXECZ form.saveexec-if-not-vcc: the if-only form. Untaken lanes keep the old v1.saveexec-not-vcc-hi(s_xor_b64 s[24:25], vcc_hi, -1) andsaveexec-xor-vcc-one(vcc ^ 1). Both still stop atunsupported mesh instruction or EXEC state: s_xor_b64.native_direct_meshfails atsaveexec-not-vccwith that same refusal.ctest -R "native_|mesh|gfx1013" -E "hardware|_warp": 605/605 pass.Environment: Windows 11 build 26300, RTX 3090, MSVC 14.44, DXC from SDK 10.0.26100,
main1c634037.Not measured: how far the 6 title requests get past this point. I couldn't do a native Mesh86 capture run on this host today. @lukaslw-lab, could you rerun your reach probe with this on top of #3702/#3704/#3705? I'll post the counts here if I get a run first.
AI-assisted.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-12-01T07:02:45Z.
Review: APPROVED
Reviewed
05301cf4by reading the diff; not built or run.Verdict: approve. The VCC source reuses the paths that already treat VCC as a mask, and anything outside the full complement still refuses. No MUST.
gfx1013_direct_mesh.inl:1438. If it still read106+j, the words would be empty. The SAVEEXEC at:1609would then narrowexec_valueto empty and SCC would stay unset, without a refusal. The new cases check the lane-bit branch, which comes fromgraphics_lane_mask(gfx1013_direct_compute.inl:3628,read(106)). A case that reads the result's SCC (s_cbranch_scc0right after thes_xor_b64), or asserts thexor ..., -1of the VCC words in the IR, would cover it.vcc_hi(107) is odd and still refuses, assaveexec-not-vcc-hishows.xor(read(106), 1), so inactive lanes come out set and the SAVEEXEC AND with the old EXEC drops them (:1617).vcc_wordsslots that the SAVEEXEC (:1609) and the VCC branch (:1167) read.0x8998c16aiss_xor_b64 s[24:25], vcc, -1,0x8998c16breadsvcc_hi,0x8998816aXORs with 1.Tests:
saveexec-not-vccandsaveexec-paired-not-vccprove the inverted compare selects the arms, in the in-skip and paired forms.saveexec-if-not-vccproves the if-only form keeps v1 for untaken lanes.CI runs
native_direct_meshin theprpreset; it was still pending at this head.I'll post the reach on the 6 requests separately, as asked.
Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-12-01T07:05:47Z.
Reach on the 24 slot 86 requests, offline (
compile_dxil … gfx1013-container-ms-texture-heap),main1c634037+ #3702 + #3704 + #3705 + this PR:graphics register undefined on an incoming path: 274 / 276 / 278(v18 / v20 / v22) at the first load in the new arm (buffer_load_dword v23, v18, … idxen). That VGPR is written under the earlier EXEC region that thes_mov_b64 exec, s[20:21]just before closes.So item 5 does what it says for all 6. Their next wall looks like VGPR liveness across that EXEC restore, not the SAVEEXEC shape itself; I'll add it to #3703 as item 6.
Imported from R0Y00/Xbox2Windows. Originally posted by mumba17 on 2026-12-01T08:32:10Z.
Thanks @lukaslw-lab. SHOULD addressed in
0d5a8cb2. Your SHOULD found a real limit. VCC only gets wave words from a wave-uniform compare (gfx1013_direct_mesh.inlVOPC path). After a per-lane compare like0 > v0, the complement's SCC stays unknown, so it refuses rather than doing anything wrong. The new cases pin both:not-vcc-scc:s_movk_i32 s20,v_cmp_gt_u32_e64 vcc, s20, 0,s_xor_b64 s[24:25], vcc, -1,s_cselect_b32 s21, 1, 0, ands21reaches the exported X. It asserts bothxor …, -1words, theiror, and the SCCicmp ne.not-vcc-scc-per-lane: the same withv_cmp_gt_u32 vcc, 0, v0. It still refuses withundefined on an incoming path: 128at thes_cselect.106+j).native_direct_meshthen fails atnot-vcc-sccwith+0x24: graphics register undefined on an incoming path: 128.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-01T08:43:39Z.
Review: APPROVED
Reviewed inverted VCC tracking and the current SCC fixture. The integrated native_direct_mesh checks passed. The captured six-request reach check remains a separate runtime follow-up.