mesh: restore EXEC after a per-lane range through halves, moves and saveexec forms #2141
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2149"
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 tedin7 on 2026-11-25T01:44:41Z.
Part of #1998
What this unblocks: mesh programs that restore EXEC after a per-lane range through a moved copy, the 32-bit halves, a saveexec form, or a join of two arms now translate instead of stopping at the first unmodeled scalar instruction (item C).
What changed
tools/mesh_entry_aot.py(shared bytools/mesh_dynamic_aot.py):exec_lo/exec_hias 32-bit read and write targets (a 64-bit write to one half is refused);s_orn2_b64,s_not_b64;s_andn2,s_or,s_orn2,s_xor_saveexec_b64next to the existings_and_saveexec_b64, all keeping the old mask in the destination pair.KeyError).tests/mesh_entry_check.py:exec-restore(Linux) anddraw-exec-restore(WARP) modes, plus abinaryassembler check. The program uses a moved copy, halves, a flipped and re-joined saved mask, and a restore joined from two arms of a wave-uniform branch. It must lower to the same HLSL as the plain restore program.tests/mesh_dynamic_aot_check.py: the same restore forms and refusals on the dynamic lowerer.mesh_entry_exec_restore_cpu,mesh_entry_exec_restore_draw_{warp,hardware}; docs indocs/experiments.md.s_nand_saveexec_b64,s_cbranch_scc1, backward branch. The draw also checks a depth one ulp off reportsMesh export trace mismatch.Unsupported scalar destination).Verification
Run locally (Linux, no D3D12, no DXC, no llvm-mc):
python3 -B tests/mesh_entry_check.py exec-restore: pass.python3 -B tests/mesh_dynamic_aot_check.py,mesh_dynamic_geometry_check.py,mesh_multi_check.py,mesh_amplification_refusal_check.py,startup_ngg_slice_check.py,docs_links_check.py: pass.NOT yet run (Draft until done on Win2025):
python3 -B tests/mesh_entry_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1ctest --preset dev --no-tests=error -R "^mesh_entry_exec_restore_"(WARP draw plus mismatch control) and-R "^mesh_entry_draw_"for regressions.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:31:56Z.
Review: COMMENTED
Peer review of head
43edcd72: no blocking findings.Verification (Win2025):
python3 -B tests/mesh_entry_check.py exec-restoreandpython3 -B tests/mesh_dynamic_aot_check.py: pass (Linux)x2w_pipe.py win2025 2149 --force --regex '^mesh_(entry|dynamic)_': dev 15/15 and release 15/15 passed, includingmesh_entry_exec_restore_cpu,_draw_warp,_draw_hardware.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T02:38:35Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
43edcd7235ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:56:23Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T02:32:13Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
43edcd7ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T02:38:36Z.
Code review location:
tools/mesh_entry_aot.py; line 56When a shader uses either complemented saveexec form, these callbacks reverse the ISA operand order: the operations are
SRC0 & ~old_execandSRC0 | ~old_exec, respectively. For example, with EXEC equal to 7 and source equal to 2, ANDN2 must produce 0, but this implementation produces 5. An assembled gfx1013 mesh fixture that writes a VGPR under that mask and then restores EXEC successfully lowers with incorrect vertex depths for lanes 0 and 2. Both mesh lowerers therefore silently miscompile valid programs. Usea & ~oldanda | ~old, and test both forms against equivalent ordinary scalar instruction sequences.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:56:23Z.
Code review location:
tools/mesh_entry_aot.py; line 56Fixed in
9f9267e8. The complemented saveexec forms now compute SRC0 & ~EXEC and SRC0 | ~EXEC. The new check intests/mesh_entry_check.py exec-restorecompares each form against the same mask built from ordinary scalar instructions. It failed with the swapped operands and passes now.Verification:
python3 tests/mesh_entry_check.py exec-restore: PASS (it failed before the fix)tests/pso_readiness_check.py,tests/docs_links_check.pyand alltests/mesh_*_check.py: PASS. The pso check also failed in Linux CI; its expected detail now names the unwritten register.x2w_pipe.py win2025 2149: PASS on dev and release (WARP) at9f9267e8AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-25T05:58:13Z.
Ran head
a547e87d. Windows 11 build 26100, debug layer unavailable. Adapters: WARP 10.0.26100.8972, NVIDIA Quadro M1000M 32.0.15.7371, Intel HD Graphics 530 31.0.101.2111, the hardware ones selected withXBOX2WINDOWS_ADAPTER.mesh_entry_exec_restore_cpumesh_entry_exec_restore_draw_{warp,hardware}mesh_shader_tier=unsupportedmesh_shader_tier=unsupportedNeither older GPU has mesh shaders, so the hardware rows are capability skips, not results. Only WARP drew.
AI-assisted.