startup: accept the slot 57 count exchange entered under a v_cmpx-narrowed EXEC (Part of #2413) #2635
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2643"
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 Leyukaka on 2026-11-26T00:12:09Z.
Part of #2413 (claim, released in 7176218125 and taken back).
Slot 57 programs end the region before the count exchange with:
mesh_skeletonrefused this asa branch enters or crosses a group-memory exchange. This accepts exactly that shape:s_cbranch_execz, forward, in the region between the exchanges, and its target is the count exchange's first instruction. No other branch may land inside the skipped block.v_cmpx_gt_u32_e32orv_cmpx_lt_u32_e32, right afters_mov_b64 exec, -1(onlys_nop/s_waitcntbetween). Its operands are SGPRs or VGPRs defined for every lane (constants are also taken by the code, but no test covers them). Unlike #2601, no thread index is needed: the block leaves nothing live that a dropped lane could see, so any per-lane EXEC works.s_cmp_eq_i32before any read.s_barrieronly may-writes SCC, so it does not end that scan. Scalar loads and stores stay refused.s_cbranch_execzblocks keep the existing lane-only rule. An entry or otherwise undefined VGPR operand,s_cbranch_execnz, a missing EXEC reset, an EXEC write orv_cmpxinside the block, and a target past or over the exchange all stay refused.The second commit (after the first review) drops the thread-index requirement for the compare: any operands defined for every lane are taken, for the reason above.
Tests (Windows 11, Python 3.14, DXC from the Windows SDK 10.0.26100), on main
8ecaa8eplus these two commits:python -B tests/startup_mesh57_skeleton_check.py: ok.gtand anltcompare against the thread index, anltcompare of two defined VGPRs, a defined VGPR other than the thread index (s13 > v7), and the entry over dead scalar ALU.s_cbranch_execnz, an EXEC write orv_cmpxin the block, a branch that bypasses the EXEC reset (lands on the compare), a target past or over the exchange, a scalar result read after the exchange, avcc_loscalar destination, a scalar load in the block, and dead scalar ALU in anexeczblock other than the count entry.... draw <dxc> offscreen_check warpandhardware: ok. The accepted entry cases are drawn against the CPU model (red 255 for the lanes the compare keeps), on WARP (Microsoft Basic Render Driver) and an NVIDIA GeForce RTX 5080.startup_mesh57_loop_refusal_check,startup_translator_check,startup_gfx2hlsl_refusals_check,docs_links_check.Mutation checks, run by hand. The skeleton check fails on each:
s_cbranch_execnzaccepted;execzblock.Measured on a local capture at main
8ecaa8e(counts and instruction shape only, inputs private), over all 497 slot 57 requests in that cache: 426 stopped at the entry. With this change all 426 get past it and stop at an earliers_cbranch_execzblock whose scalar results, including scalar loads, are read after its join (the case #2601 started on). No slot 57 request translates fully yet.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:16:22Z.
Review: COMMENTED
Review of head
b73a0982(code + fixture tests only, no game run).What I checked:
mesh_skeletonchange intools/startup/gfx2hlsl.py: the new exception is narrow (forwards_cbranch_execzinto the count exchange's first instruction,s_mov_b64 exec, -1thenv_cmpx_{gt,lt}_u32_e32 s, v<thread>). Anything else keeps the old refusal.s_barrieras may-write only. This reads correctly. Scalar loads/stores and branches into the skipped block are refused.count_at + 1and theindex == count_atswitch look consistent with the oldNoneslot.tests/startup_mesh57_skeleton_check.pycover the accepted shape plus refusals (VCC write, scalar load, v_cmpx inside the block).Commands run:
python3 tests/startup_mesh57_skeleton_check.py-> okpython3 tests/docs_links_check.py-> okpython3 tests/bidi_controls_check.py-> okgit diff --check origin/main...HEAD-> cleangein the compare regex and dropping the skipped-block scalar check -> the refusal tests fail as expected (3 FAIL), so the tests guard the new rules.Limits:
AI-assisted; commands listed were executed locally.