startup: lower constant-lane writelane/readlane spills in translate_m… #2629
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2637"
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 SimSalabimse on 2026-11-25T23:58:19Z.
Change
Part of #2413 item T7: accept the constant-lane
v_writelane_b32/v_readlane_b32spill idiom intranslate_mesh57, mirroring #2127 /mesh_entry_aotLANE_SPILL_OPS(and the pixel spill helpers ingfx2hlsl).exec_hiword..m57. No R1, no #2603 / #2492 / #2470, no further T6 loop shapes.Claim: https://github.com/R0Y00/Xbox2Windows/issues/2413#issuecomment-7178160520 (main
66026a39).AI-assisted.
Verification
Host (Linux pe-env / system Python):
All reported
ok/PASSon this agent.Windows verification:
Expected: host
startup_mesh57_lane_spillpass;startup_mesh57_lane_spill_warppass;startup_mesh57_lane_spill_hardwarepass or skip 77 without a mesh-capable GPU. This agent could not run DXC / WARP / hardware draws.Evidence and follow-up
tests/startup_mesh57_skeleton.splus the spill/reload sequence; llvm-mc binary mode is wired in CI.v_movinto the spill VGPR, missing colour writelane; draw mutant zeroessp30_3in HLSL and must change pixels.mesh_entry_aot) are unchanged.Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:01:37Z.
Review: COMMENTED
Review of head
e1317434against current main (0 behind). Comment only.Result: no blocking findings.
v_writelane_b32/v_readlane_b32, wave64 lanes 0..63,exec_lo/exec_hisaved words. The pixel path keeps lanes 0..31. Ordinary vector use, unwritten slot, register lane and lane 64 stay refused by name.startup_mesh57_lane_spill_warp, and_hardware) next to the host check, registered in CMake, windows.yml and AGENTS.md.Commands run (Linux, clean worktree on the PR head):
python3 -B tests/startup_mesh57_lane_spill_check.py,startup_mesh57_skeleton_check.py,startup_mesh57_loop_refusal_check.py: okpython3 tests/docs_links_check.py,python3 tests/bidi_controls_check.py,git diff --check origin/main...HEAD: okexec_hilowers to 1 instead of 0: new test fails. Both reverted.Windows WARP dev + release will be run and posted next.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T00:12:06Z.
Review: CHANGES_REQUESTED
There is a production correctness problem in addition to the mutant DXC failure already reported. The fixture’s spill follows
s_mov_b64 exec, -1(last word before the spillbefe04c1). On wave64, thev_writelane_b32 ... exec_hi, 63therefore stores0xffffffff. This candidate emitssp30_63 = 0u. The existing draw never uses the reload ins41. Changing the fixture’s finalv_mov_b32 v7, s40tov_mov_b32 v7, s41still translates and routes the wrong value to the export. Please keep the ordinary scalar lane 0–63 slice and refuse raw EXEC operands, or prove both EXEC words for each accepted spill and test a consumed reload across the two halves. Please also fix the existing colour mutant so its shader compiles and fails by pixel comparison.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:07:03Z.
Win2025 WARP result for head
e1317434: FAIL, caused by the new test itself (not by the translator).Commands (Win2025, default slot pool, dev + release attempted):
x2w_pipe.py win2025 2637 --wait 7200 --keep-release(auto plan): no new test was in the plan, so I reran withx2w_pipe.py win2025 2637 --wait 7200 --keep-release --regex '^startup_mesh57|^mesh_lane_spill'Result:
startup_mesh57_lane_spillandmesh_lane_spill_cpupass.startup_mesh57_lane_spill_warpandstartup_mesh57_lane_spill_hardwarefail (the hardware one fails the same way on WARP, so this is not a GPU problem). Release did not run because dev failed.First error (dxc, in the mutant step at
tests/startup_mesh57_lane_spill_check.py:165-169):zero-spill.hlsl: error: use of undeclared identifier 'sp30_63'(alsos41 = sp30_63;).The real draw itself is not the failing step; the failure is the negative-control compile. The mutation
re.sub(r'sp30_3 = [^;]+;', 'sp30_3 = 0u;', source, count=1)yields HLSL that no longer declaressp30_63, so dxc refuses it andcheck=Trueraises. Suggested fix: make the mutation target exactly the colour spill write (anchor on thesp30_3assignment with\b, keep every declaration), and compile the mutant with an explicit expectation, then re-run on Win2025.Linux host checks of this test pass, which is why only the WARP phase shows it.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-26T01:08:57Z.
Review of head
e1317434, by reading the diff (not run). Sequences are insertions intotests/startup_mesh57_skeleton.s.1. An
exec_lospill made under the lane-0 mask reloads per thread. Inserted betweends_read_b32 v5, v6 offset:8and the followings_mov_b64 exec, -1, the walk is atmask == 'lane0', andop_x2w_mesh_lane0emitsexec = (tid & 63u) == 0u ? 1u : 0u;. Soemits
sp30_63 = exec, which is 1 only on thread 0 of each wave, while the guest writesexec_lo(1) into lane 63 whatever EXEC is and reloads 1 for the whole wave. The slot is also markeduniform=True. Main refuses this aslane spills are not covered.2. A spill of a register the group-index exchange uses survives the exchange.
require_spill_onlyscansself.insafter the exchange has been rewritten, where itsv_mov_b32 v6, 0andds_write_b32 v6, ...are alreadyx2w_mesh_lane0/s_nop, sov6looks spill-only. Andif lane_spill: reads_v, writes_v = set(), set()(:1667-1668) skips the stale check that the exchange sets up. Withthe guest's exchange writes
v6 = 0in lane 0, so the reload is 0, while the translation keeps('const', 7).Both look closed by the remedy in the existing review (refuse raw EXEC operands; the
exec_lohalf has the same defect as theexec_hione: under full EXEC it reloads 1 where the guest has 0xffffffff) plus one more refusal: a spill to a VGPR the exchanges use (v5and the exchange temporaries), or the spill-only scan run over the instructions before the exchanges are replaced.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-26T01:18:31Z.
Pushed
054efda6for the WARP mutant and review findings one1317434:sp30_3 = …;line so the multi-decl keepssp30_63for DXC (tedin7).exec_lo/exec_hiwritelane sources are refused under the one-lane model (R0Y00 / Leyukaka); fixture parks an ordinary scalar in lane 63 instead.v5.Host checks listed in the updated body all pass here. Windows WARP/hardware re-run still needed on this head.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T02:48:39Z.
Review: APPROVED
Re-reviewed this head after integrating the constant-trip loop and keeping the existing pixel branch and join proof. The mesh path refuses raw EXEC and reuse of exchange VGPRs. WARP and RTX 4060 Laptop both passed the spill and loop draws, and the zeroed-spill shader compiled and produced 259 mismatched pixels on both. The pixel spill and branch controls also passed.