startup: translate slot 57 mesh requests of one group-memory shape #2439

Merged
NiiRoZz merged 5 commits from upstream-pr/2447 into main 2026-11-25 19:19:52 +00:00
NiiRoZz commented 2026-11-25 17:00:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-25T17:00:36Z.


Refs #2413
Refs #1760

Stacked on the s_waitcnt_depctr change (branch startup/gfx2hlsl-waitcnt-depctr): the accepted shape contains that wait. Merge that one first; this branch then holds one commit.

What changes

tools/startup/gfx2hlsl.py translates a slot 57 mesh request when the mesh program has exactly this shape, and refuses every other program with the first difference:

  1. exec = 1 (lane 0 of each wave), the mask saved in an SGPR pair. Wave 0 (s3 bits 24..27 zero) stores entry v5 >> 7 at group-memory byte 8, waits (s_waitcnt_depctr 0xffe3) and passes a barrier; every other wave passes a barrier and reads byte 8.
  2. Straight-line code up to the next barrier.
  3. One barrier. The wave whose index is zero stores SGPR P at byte 0 and SGPR V at byte 4 under the saved lane-0 mask, waits, passes a barrier and sends one GS_ALLOC_REQ with m0 = P << 12 | V built from those two registers. Every other wave passes a barrier and reads both words back into the same P and V.
  4. Straight-line code to s_endpgm. Exports only here: pos0 and param under exec = -1 narrowed by one v_cmpx_gt_i32 V, thread, the primitive export under the same with P. thread is the v_mbcnt pair over wave << 6.

mesh_skeleton proves the shape before any code is emitted: the instruction sequence of both exchanges, the six group-memory accesses at their literal addresses and in order, every branch target, the registers not overlapping, one request, one writer. Each path passes three barriers and each store has one writer lane, with a wait and a barrier before every read. The walk over the code outside the exchanges refuses, each with its own message: a branch, a group-memory access, barrier or request, a lane spill, a write to s3, to the saved mask or (after the exchange) to P or V, a use of m0 or of the exchange's SCC, an EXEC or VCC use as a wave mask other than the two forms above, a read of a VGPR the two arms leave different or that still holds an entry value, a read of an entry SGPR the root does not define, a read of s3 other than its wave index, a vector compare into an SGPR, an export before the exchange or under the wrong count, a missing or second pos0 or primitive export. A loop is a branch outside the exchanges, so no access, barrier or export can sit in one.

The lowering keeps one writer and one barrier:

if (tid == 0u) { lds[0] = P; lds[1] = V; }
GroupMemoryBarrierWithGroupSync();
P = min(lds[0], 128u);
V = min(lds[1], 128u);
if (V == 0u) P = 0u;
SetMeshOutputCounts(V, P);

P and V are run-time values. The stage is [numthreads(128, 1, 1)] with 128 vertices and 128 triangles declared, the D3D12 limit for the thread count of a mesh shader and the two wave64 waves of a group.

Run-time clamps, which the source program does not have:

  • Both counts are clamped to 128. Thread t writes vertex t and primitive t, so a larger count names outputs no thread writes.
  • Each index is clamped to V - 1, and no primitive is published without a vertex. An index at or past the vertex count has no defined vertex.

The first exchange (the group index word) is not emitted: its result is refused when used as a number, because what v5 holds at entry is not verified.

Handlers shared with other stages: export hands a mesh stage to mesh_export at its top, op_v_mbcnt_lo_u32_b32 has a mesh branch, setup_entry a mesh case, and Pipeline takes the kind of its vertex-producing stage from a class attribute. Vertex, pixel and compute stages take the same paths as before.

translate_request writes <key>.ms57.hlsl, <key>.ps57.hlsl, their ms_6_5 and ps_6_0 bytecode (.ms57.cso, .ps57.cso) and <key>.ms57.txt last. No runtime path loads these names, so a draw still does not use them. A refusal publishes only <key>.fail, as before.

Tests

tests/startup_mesh57_skeleton.s is a source-built program with the shape and a trivial body: counts from two root constants, positions and one parameter from a raw buffer, packed indices from the same buffer.

.\tools\dev.ps1
cmake --preset release
cmake --build --preset release --target offscreen_check
ctest --preset release --no-tests=error -R '^startup_mesh57_skeleton' -V

Result: startup_mesh57_skeleton passed, startup_mesh57_skeleton_draw_warp passed, startup_mesh57_skeleton_draw_hardware passed, no skip.

  • WARP: Microsoft Basic Render Driver, driver 10.0.26100.10068, debug layer enabled, debug_errors=0 debug_warnings=0.
  • Hardware: NVIDIA GeForce RTX 5090, driver 32.0.16.2135, debug layer enabled, debug_errors=0 debug_warnings=0.
  • Windows 10.0.26300.10075, DXC from Windows SDK 10.0.26100.0, commit 58a673cf (local, before any rebase).
  • The hardware draw test took 3 s to 35 s over three runs (five processes, each creating a device) against its 60 s timeout.

The draw mode sends the fixture through the request path, draws the compiled pair with offscreen_check --mesh-indexed and compares the 32x32 read-back with a CPU rasteriser in the check (pixel centres, top-left rule, flat colour of the first vertex). Cases (vertices, primitives): (12, 4), (12, 1), (7, 4) where indices clamp, (0, 4) where nothing is drawn. All report pixels=1024 mismatches=0.

Negative controls:

  • a reference with one wrong pixel fails with pixels=1024 mismatches=1 and Draw reference mismatch;
  • twelve one-word mutations of the fixture are refused, each with its message and with only .fail published: a request built from another register, no barrier between the store and the reads, a store by every lane, no wait before the first barrier, a branch that leaves the exchange, a barrier after the exchange, a branch after the exchange, a position export under the primitive count, a read of a register the exchange leaves different per wave, a read of an entry VGPR, of an entry SGPR, and of s3 as a whole;
  • a request without a pixel stage is refused.
python -B tests/startup_mesh57_skeleton_check.py binary <llvm-mc>   # LLVM 15: ok, the embedded words match the .s
python -B tests/startup_gfx2hlsl_watch_check.py                     # exit 0, two expected messages updated

Existing pure-Python checks of the touched handlers exit 0: startup_gfx2hlsl_refusals_check, startup_translator_check, startup_gfx2hlsl_scalar_m0_check, startup_gfx2hlsl_compute_check, startup_compute_translate_check, startup_compute_lds_b64_check, startup_compute_request_offline_check, startup_gfx2hlsl_export_mask_check, startup_flat_param_check, startup_ngg_slice_check, startup_stream_fetch_check, startup_stream_interface_check.

Measured on a local set of 298 slot 57 requests

0 of 298 translate. Both exchanges match in 281. First refusal per request:

Requests First refusal
179 a branch outside the group-memory exchanges
74 no pixel stage
30 s_cselect_b64 on a wave mask
14 group-index exchange, instruction 2 (the lane mask is not saved; a literal is used later)
1 count exchange, instruction 8

On the mesh program alone (pixel stage ignored): 244 branch, 37 s_cselect_b64, 16 group-index exchange, 1 count exchange.

Not covered

  • Branches and loops outside the two exchanges (the next refusal for most requests), s_cselect_b64 on a wave mask, the variant that does not save the lane mask.
  • A mesh request without a pixel stage.
  • Use of the group index word, pos1 and other export targets, formatted loads in a mesh body.
  • Counts above 128 and out-of-range indices are clamped, not reproduced. The 128 clamp is asserted in the emitted text, not drawn.
  • Loading the translated pair at run time and binding it.
  • Whether the hardware barrier and GroupMemoryBarrierWithGroupSync agree outside this shape. The claim holds for this shape only: one writer, a barrier before every read.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6609513821 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2447). Originally posted by [NiiRoZz](https://github.com/NiiRoZz) on 2026-11-25T17:00:36Z. --- Refs #2413 Refs #1760 Stacked on the `s_waitcnt_depctr` change (branch `startup/gfx2hlsl-waitcnt-depctr`): the accepted shape contains that wait. Merge that one first; this branch then holds one commit. ## What changes `tools/startup/gfx2hlsl.py` translates a slot 57 mesh request when the mesh program has exactly this shape, and refuses every other program with the first difference: 1. `exec = 1` (lane 0 of each wave), the mask saved in an SGPR pair. Wave 0 (`s3` bits 24..27 zero) stores entry `v5 >> 7` at group-memory byte 8, waits (`s_waitcnt_depctr 0xffe3`) and passes a barrier; every other wave passes a barrier and reads byte 8. 2. Straight-line code up to the next barrier. 3. One barrier. The wave whose index is zero stores SGPR P at byte 0 and SGPR V at byte 4 under the saved lane-0 mask, waits, passes a barrier and sends one `GS_ALLOC_REQ` with `m0 = P << 12 | V` built from those two registers. Every other wave passes a barrier and reads both words back into the same P and V. 4. Straight-line code to `s_endpgm`. Exports only here: `pos0` and `param` under `exec = -1` narrowed by one `v_cmpx_gt_i32 V, thread`, the primitive export under the same with P. `thread` is the `v_mbcnt` pair over `wave << 6`. `mesh_skeleton` proves the shape before any code is emitted: the instruction sequence of both exchanges, the six group-memory accesses at their literal addresses and in order, every branch target, the registers not overlapping, one request, one writer. Each path passes three barriers and each store has one writer lane, with a wait and a barrier before every read. The walk over the code outside the exchanges refuses, each with its own message: a branch, a group-memory access, barrier or request, a lane spill, a write to `s3`, to the saved mask or (after the exchange) to P or V, a use of `m0` or of the exchange's SCC, an EXEC or VCC use as a wave mask other than the two forms above, a read of a VGPR the two arms leave different or that still holds an entry value, a read of an entry SGPR the root does not define, a read of `s3` other than its wave index, a vector compare into an SGPR, an export before the exchange or under the wrong count, a missing or second `pos0` or primitive export. A loop is a branch outside the exchanges, so no access, barrier or export can sit in one. The lowering keeps one writer and one barrier: ```hlsl if (tid == 0u) { lds[0] = P; lds[1] = V; } GroupMemoryBarrierWithGroupSync(); P = min(lds[0], 128u); V = min(lds[1], 128u); if (V == 0u) P = 0u; SetMeshOutputCounts(V, P); ``` P and V are run-time values. The stage is `[numthreads(128, 1, 1)]` with 128 vertices and 128 triangles declared, the D3D12 limit for the thread count of a mesh shader and the two wave64 waves of a group. Run-time clamps, which the source program does not have: - Both counts are clamped to 128. Thread `t` writes vertex `t` and primitive `t`, so a larger count names outputs no thread writes. - Each index is clamped to `V - 1`, and no primitive is published without a vertex. An index at or past the vertex count has no defined vertex. The first exchange (the group index word) is not emitted: its result is refused when used as a number, because what `v5` holds at entry is not verified. Handlers shared with other stages: `export` hands a mesh stage to `mesh_export` at its top, `op_v_mbcnt_lo_u32_b32` has a mesh branch, `setup_entry` a mesh case, and `Pipeline` takes the kind of its vertex-producing stage from a class attribute. Vertex, pixel and compute stages take the same paths as before. `translate_request` writes `<key>.ms57.hlsl`, `<key>.ps57.hlsl`, their `ms_6_5` and `ps_6_0` bytecode (`.ms57.cso`, `.ps57.cso`) and `<key>.ms57.txt` last. No runtime path loads these names, so a draw still does not use them. A refusal publishes only `<key>.fail`, as before. ## Tests `tests/startup_mesh57_skeleton.s` is a source-built program with the shape and a trivial body: counts from two root constants, positions and one parameter from a raw buffer, packed indices from the same buffer. ```powershell .\tools\dev.ps1 cmake --preset release cmake --build --preset release --target offscreen_check ctest --preset release --no-tests=error -R '^startup_mesh57_skeleton' -V ``` Result: `startup_mesh57_skeleton` passed, `startup_mesh57_skeleton_draw_warp` passed, `startup_mesh57_skeleton_draw_hardware` passed, no skip. - WARP: Microsoft Basic Render Driver, driver 10.0.26100.10068, debug layer enabled, `debug_errors=0 debug_warnings=0`. - Hardware: NVIDIA GeForce RTX 5090, driver 32.0.16.2135, debug layer enabled, `debug_errors=0 debug_warnings=0`. - Windows 10.0.26300.10075, DXC from Windows SDK 10.0.26100.0, commit 58a673cf (local, before any rebase). - The hardware draw test took 3 s to 35 s over three runs (five processes, each creating a device) against its 60 s timeout. The draw mode sends the fixture through the request path, draws the compiled pair with `offscreen_check --mesh-indexed` and compares the 32x32 read-back with a CPU rasteriser in the check (pixel centres, top-left rule, flat colour of the first vertex). Cases (vertices, primitives): (12, 4), (12, 1), (7, 4) where indices clamp, (0, 4) where nothing is drawn. All report `pixels=1024 mismatches=0`. Negative controls: - a reference with one wrong pixel fails with `pixels=1024 mismatches=1` and `Draw reference mismatch`; - twelve one-word mutations of the fixture are refused, each with its message and with only `.fail` published: a request built from another register, no barrier between the store and the reads, a store by every lane, no wait before the first barrier, a branch that leaves the exchange, a barrier after the exchange, a branch after the exchange, a position export under the primitive count, a read of a register the exchange leaves different per wave, a read of an entry VGPR, of an entry SGPR, and of `s3` as a whole; - a request without a pixel stage is refused. ``` python -B tests/startup_mesh57_skeleton_check.py binary <llvm-mc> # LLVM 15: ok, the embedded words match the .s python -B tests/startup_gfx2hlsl_watch_check.py # exit 0, two expected messages updated ``` Existing pure-Python checks of the touched handlers exit 0: `startup_gfx2hlsl_refusals_check`, `startup_translator_check`, `startup_gfx2hlsl_scalar_m0_check`, `startup_gfx2hlsl_compute_check`, `startup_compute_translate_check`, `startup_compute_lds_b64_check`, `startup_compute_request_offline_check`, `startup_gfx2hlsl_export_mask_check`, `startup_flat_param_check`, `startup_ngg_slice_check`, `startup_stream_fetch_check`, `startup_stream_interface_check`. ## Measured on a local set of 298 slot 57 requests 0 of 298 translate. Both exchanges match in 281. First refusal per request: | Requests | First refusal | |---:|---| | 179 | a branch outside the group-memory exchanges | | 74 | no pixel stage | | 30 | `s_cselect_b64` on a wave mask | | 14 | group-index exchange, instruction 2 (the lane mask is not saved; a literal is used later) | | 1 | count exchange, instruction 8 | On the mesh program alone (pixel stage ignored): 244 branch, 37 `s_cselect_b64`, 16 group-index exchange, 1 count exchange. ## Not covered - Branches and loops outside the two exchanges (the next refusal for most requests), `s_cselect_b64` on a wave mask, the variant that does not save the lane mask. - A mesh request without a pixel stage. - Use of the group index word, `pos1` and other export targets, formatted loads in a mesh body. - Counts above 128 and out-of-range indices are clamped, not reproduced. The 128 clamp is asserted in the emitted text, not drawn. - Loading the translated pair at run time and binding it. - Whether the hardware barrier and `GroupMemoryBarrierWithGroupSync` agree outside this shape. The claim holds for this shape only: one writer, a barrier before every read. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tedin7 commented 2026-11-25 19:03:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T18:32:04Z.

Review: COMMENTED


Review of head 58a673cf (code and tests only, comment review).

Checked

  • Diff vs origin/main: 9 files, +841/-16. The branch holds two commits. The first one (s_waitcnt_depctr) is the same change as #2445, which is still OPEN. So this PR depends on #2445 and cannot land before it. The author states this in the body.
  • .github/workflows/windows.yml: only two test lines added in the Windows matrix and the Linux list. The PR's own CI run on this head shows "Build and test on Windows" and "Run platform-independent Python checks on Linux" green, so the added entries ran. I did not run the CI job myself.
  • CMakeLists.txt: two new add_test entries (offline check, plus a draw variant per adapter with SKIP_RETURN_CODE 77). The pattern matches mesh_pixel_pipeline_*. AGENTS.md list updated.
  • Related open work: #2427 (mesh param exports) and #2444 (s_bitcmp in mesh lowerers) touch the mesh lowering area, not the same slice. I found no other PR for the slot 57 group-memory shape. Whether the three conflict at merge time is for the maintainer to decide.

Commands run (Linux, in a review worktree)

  • python3 -B tests/startup_gfx2hlsl_waitcnt_depctr_check.py: ok
  • python3 -B tests/startup_mesh57_skeleton_check.py (no binary/draw mode; llvm-mc-15 and dxc are not installed here, so the embedded-words check and the draw check were NOT run by me): ok
  • python3 -B tests/startup_gfx2hlsl_watch_check.py: passed
  • python3 tests/docs_links_check.py, python3 tests/bidi_controls_check.py, git diff --check origin/main...HEAD: clean
  • Mutation 1: replaced min(lds[n], 128u) in op_x2w_mesh_counts with an unclamped form. The skeleton check FAILS with expected-vs-got lines. Reverted.
  • Mutation 2: removed the tid == 0u single-writer guard on the lds store. The check FAILS. Reverted.

Notes for the maintainer

  • The offline test compares emitted text for the lowering lines. The real behavior check is the draw mode (WARP/hardware readback). I did not run it, and I did not see a Windows result from the author posted on this head. The only evidence I can cite is the PR's CI run on this head.
  • The PR advances startup (#2413 / #1760). I have no game result and make no claim about startup progress. No game result from the author, @R0Y00 or MasterDomino is posted on this head SHA, so the merge decision stays with them.
  • The body reports 0 of 298 local requests translate with this shape. The value is the verified skeleton plus refusals, not coverage yet. The body says so.
  • The branch is 30 commits behind main. I did not update it (that would change the head SHA).
  • No blocking bug found in the code I read. I did not read every line of the 380-line gfx2hlsl.py change; I read the count-exchange lowering and sampled the refusal paths.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6062932774 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2447#pullrequestreview-6062932774). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T18:32:04Z. **Review:** COMMENTED --- Review of head 58a673cf (code and tests only, comment review). **Checked** - Diff vs origin/main: 9 files, +841/-16. The branch holds two commits. The first one (`s_waitcnt_depctr`) is the same change as #2445, which is still OPEN. So this PR depends on #2445 and cannot land before it. The author states this in the body. - `.github/workflows/windows.yml`: only two test lines added in the Windows matrix and the Linux list. The PR's own CI run on this head shows "Build and test on Windows" and "Run platform-independent Python checks on Linux" green, so the added entries ran. I did not run the CI job myself. - `CMakeLists.txt`: two new `add_test` entries (offline check, plus a `draw` variant per adapter with `SKIP_RETURN_CODE 77`). The pattern matches `mesh_pixel_pipeline_*`. `AGENTS.md` list updated. - Related open work: #2427 (mesh param exports) and #2444 (s_bitcmp in mesh lowerers) touch the mesh lowering area, not the same slice. I found no other PR for the slot 57 group-memory shape. Whether the three conflict at merge time is for the maintainer to decide. **Commands run (Linux, in a review worktree)** - `python3 -B tests/startup_gfx2hlsl_waitcnt_depctr_check.py`: ok - `python3 -B tests/startup_mesh57_skeleton_check.py` (no `binary`/`draw` mode; `llvm-mc-15` and dxc are not installed here, so the embedded-words check and the draw check were NOT run by me): ok - `python3 -B tests/startup_gfx2hlsl_watch_check.py`: passed - `python3 tests/docs_links_check.py`, `python3 tests/bidi_controls_check.py`, `git diff --check origin/main...HEAD`: clean - Mutation 1: replaced `min(lds[n], 128u)` in `op_x2w_mesh_counts` with an unclamped form. The skeleton check FAILS with expected-vs-got lines. Reverted. - Mutation 2: removed the `tid == 0u` single-writer guard on the `lds` store. The check FAILS. Reverted. **Notes for the maintainer** - The offline test compares emitted text for the lowering lines. The real behavior check is the `draw` mode (WARP/hardware readback). I did not run it, and I did not see a Windows result from the author posted on this head. The only evidence I can cite is the PR's CI run on this head. - The PR advances startup (#2413 / #1760). I have no game result and make no claim about startup progress. No game result from the author, @R0Y00 or MasterDomino is posted on this head SHA, so the merge decision stays with them. - The body reports 0 of 298 local requests translate with this shape. The value is the verified skeleton plus refusals, not coverage yet. The body says so. - The branch is 30 commits behind main. I did not update it (that would change the head SHA). - No blocking bug found in the code I read. I did not read every line of the 380-line `gfx2hlsl.py` change; I read the count-exchange lowering and sampled the refusal paths. AI-assisted; commands listed were executed locally.
MasterDomino commented 2026-11-25 19:03:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T18:40:38Z.

Review: CHANGES_REQUESTED


Review of commit 58a673cf. The s_waitcnt_depctr commit has since landed on main as #2445, so I reviewed only the second commit. The shape proof is careful, and the tests and most mutants behave as described. Two P2s need addressing before merge.

What I checked

  • Diff against the merge base: mesh_skeleton, the x2w_mesh_* handlers, mesh_export, the ms branch of v_mbcnt, MeshPipeline.hlsl_ms, translate_mesh57 and pending_keys.
  • Cache keys: x2w-startup-shader-14/14cs are unchanged, and the vs, ps and cs paths emit the same text, since the new code is gated on kind == 'ms'. Before this change every slot 57 request produced only .fail, so no bump is needed.
  • Startup claims: the PR claims no title start-up progress. Translated pairs are not loaded at run time yet.

Findings

  1. P2: the null-primitive bit is ignored (tools/startup/gfx2hlsl.py:4177).
    • The code: mesh_export emits tris[tid] = min(uint3(w, w >> 10, w >> 20) & 1023u, ...) and draws every primitive whose thread passes P > thread.
    • The format: in the gfx10 NGG primitive export, bit 31 marks a null (culled) primitive; Mesa's ac_nir_pack_ngg_prim_exp_arg sets it for culled primitives. tools/mesh_entry_aot.py:856 already refuses packed & 0xC0000000 for that reason.
    • The problem: here the word is a run-time value, so a culled primitive is drawn.
    • Probe: the PR's fixture with bit 31 set on primitive 0, against a reference that skips primitive 0, gives pixels=1024 mismatches=66 (exit 1) on both the AMD Radeon RX 9070 XT (1002:7550, driver 32.0.32029.2010) and WARP 10.0.26100.9818, with debug_errors=0. 66 is exactly that triangle's coverage.
    • Index fields: on gfx10 the index fields are 9 bits, with an edge flag at bits 9, 19 and 29, so & 1023u folds an edge flag into the index.
    • What would resolve it: mask each index with 511u, emit a degenerate or culled primitive when bit 31 is set, and add a draw case with the null bit set.
  2. P2: rebase needed, and one semantic conflict.
    • Text conflicts: the branch conflicts with main in .github/workflows/windows.yml, AGENTS.md and CMakeLists.txt, because the depctr lines are already there.
    • Hidden conflict: tests/startup_gfx2hlsl_watch_check.py:111 from #2421 (the null-export-only pixel stage) still expects 'slot 57 mesh code emission is unavailable', and that string no longer exists here. The file auto-merges, so on a trial merge with both sides kept, startup_gfx2hlsl_watch fails with got unsupported: slot 57 mesh group-index exchange: instruction 1 of the accepted shape (s_mov_b64) is absent.
    • Refusal message: on that merged tree the fixture paired with a null-export-only pixel stage is refused as export target null, with only .fail published. That is safe, but an explicit "depth-only slot 57 pair is not covered" refusal would read better, and the watch expectation needs updating either way.
  3. P3: the group-index s_and_b32 destination is not checked against the saved lane mask (kept at gfx2hlsl.py:1167; the overlap check at :1156–1160 doesn't include it). Changing fixture word 8706ff03 to 8704ff03 (s_and_b32 s4, s3, 0xf000000, which overwrites s[4:5]) still translates, with if (tid == 0u) { lds[0] = s13; lds[1] = s14; }. On hardware, wave 0's saved mask would be 0. Please add that destination to the overlap check.
  4. P3: threads 32–127 are never drawn. The draw cases use at most 12 vertices and 4 primitives, so the v_mbcnt_hi half and wave 1 aren't exercised. A mutant that sets the mbcnt-hi term max(tid & 63u, 32u) - 32u to 0u passes every test. A case with counts of 65 or more, mostly degenerate triangles with the visible ones at high slots, would cover it.

Commands executed (Windows 11 build 26300, DXC from SDK 10.0.26100, llvm-mc 15.0.7, debug layer enabled)

ctest --preset dev --no-tests=error -R '^(startup_mesh57_skeleton(_draw_(warp|hardware))?|startup_gfx2hlsl_waitcnt_depctr|startup_gfx2hlsl_watch)$' -V
python -B tests/startup_mesh57_skeleton_check.py binary <llvm-mc 15.0.7>
ctest --preset dev --no-tests=error -j 8 -R '^(startup_gfx2hlsl|startup_compute|startup_image|startup_flat|startup_ngg|startup_stream|startup_translator|startup_mesh|startup_smem|startup_buffer|startup_inline|startup_sampler)' -E '_(warp|hardware)$'
Test RX 9070 XT WARP
startup_mesh57_skeleton_draw_*, cases (12,4), (12,1), (7,4), (0,4) pass, mismatches=0 pass, mismatches=0
startup_mesh57_skeleton, waitcnt_depctr, watch (at this head) pass –
binary (LLVM 15.0.7) ok –
Broad Python regression 93 pass; 2 not run (executables not built) –

There were no capability skips.

Negative control

Mutant (single line in gfx2hlsl.py, reverted after) Result
index clamp removed caught: FAIL draw of 7 vertices, 4 primitives on both adapters
export mask check reduced to not after caught: FAIL a position export under the primitive count: got 'ok'
v_mbcnt_hi term set to 0u not caught (finding 4)

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6063052863 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2447#pullrequestreview-6063052863). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T18:40:38Z. **Review:** CHANGES_REQUESTED --- Review of commit `58a673cf`. The `s_waitcnt_depctr` commit has since landed on `main` as #2445, so I reviewed only the second commit. The shape proof is careful, and the tests and most mutants behave as described. Two P2s need addressing before merge. ### What I checked - **Diff against the merge base:** `mesh_skeleton`, the `x2w_mesh_*` handlers, `mesh_export`, the `ms` branch of `v_mbcnt`, `MeshPipeline.hlsl_ms`, `translate_mesh57` and `pending_keys`. - **Cache keys:** `x2w-startup-shader-14`/`14cs` are unchanged, and the vs, ps and cs paths emit the same text, since the new code is gated on `kind == 'ms'`. Before this change every slot 57 request produced only `.fail`, so no bump is needed. - **Startup claims:** the PR claims no title start-up progress. Translated pairs are not loaded at run time yet. ### Findings 1. **P2: the null-primitive bit is ignored** (`tools/startup/gfx2hlsl.py:4177`). - **The code:** `mesh_export` emits `tris[tid] = min(uint3(w, w >> 10, w >> 20) & 1023u, ...)` and draws every primitive whose thread passes `P > thread`. - **The format:** in the gfx10 NGG primitive export, bit 31 marks a null (culled) primitive; Mesa's `ac_nir_pack_ngg_prim_exp_arg` sets it for culled primitives. `tools/mesh_entry_aot.py:856` already refuses `packed & 0xC0000000` for that reason. - **The problem:** here the word is a run-time value, so a culled primitive is drawn. - **Probe:** the PR's fixture with bit 31 set on primitive 0, against a reference that skips primitive 0, gives `pixels=1024 mismatches=66` (exit 1) on both the **AMD Radeon RX 9070 XT** (1002:7550, driver 32.0.32029.2010) and WARP 10.0.26100.9818, with `debug_errors=0`. 66 is exactly that triangle's coverage. - **Index fields:** on gfx10 the index fields are 9 bits, with an edge flag at bits 9, 19 and 29, so `& 1023u` folds an edge flag into the index. - **What would resolve it:** mask each index with `511u`, emit a degenerate or culled primitive when bit 31 is set, and add a draw case with the null bit set. 2. **P2: rebase needed, and one semantic conflict.** - **Text conflicts:** the branch conflicts with `main` in `.github/workflows/windows.yml`, `AGENTS.md` and `CMakeLists.txt`, because the depctr lines are already there. - **Hidden conflict:** `tests/startup_gfx2hlsl_watch_check.py:111` from #2421 (the null-export-only pixel stage) still expects `'slot 57 mesh code emission is unavailable'`, and that string no longer exists here. The file auto-merges, so on a trial merge with both sides kept, `startup_gfx2hlsl_watch` fails with `got unsupported: slot 57 mesh group-index exchange: instruction 1 of the accepted shape (s_mov_b64) is absent`. - **Refusal message:** on that merged tree the fixture paired with a null-export-only pixel stage is refused as `export target null`, with only `.fail` published. That is safe, but an explicit "depth-only slot 57 pair is not covered" refusal would read better, and the watch expectation needs updating either way. 3. **P3: the group-index `s_and_b32` destination is not checked against the saved lane mask** (kept at `gfx2hlsl.py:1167`; the overlap check at :1156–1160 doesn't include it). Changing fixture word `8706ff03` to `8704ff03` (`s_and_b32 s4, s3, 0xf000000`, which overwrites `s[4:5]`) still translates, with `if (tid == 0u) { lds[0] = s13; lds[1] = s14; }`. On hardware, wave 0's saved mask would be 0. Please add that destination to the overlap check. 4. **P3: threads 32–127 are never drawn.** The draw cases use at most 12 vertices and 4 primitives, so the `v_mbcnt_hi` half and wave 1 aren't exercised. A mutant that sets the mbcnt-hi term `max(tid & 63u, 32u) - 32u` to `0u` passes every test. A case with counts of 65 or more, mostly degenerate triangles with the visible ones at high slots, would cover it. ### Commands executed (Windows 11 build 26300, DXC from SDK 10.0.26100, llvm-mc 15.0.7, debug layer enabled) ```powershell ctest --preset dev --no-tests=error -R '^(startup_mesh57_skeleton(_draw_(warp|hardware))?|startup_gfx2hlsl_waitcnt_depctr|startup_gfx2hlsl_watch)$' -V python -B tests/startup_mesh57_skeleton_check.py binary <llvm-mc 15.0.7> ctest --preset dev --no-tests=error -j 8 -R '^(startup_gfx2hlsl|startup_compute|startup_image|startup_flat|startup_ngg|startup_stream|startup_translator|startup_mesh|startup_smem|startup_buffer|startup_inline|startup_sampler)' -E '_(warp|hardware)$' ``` | Test | RX 9070 XT | WARP | |---|---|---| | `startup_mesh57_skeleton_draw_*`, cases (12,4), (12,1), (7,4), (0,4) | pass, `mismatches=0` | pass, `mismatches=0` | | `startup_mesh57_skeleton`, `waitcnt_depctr`, `watch` (at this head) | pass | – | | `binary` (LLVM 15.0.7) | `ok` | – | | Broad Python regression | 93 pass; 2 not run (executables not built) | – | There were no capability skips. ### Negative control | Mutant (single line in `gfx2hlsl.py`, reverted after) | Result | |---|---| | index clamp removed | caught: `FAIL draw of 7 vertices, 4 primitives` on both adapters | | export mask check reduced to `not after` | caught: `FAIL a position export under the primitive count: got 'ok'` | | `v_mbcnt_hi` term set to `0u` | **not caught** (finding 4) | AI-assisted; commands listed were executed locally.
ChazY11 commented 2026-11-25 19:04:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T18:31:05Z.


Five mutations on the refusal proofs: two caught, three survive — and one of those is a near-duplicate of a proof that is covered

Baseline on this branch at 58a673cf: startup_mesh57_skeleton_check.py → ok, startup_gfx2hlsl_waitcnt_depctr_check.py → the five-immediate/three-refusal summary, both exit 0.

removed proof in mesh_skeleton result
slot 57 mesh %s: instruction %d of the accepted shape (%s) is absent caught
slot 57 mesh %s: a branch leaves the accepted shape caught
slot 57 mesh program does not end with s_endpgm survived
slot 57 mesh count exchange: registers of the accepted shape overlap survived
slot 57 mesh count exchange: the compared register is not the wave index survived

The third survivor is the one I would look at first: there are two proofs about the wave index and only one is exercised

The fixture pins slot 57 mesh: s3 is read other than as the wave index (its line 108, a mutated instruction word). The code has a second, similarly-named proof with a different message — slot 57 mesh count exchange: the compared register is not the wave index — and removing that one changes nothing in the fixture. So a reader scanning the refusal list sees "the wave index is checked", and it is, but not at that site; the two are distinguishable only by message text, which is exactly the kind of pair that drifts apart later.

Concretely: either that proof is unreachable for every program the accepted shape can reach (then it is dead and should go, with the reason written down), or it guards a real input that has no case yet.

The other two survivors

  • does not end with s_endpgm: every fixture program ends with s_endpgm (line 41 shows it in the happy-path program), so no case omits it. A one-line fixture — the same program with the last instruction dropped — would pin it.
  • registers of the accepted shape overlap: no fixture program reuses a register between the count and group-index exchanges, so the overlap proof is unexercised.

Both are cheap to add and both are the kind of proof that is easy to delete later while "simplifying" the shape test.

What the two caught rows establish

The missing-instruction proof is exercised at four different instruction indices (15, 13, 4, 8 — the fixture asserts the exact index and mnemonic), and the branch proof is exercised too. Those are the two that decide whether a program "is" the accepted shape, so the shape recognition is properly tested; the three survivors are all about the edges of that recognition.

One structural note

mesh_skeleton grows 380 lines in this PR and carries its own micro-interpreter (mesh_run, mesh_vregs, lands). That is a lot of new machinery in one PR, and it is the part I would most want a second pair of eyes on — not because I found anything wrong, but because the refusal proofs above are only as good as the fixture's ability to build the programs that hit them, and eleven of the thirteen fixture cases are mutations of one skeleton.

AI-assisted; the five mutations were run locally on Windows 11 build 26300.9974.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7171015349 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2447#issuecomment-7171015349). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-25T18:31:05Z. --- ## Five mutations on the refusal proofs: two caught, three survive — and one of those is a near-duplicate of a proof that *is* covered Baseline on this branch at `58a673cf`: `startup_mesh57_skeleton_check.py` → `ok`, `startup_gfx2hlsl_waitcnt_depctr_check.py` → the five-immediate/three-refusal summary, both exit 0. | removed proof in `mesh_skeleton` | result | |---|---| | `slot 57 mesh %s: instruction %d of the accepted shape (%s) is absent` | **caught** | | `slot 57 mesh %s: a branch leaves the accepted shape` | **caught** | | `slot 57 mesh program does not end with s_endpgm` | survived | | `slot 57 mesh count exchange: registers of the accepted shape overlap` | survived | | `slot 57 mesh count exchange: the compared register is not the wave index` | survived | ### The third survivor is the one I would look at first: there are two proofs about the wave index and only one is exercised The fixture pins `slot 57 mesh: s3 is read other than as the wave index` (its line 108, a mutated instruction word). The code has a second, similarly-named proof with a different message — `slot 57 mesh count exchange: the compared register is not the wave index` — and removing *that* one changes nothing in the fixture. So a reader scanning the refusal list sees "the wave index is checked", and it is, but not at that site; the two are distinguishable only by message text, which is exactly the kind of pair that drifts apart later. Concretely: either that proof is unreachable for every program the accepted shape can reach (then it is dead and should go, with the reason written down), or it guards a real input that has no case yet. ### The other two survivors - **`does not end with s_endpgm`**: every fixture program ends with `s_endpgm` (line 41 shows it in the happy-path program), so no case omits it. A one-line fixture — the same program with the last instruction dropped — would pin it. - **`registers of the accepted shape overlap`**: no fixture program reuses a register between the count and group-index exchanges, so the overlap proof is unexercised. Both are cheap to add and both are the kind of proof that is easy to delete later while "simplifying" the shape test. ### What the two caught rows establish The missing-instruction proof is exercised at four different instruction indices (15, 13, 4, 8 — the fixture asserts the exact index and mnemonic), and the branch proof is exercised too. Those are the two that decide whether a program "is" the accepted shape, so the shape recognition is properly tested; the three survivors are all about the *edges* of that recognition. ### One structural note `mesh_skeleton` grows 380 lines in this PR and carries its own micro-interpreter (`mesh_run`, `mesh_vregs`, `lands`). That is a lot of new machinery in one PR, and it is the part I would most want a second pair of eyes on — not because I found anything wrong, but because the refusal proofs above are only as good as the fixture's ability to build the programs that hit them, and eleven of the thirteen fixture cases are mutations of one skeleton. AI-assisted; the five mutations were run locally on Windows 11 build 26300.9974.
upstream-sync closed this pull request 2026-11-25 20:04:14 +00:00
MasterDomino commented 2026-11-25 20:04:15 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T19:19:47Z.

Review: APPROVED


Approved at head b1c81d24. My four findings from the review of 58a673cf are addressed in 22664c8b, which I re-verified at this head. This approval replaces my change request.

Re-verification

Windows 11 build 26300, --preset dev, offscreen_check built at b1c81d24. AMD Radeon RX 9070 XT (1002:7550, driver 32.0.32029.2010) and WARP 10.0.26100.9818, debug layer enabled.

ctest --preset dev --no-tests=error -R '^(startup_mesh57_skeleton(_draw_(warp|hardware))?|startup_gfx2hlsl_waitcnt_depctr|startup_gfx2hlsl_watch)$' -V
  • 5/5 pass at the head, with no skips. That includes both draws, now with the five cases including the 128-vertex, 128-primitive case.
  • Merged with current main (6fc112d2, clean): 5/5 pass.

Findings, now pinned

finding fix negative control here (one edit in gfx2hlsl.py, reverted)
P2: null bit 31, & 1023u index w >> 31 != 0u ? (uint3)0u : … & 511u null test dropped: draw fails on the RX 9070 XT and WARP. Index mask back to 1023u: draw fails on both. Both fail at vertices=128 primitives=128 first=112 flags=['80000000', '20080200']: got (1, False), want (0, True).
P2: rebase and the watch expectation main merged; the depth-only pixel stage is refused as slot 57 mesh with a depth-only pixel stage is not covered startup_gfx2hlsl_watch_check.py:111 and startup_mesh57_skeleton_check.py:154 expect that text, and both pass
P3: the wave-test destination not in the overlap check destination added startup_mesh57_skeleton_check.py:111: 8704ff03 is a refusal case
P3: threads 32–127 never drawn 128-thread case on vertices 112..123 v_mbcnt_hi term set to 0u: draw fails on both adapters (it survived at 58a673cf)

The PR claims no start-up progress, since no run-time path loads the translated pair, so there was no executable claim to verify.

Merge checks: required CI passed at this head ("Build and test on Windows" and both Linux jobs). The /O2 and coverage skips come from explicit workflow conditions. There are no unresolved review threads. The #2445 dependency has landed. I read the author's full response and @ChazY11's and @tedin7's reviews.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6063597983 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2447#pullrequestreview-6063597983). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T19:19:47Z. **Review:** APPROVED --- Approved at head `b1c81d24`. My four findings from the review of `58a673cf` are addressed in `22664c8b`, which I re-verified at this head. This approval replaces my change request. ### Re-verification Windows 11 build 26300, `--preset dev`, `offscreen_check` built at `b1c81d24`. **AMD Radeon RX 9070 XT** (1002:7550, driver 32.0.32029.2010) and WARP 10.0.26100.9818, debug layer enabled. ```powershell ctest --preset dev --no-tests=error -R '^(startup_mesh57_skeleton(_draw_(warp|hardware))?|startup_gfx2hlsl_waitcnt_depctr|startup_gfx2hlsl_watch)$' -V ``` - **5/5 pass** at the head, with no skips. That includes both draws, now with the five cases including the 128-vertex, 128-primitive case. - **Merged with current `main` (`6fc112d2`, clean):** 5/5 pass. ### Findings, now pinned | finding | fix | negative control here (one edit in `gfx2hlsl.py`, reverted) | |---|---|---| | P2: null bit 31, `& 1023u` index | `w >> 31 != 0u ? (uint3)0u : … & 511u` | null test dropped: **draw fails** on the RX 9070 XT and WARP. Index mask back to `1023u`: **draw fails** on both. Both fail at `vertices=128 primitives=128 first=112 flags=['80000000', '20080200']: got (1, False), want (0, True)`. | | P2: rebase and the watch expectation | `main` merged; the depth-only pixel stage is refused as `slot 57 mesh with a depth-only pixel stage is not covered` | `startup_gfx2hlsl_watch_check.py:111` and `startup_mesh57_skeleton_check.py:154` expect that text, and both pass | | P3: the wave-test destination not in the overlap check | destination added | `startup_mesh57_skeleton_check.py:111`: `8704ff03` is a refusal case | | P3: threads 32–127 never drawn | 128-thread case on vertices 112..123 | `v_mbcnt_hi` term set to `0u`: **draw fails** on both adapters (it survived at `58a673cf`) | The PR claims no start-up progress, since no run-time path loads the translated pair, so there was no executable claim to verify. Merge checks: required CI passed at this head ("Build and test on Windows" and both Linux jobs). The `/O2` and coverage skips come from explicit workflow conditions. There are no unresolved review threads. The #2445 dependency has landed. I read the author's full response and @ChazY11's and @tedin7's reviews. AI-assisted; commands listed were executed locally.
NiiRoZz commented 2026-11-25 20:04:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-25T19:15:18Z.


Review round addressed. Head is now b1c81d24: a merge of main, the fix commit 22664c8b, then a second clean merge of main (after that merge only the mesh57, watch, sop2-complement, translator and depctr checks were re-run; the draw was not).

To MasterDomino

Thanks. All four findings reproduced here and are addressed in 22664c8b.

  1. Null bit and index width (P2): real. The lowering now masks each index with 511u and gives a primitive with bit 31 set one vertex three times, so it covers no pixel. Edge flags are ignored (triangles are filled); bit 30 is not modelled. The format is the one the primitive-export row of docs/experiments.md already states (9-bit index, edge flag in bit 9, bit 31 null). The draw has a new case with the first triangle null and the second carrying all three edge flags. Against the lowering of 58a673cf that case fails on WARP (exit 1); with the fix it passes. Restoring & 1023u or dropping the null test each fails that case.
  2. Rebase and the watch check (P2): real. main is merged (d9e93126); the three list conflicts keep one waitcnt_depctr entry each. A null-export-only pixel stage is now refused in translate_mesh57 as slot 57 mesh with a depth-only pixel stage is not covered, before the mesh shape is read, and startup_gfx2hlsl_watch_check.py expects that. The mesh57 check pairs its accepted fixture with the same pixel stage. Removing the refusal fails both checks.
  3. Wave-test destination (P3): real. 8704ff03 translated before. The destination is now part of the overlap check and that word is a refusal case (registers of the accepted shape overlap).
  4. Threads 32-127 (P3): real. The fixture now reads the buffer slot of a thread's low four bits (two v_and_b32 v4, 15, v0; words checked with llvm-mc 15.0.7), so every thread stays inside the 512-byte buffer and the four earlier cases are unchanged. The new case runs 128 vertices and 128 primitives with the triangles on vertices 112..123 (wave 1, lanes 48..59). The v_mbcnt_hi term set to 0u now fails it.

Results at 22664c8b, Windows 11 build 26300, debug layer enabled, DXC 1.9.0.5512, offscreen_check built from an earlier main:

Test NVIDIA GeForce RTX 5090 (10de:2b85, driver 32.0.16.2135) WARP 10.0.26100.10068
startup_mesh57_skeleton_check.py draw, five cases pass, mismatches=0, debug_errors=0 pass, mismatches=0, debug_errors=0

startup_mesh57_skeleton_check.py (offline and binary), startup_gfx2hlsl_waitcnt_depctr_check.py, startup_translator_check.py and every no-argument startup_gfx2hlsl_*_check.py (68 scripts in all) exit 0. No capability skips.

Mutant (one edit in gfx2hlsl.py, reverted) Before Now
v_mbcnt_hi term 0u not caught draw fails (128-thread case)
index mask back to 1023u no case draw fails (128-thread case)
null bit ignored no case draw fails (128-thread case)
wave-test destination dropped from the overlap check translated refusal case fails
depth-only refusal removed n/a mesh57 check and watch check fail
index clamp removed caught still caught (7 vertices, 4 primitives)

Not done: the null, edge-flag and high-thread controls share one draw case, so a failure there does not say which of the three broke.

To ChazY11

Thanks, all three survivors were real gaps (I re-ran the three removals against the tests of 58a673cf: exit 0 each). Each now has a control in 22664c8b, and each of your three mutations fails startup_mesh57_skeleton_check.py.

  • the compared register is not the wave index: kept, not a duplicate. The s3 is read other than as the wave index proof looks at reads of s3. This one looks at the register the count exchange compares. A program can derive the thread index correctly and then rewrite that register before the count barrier; only this proof refuses it. The new case does exactly that (s_mov_b32 s6, s8 in place of a wait): without the proof it translates.
  • registers of the accepted shape overlap: kept. New case: the wave test writes the saved lane-0 mask (also MasterDomino's finding 3, which added that register to the check). It pins the proof as a whole; the other clauses of that condition do not each have their own case.
  • does not end with s_endpgm: kept. A request cannot reach it: translate_mesh57 refuses a missing terminator first, with another message. MeshPipeline can be built directly, as the draw mode does, and the walk takes the last instruction as the terminator without reading it, so the proof stays and the new case builds the pipeline with s_nop in place of s_endpgm.

On the size of mesh_skeleton: agreed that it wants a second reader. Most cases are still mutations of one skeleton; that has not changed in this round.

To tedin7

Thanks for the check and the two mutations.

  • The branch now contains main (d9e93126); the s_waitcnt_depctr commit is the one that landed as #2445.
  • Windows draw results for the current head are in the table in the reply to MasterDomino (one hardware adapter and WARP, both mismatches=0).
  • Still true: no run-time path loads the translated pair, and no start-up progress is claimed.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7172038003 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2447#issuecomment-7172038003). Originally posted by [NiiRoZz](https://github.com/NiiRoZz) on 2026-11-25T19:15:18Z. --- Review round addressed. Head is now `b1c81d24`: a merge of `main`, the fix commit `22664c8b`, then a second clean merge of `main` (after that merge only the mesh57, watch, sop2-complement, translator and depctr checks were re-run; the draw was not). ## To MasterDomino Thanks. All four findings reproduced here and are addressed in `22664c8b`. 1. **Null bit and index width (P2): real.** The lowering now masks each index with `511u` and gives a primitive with bit 31 set one vertex three times, so it covers no pixel. Edge flags are ignored (triangles are filled); bit 30 is not modelled. The format is the one the primitive-export row of `docs/experiments.md` already states (9-bit index, edge flag in bit 9, bit 31 null). The draw has a new case with the first triangle null and the second carrying all three edge flags. Against the lowering of `58a673cf` that case fails on WARP (exit 1); with the fix it passes. Restoring `& 1023u` or dropping the null test each fails that case. 2. **Rebase and the watch check (P2): real.** `main` is merged (`d9e93126`); the three list conflicts keep one `waitcnt_depctr` entry each. A null-export-only pixel stage is now refused in `translate_mesh57` as `slot 57 mesh with a depth-only pixel stage is not covered`, before the mesh shape is read, and `startup_gfx2hlsl_watch_check.py` expects that. The mesh57 check pairs its accepted fixture with the same pixel stage. Removing the refusal fails both checks. 3. **Wave-test destination (P3): real.** `8704ff03` translated before. The destination is now part of the overlap check and that word is a refusal case (`registers of the accepted shape overlap`). 4. **Threads 32-127 (P3): real.** The fixture now reads the buffer slot of a thread's low four bits (two `v_and_b32 v4, 15, v0`; words checked with llvm-mc 15.0.7), so every thread stays inside the 512-byte buffer and the four earlier cases are unchanged. The new case runs 128 vertices and 128 primitives with the triangles on vertices 112..123 (wave 1, lanes 48..59). The `v_mbcnt_hi` term set to `0u` now fails it. Results at `22664c8b`, Windows 11 build 26300, debug layer enabled, DXC 1.9.0.5512, `offscreen_check` built from an earlier `main`: | Test | NVIDIA GeForce RTX 5090 (10de:2b85, driver 32.0.16.2135) | WARP 10.0.26100.10068 | |---|---|---| | `startup_mesh57_skeleton_check.py draw`, five cases | pass, `mismatches=0`, `debug_errors=0` | pass, `mismatches=0`, `debug_errors=0` | `startup_mesh57_skeleton_check.py` (offline and `binary`), `startup_gfx2hlsl_waitcnt_depctr_check.py`, `startup_translator_check.py` and every no-argument `startup_gfx2hlsl_*_check.py` (68 scripts in all) exit 0. No capability skips. | Mutant (one edit in `gfx2hlsl.py`, reverted) | Before | Now | |---|---|---| | `v_mbcnt_hi` term `0u` | not caught | draw fails (128-thread case) | | index mask back to `1023u` | no case | draw fails (128-thread case) | | null bit ignored | no case | draw fails (128-thread case) | | wave-test destination dropped from the overlap check | translated | refusal case fails | | depth-only refusal removed | n/a | mesh57 check and watch check fail | | index clamp removed | caught | still caught (7 vertices, 4 primitives) | Not done: the null, edge-flag and high-thread controls share one draw case, so a failure there does not say which of the three broke. ## To ChazY11 Thanks, all three survivors were real gaps (I re-ran the three removals against the tests of `58a673cf`: exit 0 each). Each now has a control in `22664c8b`, and each of your three mutations fails `startup_mesh57_skeleton_check.py`. - **`the compared register is not the wave index`: kept, not a duplicate.** The `s3 is read other than as the wave index` proof looks at reads of `s3`. This one looks at the register the count exchange compares. A program can derive the thread index correctly and then rewrite that register before the count barrier; only this proof refuses it. The new case does exactly that (`s_mov_b32 s6, s8` in place of a wait): without the proof it translates. - **`registers of the accepted shape overlap`: kept.** New case: the wave test writes the saved lane-0 mask (also MasterDomino's finding 3, which added that register to the check). It pins the proof as a whole; the other clauses of that condition do not each have their own case. - **`does not end with s_endpgm`: kept.** A request cannot reach it: `translate_mesh57` refuses a missing terminator first, with another message. `MeshPipeline` can be built directly, as the draw mode does, and the walk takes the last instruction as the terminator without reading it, so the proof stays and the new case builds the pipeline with `s_nop` in place of `s_endpgm`. On the size of `mesh_skeleton`: agreed that it wants a second reader. Most cases are still mutations of one skeleton; that has not changed in this round. ## To tedin7 Thanks for the check and the two mutations. - The branch now contains `main` (`d9e93126`); the `s_waitcnt_depctr` commit is the one that landed as #2445. - Windows draw results for the current head are in the table in the reply to MasterDomino (one hardware adapter and WARP, both `mismatches=0`). - Still true: no run-time path loads the translated pair, and no start-up progress is claimed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2439
No description provided.