startup: lower slot 57 pre-exchange execz blocks with several scalar loads (Part of #2413) #2775
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2783"
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 JB2WIN on 2026-11-26T08:46:01Z.
Change
Part of #2413 (claim). This follows #2660.
#2660 lowers exactly one
s_buffer_load_dwordin a pre-exchanges_cbranch_execzblock of a slot 57 mesh program. It uses the wave predicatewave_any = (tid & ~63u) < boundcaptured atv_cmpx_gt_u32_e32 s<bound>, v<thread>.This PR accepts a wider block. The block must be straight-line code. It may hold any number of
s_buffer_load_dword*/s_load_dword*loads, scalar ALU and lane-only vector code, including a per-lanev_cmpinto VCC. The lowering stays the #2660 one:!wave_any. Every scalar instruction therefore runs for all lanes of a wave that has an active lane, as the guest runs it once per wave.Added acceptance
Refused (
slot 57 mesh: s_cbranch_execz skips code with effects outside active lanes):src_*operands,s_*_saveexec, MODE writes, stores and atomics;docs/experiments/startup-mesh57-wave-block.mddescribes the shape, the semantics and the census.Verification
Windows 11 build 26200, NVIDIA GeForce RTX 3080 (driver 621.24), DXC from Windows SDK 10.0.26100, Python 3.13. The release build was at
96a7b4fb(only Python files change here). The branch is rebased on4bbe52ee, and the translation checks were re-run there.python -B tests/startup_mesh57_skeleton_check.py: ok.[branch]fall-through.pre-exchange wave block translates: got 'unsupported: slot 57 mesh: s_cbranch_execz ...'.python -B tests/startup_mesh57_skeleton_check.py binary <llvm-mc>: ok. All fixture words, including the newWAVE_BLOCK_MESH, match the encodings. Locallyllvm-mcis a stand-in that runsclang -cc1as -show-encodingfrom LLVM 15.0.7. CI runs the realllvm-mc-15.python -B tests/startup_mesh57_skeleton_check.py draw <dxc> <offscreen_check> warpand... hardware(startup_mesh57_skeleton_draw_warp/_hardware): ok on WARP and on the RTX 3080. The wave block fixture:(exec & 1) == 0, differs from the wave image on 66 pixels and matches its own per-lane image (0 mismatches).startup_mesh57_depth_only_check.py,startup_mesh57_loop_check.py,startup_mesh57_loop_refusal_check.py,startup_mesh57_lane_spill_check.py,docs_links_check.py,bidi_controls_check.py,git diff --check.windows.yml, run throughtools/run_checks_parallel.pyon Windows: 203 ok and 2 skipped.tests/dxc_cache_check.pyfails withWinError 193. It fails the same way on unmodified main on this host, because it starts a POSIX script.branch from between the reset and the compare past the comparecontrol. That control translates when the rule is reverted.Evidence and follow-up
The fixture is source-built and hand-assembled. It extends the existing
tests/startup_mesh57_skeleton.sfixture with the same geometry and draw as #2660.Changed #2660 controls
wider SMEM loadanddead scalar resultare now accepted.missing full EXEC resetused ans_nopin place of the adjacent reset. The reset that closes the group-index exchange still reaches the compare there, with nothing naming EXEC or VCC between them. That shape is now an accepted case, and the missing-reset control writes EXEC froms[4:5]instead.second live scalar writestays refused, because its register has no value before the block.s_loadnow stops at the existings_load with a register offsetrule.Local capture (counts only; no programs, logs or identifiers here)
96a7b4fb, 407 slot 57 requests stop at the execz refusal.s_add_u32that is dead after the jump tos_endpgm. I will send that as a separate PR.v_readfirstlane_b32 outside the group-index read is not covered. No complete translation is added yet.src_scc, or thev_cmpx_lt_u32 v, vcompare. These are not in scope.Checklist
AI-assisted (Claude Code). The commands above were run locally.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:58:29Z.
Review: COMMENTED
Review of head
cb176399against main (fixture and code review only; no game claim is made or checked here).What I checked
tools/startup/gfx2hlsl.py: the wider pre-exchange execz block keeps the #2660 lowering (!wave_anybranch, EXEC-predicated vector writes). The acceptance rules (reset above the compare, no EXEC/VCC use between them, no entry from outside, straight-line block, VCC/SCC dead at the join, only SGPR/SCC/constant scalar operands) match the PR text.tests/startup_mesh57_skeleton_check.py: new accepted case plus refusal controls, and a real D3D12 draw test (startup_mesh57_skeleton_draw_warp/_hardware) that compares GPU readback with the CPU reference and has negative controls (swapped scalars, per-lane predicate).Mutations (each must fail the new test)
FAIL VCC live at the join.entries):FAIL branch from between the reset and the compare past the compare.any(s in edges ...)clause: the suite still passes, because thetargets.intersectionclause and the join handling already refuse a branch inside the block, including one that jumps to the join (I tried that extra control). That clause is redundant, not a bug.Commands run
python3 -B tests/startup_mesh57_skeleton_check.py, plus the depth_only, loop, loop_refusal and lane_spill mesh57 checks: okpython3 tests/docs_links_check.py,python3 tests/bidi_controls_check.py,git diff --check origin/main...HEAD: ok-R startup_mesh57_skeleton. The two failures (_exchange_warp,_exchange_hardware) are a missingstartup_indirect_draw_indexed.exeon that pod, not this PR; every draw, wave_shift and depth test passed there, includingstartup_mesh57_skeleton_draw_hardware.No blocking findings.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:58:30Z.
Win2025 WARP receipt for head
cb176399(branch already up to date with main).Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
cb176399d589e1425fffb2ab2942a95b3c7e01e5:--preset dev):cmake --build --preset dev --target offscreen_check -- -j 2):0.00s(configure0.00s)ctest --preset dev -R 'startup_mesh57_skeleton' --parallel 2 --no-tests=error --output-on-failure): 8/9 passed (8.67s:startup_mesh57_skeleton2.03s,startup_mesh57_skeleton_wave_shift_hardware0.64s,startup_mesh57_skeleton_depth_hardware0.68s,startup_mesh57_skeleton_exchange_hardware0.38s,startup_mesh57_skeleton_draw_hardware3.99s,startup_mesh57_skeleton_wave_shift_warp0.67s,startup_mesh57_skeleton_depth_warp0.71s,startup_mesh57_skeleton_draw_warp3.96s,startup_mesh57_skeleton_exchange_warp3.08s); skipped (capability, not a pass):startup_mesh57_skeleton_exchange_hardware/O2(--preset release):cmake --build --preset release --target offscreen_check -- -j 2):0.00s(configure0.00s)ctest --preset release -R 'startup_mesh57_skeleton' --parallel 2 --no-tests=error --output-on-failure): 8/9 passed (8.49s:startup_mesh57_skeleton2.02s,startup_mesh57_skeleton_wave_shift_hardware0.62s,startup_mesh57_skeleton_depth_hardware0.66s,startup_mesh57_skeleton_exchange_hardware0.39s,startup_mesh57_skeleton_draw_hardware3.75s,startup_mesh57_skeleton_wave_shift_warp0.77s,startup_mesh57_skeleton_depth_warp0.88s,startup_mesh57_skeleton_draw_warp4.11s,startup_mesh57_skeleton_exchange_warp2.85s); skipped (capability, not a pass):startup_mesh57_skeleton_exchange_hardwaretests/startup_mesh57_skeleton_check.pyok (1.9s)26.6sTests named: startup_mesh57_skeleton, _draw_warp/_hardware, depth, wave_shift, _exchange_warp; PYCHECK tests/startup_mesh57_skeleton_check.py rc=0.
tested on RTX 3090 through vkd3d-proton (Linux): 7/9 (the 2 exchange tests need a target missing on that pod; all draw/depth/wave_shift tests pass).
AI-assisted; commands listed were executed locally.