D3D12.X: execute two-pass mesh shaders on DispatchMesh and ExecuteIndirect #724

Closed
github-bot wants to merge 1 commit from gh-pr/724/head into gh-pr/724/base
Owner

@⁠Cattn on GitHub · 2026-11-24 04:06 UTC · original
Cattn:two-pass-dispatch-mesh → main · +462 −9 · 4 files · 1 commits · closed without merging

Console mesh shaders translated to a two-pass pair (compute + mesh/PS, TwoPassPso) were already built during CreatePipelineState, but there was no execution path for them: DispatchMesh was not hooked on the console command list vtable, and ExecuteIndirect did not run the compute pass or bind the record buffer (u1) before the mesh pass.

What is in it

  • crates/xcl/src/hle/d3d12x/console_list.rs: track the console mesh root-argument layout (inline_ms across 16 SGPRs from s16 with the spill table pointer in s[8:9]) via user_data_ms, and recycle per-allocator two-pass record buffers on allocator_reset.
  • crates/xcl/src/hle/d3d12x/device_x.rs: in create_command_signature_x, create a companion DISPATCH command signature alongside non-root-changing DISPATCH_MESH command signatures and register (sig, companion, byte_stride, mesh_offset).
  • crates/xcl/src/hle/d3d12x/real.rs: hook DispatchMesh at console command list slot 127 (newer layout slot 129) and add list_device helper.
  • crates/xcl/src/hle/d3d12x/bind.rs: implement dispatch_mesh and TwoPassPso handling in execute_indirect: allocate/recycle a DEFAULT-heap UAV record buffer per command list, bind u0 (io), u1 (res), u2..u5 (UMA), run Pass 1 compute -> UAV barrier -> Pass 2 mesh+PS -> UAV barrier, and scale indirect DispatchMesh group counts on the GPU when mesh_groups_per_record > 1.
  • Unit tests: console_list::tests::mesh_arguments_go_in_user_sgprs_from_s16 and bind::tests::dispatch_mesh_signature_tracking_returns_companion_and_layout.

Tested

  • NVIDIA GeForce RTX 4070 12 GB, Windows 11, rustc 1.93.1 (01f6ddf75 2026-02-11), debug for workspace tests, release for regression runs.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 on 2624f00: 703 passed, 0 failed, 41 ignored.
    • SKIPPED (no wave64): gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware.
  • Also verified in a local combined stack on title 7f4b2c91 past loading: 128+ two-pass ExecuteIndirect(DispatchMesh) calls executed cleanly and rendered 3D world geometry (streetlights, gantries, foliage) without device removal.

Regression run

main:

xcl-smoke v1
commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968
gpu: NVIDIA GeForce RTX 4070
title: 7f4b2c91
seconds: 60
exit: 0x0
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 53 60 60
device removals: 0
crashes: 0
peak commit: 15932 MB

PR:

xcl-smoke v1
commit: 2624f00c4e2d8b87aa1828233fb2f60899eb9533
gpu: NVIDIA GeForce RTX 4070
title: 7f4b2c91
seconds: 60
exit: 0x0
frames shown: 1634 (PresentX 1634)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14704 MB

Not tested

  • AMD or Intel GPUs, wave64 hardware, Linux/Wine.
  • Direct DispatchMesh or indirect ExecuteIndirect(DispatchMesh) with mesh_groups_per_record > 1 on a standalone GPU unit test (observed calls on title 7f4b2c91 had split 1).
  • Titles that use root-changing DISPATCH_MESH command signatures (skipped as before).

AI use

  • Antigravity with Gemini 4 Neon implemented the two-pass execution path, unit tests, and this PR description, and ran the workspace tests and regression runs on the hardware above.
**@⁠Cattn** on GitHub · 2026-11-24 04:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/724) `Cattn:two-pass-dispatch-mesh` → `main` · +462 −9 · 4 files · 1 commits · closed without merging Console mesh shaders translated to a two-pass pair (compute + mesh/PS, `TwoPassPso`) were already built during `CreatePipelineState`, but there was no execution path for them: `DispatchMesh` was not hooked on the console command list vtable, and `ExecuteIndirect` did not run the compute pass or bind the record buffer (`u1`) before the mesh pass. **What is in it** - `crates/xcl/src/hle/d3d12x/console_list.rs`: track the console mesh root-argument layout (`inline_ms` across 16 SGPRs from `s16` with the spill table pointer in `s[8:9]`) via `user_data_ms`, and recycle per-allocator two-pass record buffers on `allocator_reset`. - `crates/xcl/src/hle/d3d12x/device_x.rs`: in `create_command_signature_x`, create a companion `DISPATCH` command signature alongside non-root-changing `DISPATCH_MESH` command signatures and register `(sig, companion, byte_stride, mesh_offset)`. - `crates/xcl/src/hle/d3d12x/real.rs`: hook `DispatchMesh` at console command list slot `127` (newer layout slot `129`) and add `list_device` helper. - `crates/xcl/src/hle/d3d12x/bind.rs`: implement `dispatch_mesh` and `TwoPassPso` handling in `execute_indirect`: allocate/recycle a `DEFAULT`-heap UAV record buffer per command list, bind `u0` (`io`), `u1` (`res`), `u2..u5` (UMA), run Pass 1 compute -> UAV barrier -> Pass 2 mesh+PS -> UAV barrier, and scale indirect `DispatchMesh` group counts on the GPU when `mesh_groups_per_record > 1`. - Unit tests: `console_list::tests::mesh_arguments_go_in_user_sgprs_from_s16` and `bind::tests::dispatch_mesh_signature_tracking_returns_companion_and_layout`. **Tested** - NVIDIA GeForce RTX 4070 12 GB, Windows 11, `rustc 1.93.1 (01f6ddf75 2026-02-11)`, debug for workspace tests, release for regression runs. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` on `2624f00`: **703 passed, 0 failed, 41 ignored**. - SKIPPED (no wave64): `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware`. - Also verified in a local combined stack on title `7f4b2c91` past loading: `128+` two-pass `ExecuteIndirect(DispatchMesh)` calls executed cleanly and rendered 3D world geometry (streetlights, gantries, foliage) without device removal. **Regression run** main: ``` xcl-smoke v1 commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968 gpu: NVIDIA GeForce RTX 4070 title: 7f4b2c91 seconds: 60 exit: 0x0 frames shown: none logged (the run did not reach its end) presents per 2 s (last 3): 53 60 60 device removals: 0 crashes: 0 peak commit: 15932 MB ``` PR: ``` xcl-smoke v1 commit: 2624f00c4e2d8b87aa1828233fb2f60899eb9533 gpu: NVIDIA GeForce RTX 4070 title: 7f4b2c91 seconds: 60 exit: 0x0 frames shown: 1634 (PresentX 1634) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14704 MB ``` **Not tested** - AMD or Intel GPUs, wave64 hardware, Linux/Wine. - Direct `DispatchMesh` or indirect `ExecuteIndirect(DispatchMesh)` with `mesh_groups_per_record > 1` on a standalone GPU unit test (observed calls on title `7f4b2c91` had `split 1`). - Titles that use root-changing `DISPATCH_MESH` command signatures (skipped as before). **AI use** - Antigravity with Gemini 4 Neon implemented the two-pass execution path, unit tests, and this PR description, and ran the workspace tests and regression runs on the hardware above.
Console mesh shaders translated to a two-pass pair (compute + mesh/PS,
TwoPassPso) were built by CreatePipelineState but had no execution path:
DispatchMesh was not hooked on the console command list vtable, and
ExecuteIndirect did not dispatch the compute pass or bind the record
buffer (u1) before invoking the mesh pass.

Hook DispatchMesh (slot 127, newer layout slot 129) and handle TwoPassPso
in ExecuteIndirect:
- Track console mesh root-argument layout (s[8:9] spill table, inline
  arguments from s16 across 16 SGPRs) in console_list::user_data_ms.
- Create a companion DISPATCH command signature alongside non-root-changing
  DISPATCH_MESH command signatures in device_x::create_command_signature_x.
- Allocate/recycle a DEFAULT-heap UAV record buffer per command list
  (recycled on allocator reset), bind u0 (io), u1 (res), u2..u5 (UMA),
  run the compute pass -> UAV barrier -> mesh pass -> UAV barrier, and
  scale indirect DispatchMesh group counts on the GPU when
  mesh_groups_per_record > 1.

Assisted-by: Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:30:37 +00:00
github-bot closed this pull request 2026-11-26 04:30:37 +00:00
Author
Owner

@⁠lordon1a on GitHub · 2026-11-24 04:15 UTC · original

Independent test report on 2624f00:

Tested

  • Hardware: NVIDIA GeForce RTX 3070 Ti Laptop GPU (driver 616.64, wave32, SM 6.6), Intel i7-12700H, Windows 11 Home 26H2 (build 26200), rustc 1.100.0 (x86_64-pc-windows-gnullvm), debug build, DXC 1.9.2609.5 (01b62ad4)
  • Command: cargo test -p xcl --lib hle::d3d12x -- --test-threads=1
  • Result: 107 passed, 0 failed, 1 ignored in 10.65s (including dispatch_mesh_signature_tracking_returns_companion_and_layout and mesh_arguments_go_in_user_sgprs_from_s16)

Not tested

  • AMD / wave64, Intel GPU, retail title (xcl-smoke)

AI use

  • Antigravity (Google DeepMind agent) — fetched 2624f00 in a detached worktree, audited the diff, ran the test suite, and posted this report.
**@⁠lordon1a** on GitHub · 2026-11-24 04:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7121857189) Independent test report on `2624f00`: **Tested** - Hardware: NVIDIA GeForce RTX 3070 Ti Laptop GPU (driver `616.64`, wave32, SM 6.6), Intel i7-12700H, Windows 11 Home 26H2 (build 26200), `rustc 1.100.0` (`x86_64-pc-windows-gnullvm`), debug build, DXC `1.9.2609.5` (`01b62ad4`) - Command: `cargo test -p xcl --lib hle::d3d12x -- --test-threads=1` - Result: **107 passed, 0 failed, 1 ignored** in `10.65s` (including `dispatch_mesh_signature_tracking_returns_companion_and_layout` and `mesh_arguments_go_in_user_sgprs_from_s16`) **Not tested** - AMD / wave64, Intel GPU, retail title (`xcl-smoke`) **AI use** - Antigravity (Google DeepMind agent) — fetched `2624f00` in a detached worktree, audited the diff, ran the test suite, and posted this report.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-24 04:28 UTC · original

Independent GPU readback for the split >1 indirect-argument scaler at 2624f00. Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11, debug build.

A temporary synthetic fixture called the PR’s make_scaled_args_buffer on 65 records with a 32-byte stride and a 64-byte source offset. With a split factor of 4, only mesh X changed. All 520 output words matched, and all 536 source words were unchanged. Both fresh runs passed (1 passed, 0 failed, 0 ignored, 0 skipped each) with zero D3D12 InfoQueue errors or corruption messages, first with the standard debug layer and again with GPU-based validation enabled.

cargo test --offline --locked -p xcl --lib gpu_scales_padded_mesh_arguments_at_nonzero_offset -- --nocapture --test-threads=1

This covers the argument scaler. End-to-end ExecuteIndirect, rendered output, and retail gameplay were outside this test. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the fixture and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-24 04:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7122048406) Independent GPU readback for the split >1 indirect-argument scaler at [`2624f00`](https://github.com/ivall/xcl/commit/2624f00c4e2d8b87aa1828233fb2f60899eb9533). Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11, debug build. A temporary synthetic fixture called the PR’s `make_scaled_args_buffer` on 65 records with a 32-byte stride and a 64-byte source offset. With a split factor of 4, only mesh X changed. All 520 output words matched, and all 536 source words were unchanged. Both fresh runs passed (1 passed, 0 failed, 0 ignored, 0 skipped each) with zero D3D12 InfoQueue errors or corruption messages, first with the standard debug layer and again with GPU-based validation enabled. `cargo test --offline --locked -p xcl --lib gpu_scales_padded_mesh_arguments_at_nonzero_offset -- --nocapture --test-threads=1` This covers the argument scaler. End-to-end `ExecuteIndirect`, rendered output, and retail gameplay were outside this test. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the fixture and drafted this report.
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 04:39 UTC · original

Test run of 2624f00c4e2d8b87aa1828233fb2f60899eb9533 on AMD RDNA4. I merged it onto current main 64b3f35 locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, mesh shaders), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 703 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 662 passed, 0 failed, 21 ignored
  • 0 SKIPPED; gpu_mesh_mode_two_passes, dispatch_mesh_signature_tracking_returns_companion_and_layout and retail_mesh_pipelines_through_the_hook pass; this adapter has mesh shaders, so the two-pass mesh tests ran for real rather than skipping.

Review: The PR adds the missing execution path: DispatchMesh on the console list and ExecuteIndirect now run the compute pass and bind the record buffer before the mesh pass, with per-allocator record buffers recycled on reset. At 471 lines I reviewed the structure, not every line; nothing stood out.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

**@⁠MesshM** on GitHub · 2026-11-24 04:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7122226222) Test run of `2624f00c4e2d8b87aa1828233fb2f60899eb9533` on AMD RDNA4. I merged it onto current `main` `64b3f35` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, mesh shaders), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **703 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 662 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `gpu_mesh_mode_two_passes`, `dispatch_mesh_signature_tracking_returns_companion_and_layout` and `retail_mesh_pipelines_through_the_hook` pass; this adapter has mesh shaders, so the two-pass mesh tests ran for real rather than skipping. **Review:** The PR adds the missing execution path: `DispatchMesh` on the console list and `ExecuteIndirect` now run the compute pass and bind the record buffer before the mesh pass, with per-allocator record buffers recycled on reset. At 471 lines I reviewed the structure, not every line; nothing stood out. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Author
Owner

@⁠badoomtch on GitHub · 2026-11-24 06:52 UTC · original

A retail data point for the ExecuteIndirect argument path on Windows, RTX 5080. These were local builds based on af20b4b38e5a, with code from #630, #304 and parts of this PR, a bounded two-pass implementation and extra resource-state checks. We ran with XCL_INDIRECT_MESH=1 and the slot-24 remap enabled.

The title created one pure mesh-dispatch signature and no mixed or root-changing signatures. In one run, our check withheld 1,450 calls before recording. The argument resource was a coherent console buffer in 1,074 cases and a sparse buffer in 376. In both groups the recording had no known native read state. This is a count from our guard, not a failure count for this PR.

In a separate run, reading from a verified alias of the same coherent backing allowed eight calls to be recorded. At the end, all eight scratch owners were still pending and no readback had retired. We therefore have no measured GPU acceptance, capacity drops or visible geometry from those eight. Reporting calls recorded, readbacks retired and GPU-side rejected records separately would make that distinction visible when testing this path on a title.

AI use: Codex (GPT-6) reviewed the local runtime reports and drafted this comment.

**@⁠badoomtch** on GitHub · 2026-11-24 06:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7124386783) A retail data point for the `ExecuteIndirect` argument path on Windows, RTX 5080. These were local builds based on `af20b4b38e5a`, with code from #630, #304 and parts of this PR, a bounded two-pass implementation and extra resource-state checks. We ran with `XCL_INDIRECT_MESH=1` and the slot-24 remap enabled. The title created one pure mesh-dispatch signature and no mixed or root-changing signatures. In one run, our check withheld 1,450 calls before recording. The argument resource was a coherent console buffer in 1,074 cases and a sparse buffer in 376. In both groups the recording had no known native read state. This is a count from our guard, not a failure count for this PR. In a separate run, reading from a verified alias of the same coherent backing allowed eight calls to be recorded. At the end, all eight scratch owners were still pending and no readback had retired. We therefore have no measured GPU acceptance, capacity drops or visible geometry from those eight. Reporting calls recorded, readbacks retired and GPU-side rejected records separately would make that distinction visible when testing this path on a title. AI use: Codex (GPT-6) reviewed the local runtime reports and drafted this comment.
Author
Owner

@⁠NathanTheophile on GitHub · 2026-11-24 07:32 UTC · original

Review of 2624f00, from reading bind.rs and checking two points on the GPU. I'm interested because #529 (drawing the records with a VS on GPUs without mesh shaders) would build on this execution path.

1. The record buffer is not sized to the dispatch, and root UAVs have no bounds check. ensure_res_buffer caps the buffer at 128 MiB (bind.rs:321, .min(128 << 20)), and ExecuteIndirect always asks for 32 MiB (bind.rs:547). The compute pass writes record gid.x with no bound (emit.rs:4301). With the retail transform record of #304 (21 params + clip distance: 11,908 dwords, 47,632 B), 32 MiB holds 704 groups and 128 MiB holds 2,817. To check where the excess goes, I ran the NGG fixture of gpu_mesh_mode_two_passes with its record buffer as a 64 KiB placed resource and a zeroed buffer placed right after it in the same heap. 14 groups fit and left the next buffer untouched. With 20 groups, 101 dwords of the next buffer were overwritten, and the headers of records 15–19 (nv = 3, np = 1) sit exactly where they would fall past the end. In the runtime, that is whatever the driver placed after the record buffer.

2. Indirect arguments with Y or Z > 1 lose groups. The direct path flattens x·y·z (bind.rs:487-499), but the companion DISPATCH at bind.rs:549 runs the title's (x, y, z) as given. The translated program, and the pass-through, index records by gid.x only (emit.rs:4301, :4310 for v5, :4670). Same fixture, compute pass only: with (2,1,1) the two records are group 0 (x0 = -1) and group 1 (x0 = 0). With (1,2,1), record 0 is group 0 and record 1 stays empty (nv = np = 0): the second group wrote record 0 again, as group 0. The mesh pass then draws record 0 y·z times.

3. Not run, from reading only: the 65,535 groups-per-dimension limit. Dispatch(groups, 1, 1) and DispatchMesh(groups · split, 1, 1) put the whole count in X (bind.rs:496, :499), and the indirect scaler multiplies X by the split. A DispatchMesh(256, 256, 1) that is valid on its own becomes Dispatch(65536, 1, 1). With #304's split of 7, any dispatch over 9,362 groups goes past the limit.

I did not check 1 and 2 through the console-list hooks themselves, only with a direct D3D12 harness around this branch's translated compute pass. The probe is a temporary runner function and a test, and I can post it if useful. One possible direction: pass the record capacity (and the dispatch width, for a linear record index) to the compute pass in io, skip groups past the capacity, and count the drops in the log.

Tested: RTX 4060 Laptop GPU (driver 32.0.16.1687), i7-13650HX, Windows 11 25H2 (26200), Rust 1.100.0 MSVC, DXC 1.8.2502.11, debug. 2624f00 plus the temporary probe: cargo test -p xcl --lib -- --exact gpu::recomp::tests::review_probe_724_records --nocapture, 1 passed. The probe was not committed.

AI use: Claude Code (Claude Opus 5.5) read the diff, wrote and ran the probe, and drafted this review. Each point was checked by the user before posting.

**@⁠NathanTheophile** on GitHub · 2026-11-24 07:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7125098760) Review of `2624f00`, from reading `bind.rs` and checking two points on the GPU. I'm interested because #529 (drawing the records with a VS on GPUs without mesh shaders) would build on this execution path. **1. The record buffer is not sized to the dispatch, and root UAVs have no bounds check.** `ensure_res_buffer` caps the buffer at 128 MiB (`bind.rs:321`, `.min(128 << 20)`), and `ExecuteIndirect` always asks for 32 MiB (`bind.rs:547`). The compute pass writes record `gid.x` with no bound (`emit.rs:4301`). With the retail transform record of #304 (21 params + clip distance: 11,908 dwords, 47,632 B), 32 MiB holds 704 groups and 128 MiB holds 2,817. To check where the excess goes, I ran the NGG fixture of `gpu_mesh_mode_two_passes` with its record buffer as a 64 KiB placed resource and a zeroed buffer placed right after it in the same heap. 14 groups fit and left the next buffer untouched. With 20 groups, 101 dwords of the next buffer were overwritten, and the headers of records 15–19 (`nv = 3, np = 1`) sit exactly where they would fall past the end. In the runtime, that is whatever the driver placed after the record buffer. **2. Indirect arguments with Y or Z > 1 lose groups.** The direct path flattens `x·y·z` (`bind.rs:487-499`), but the companion `DISPATCH` at `bind.rs:549` runs the title's `(x, y, z)` as given. The translated program, and the pass-through, index records by `gid.x` only (`emit.rs:4301`, `:4310` for v5, `:4670`). Same fixture, compute pass only: with `(2,1,1)` the two records are group 0 (`x0 = -1`) and group 1 (`x0 = 0`). With `(1,2,1)`, record 0 is group 0 and record 1 stays empty (`nv = np = 0`): the second group wrote record 0 again, as group 0. The mesh pass then draws record 0 `y·z` times. **3. Not run, from reading only: the 65,535 groups-per-dimension limit.** `Dispatch(groups, 1, 1)` and `DispatchMesh(groups · split, 1, 1)` put the whole count in X (`bind.rs:496`, `:499`), and the indirect scaler multiplies X by the split. A `DispatchMesh(256, 256, 1)` that is valid on its own becomes `Dispatch(65536, 1, 1)`. With #304's split of 7, any dispatch over 9,362 groups goes past the limit. I did not check 1 and 2 through the console-list hooks themselves, only with a direct D3D12 harness around this branch's translated compute pass. The probe is a temporary runner function and a test, and I can post it if useful. One possible direction: pass the record capacity (and the dispatch width, for a linear record index) to the compute pass in `io`, skip groups past the capacity, and count the drops in the log. **Tested:** RTX 4060 Laptop GPU (driver 32.0.16.1687), i7-13650HX, Windows 11 25H2 (26200), Rust 1.100.0 MSVC, DXC 1.8.2502.11, debug. `2624f00` plus the temporary probe: `cargo test -p xcl --lib -- --exact gpu::recomp::tests::review_probe_724_records --nocapture`, 1 passed. The probe was not committed. **AI use:** Claude Code (Claude Opus 5.5) read the diff, wrote and ran the probe, and drafted this review. Each point was checked by the user before posting.
Author
Owner

@⁠iggyvilla on GitHub · 2026-11-24 07:34 UTC · original

A test report on 2624f00c4e2d8b87aa1828233fb2f60899eb9533 and a review of the diff, from an AMD RDNA2 (Navi 23) card. The head is still 2624f00. Its merge base with origin/main is f4ce27ceb6d1b0576d0c659b713b674778bf1968 — which is also the "main" commit of the PR's own smoke block — so I ran that base itself for the second half of the regression instead of the dd2ae9a block on file.

Tested

  • AMD Radeon RX 6650 XT (RDNA2, gfx1032), driver 32.0.21045.29003; AMD Ryzen 7 5700X (8C/16T), 31.9 GB RAM, Windows 11 Home 26H2 build 26300.9974; rustc 1.100.0 (0ef1bc386 2026-11-09), cargo 1.100.0; no XCL_SAMPLE_* set.

  • Detached, clean worktrees for head 2624f00 and base f4ce27c; debug for the tests, release -p xcl for the smokes.

  • cargo test --workspace --no-fail-fast -- --test-threads=4 on 2624f00 (debug): 700 passed, 3 failed, 41 ignored, exit 101. This is the same test set as the NVIDIA and RDNA4 reports, which list 703 passed and 41 ignored: here the same 703 tests are 700 passed + 3 failed, with the same 41 ignored. This card's 3 known failures are:

    • hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels — assertion cubemap extra_pages must be reused at same va (issue #470). Fails alone too (0 passed; 1 failed).
    • hle::d3d12x::title_textures::tests::transitions_apply_when_their_list_is_submitted and hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory — both PoisonError from the #470 panic's lock; each passes alone (1 passed; 0 failed).

    No other test fails; the PR adds no failure.

  • No SKIPPED lines at this head on this card. The two tests the NVIDIA report lists as skipped (gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware, gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask) run and pass here, as do gpu_mesh_mode_two_passes (including its split=4 pass-through pixel comparison), gpu_mesh_mode_reads_memory_windows, mesh_split_wave64_form, retail_mesh_pipelines_through_the_hook, and the PR's dispatch_mesh_signature_tracking_returns_companion_and_layout and mesh_arguments_go_in_user_sgprs_from_s16.

  • Targeted, --test-threads=1: -p xcl --lib hle::d3d12x 104 passed, 3 failed (the same three), 1 ignored; -p xcl --lib gpu_mesh 2 passed; -p xcl --lib wave32 5 passed.

  • Smoke with XCL_NETWORK=0, scripts/smoke.ps1 -Game C:\games\retail -Seconds 60, head and merge base built release in their own worktrees, two pairs in the order below. All four runs: exit 0x0, 0 device removals, 0 crashes.

pair run frames shown presents per 2 s (last 3) peak commit
1 head 2624f00 (first) 277 0 1 0 11960 MB
1 base f4ce27c (second) 306 1 1 0 11643 MB
2 base f4ce27c (third) 312 0 2 5 11088 MB
2 head 2624f00 (fourth) 308 0 1 3 11414 MB

The 29-frame head/base gap of pair 1 does not reproduce when the order is reversed (4 frames, 1.3 %), so it follows run order/warm-up rather than the commit. All four runs are in the slow state this machine shows (270–320 frames), well below the 700+ of earlier sessions, so only the paired comparison is meaningful; there is no measurable regression and no crash, removal or exit difference.

  • In both 60 s head runs there are 0 "pipeline from the console MS in two passes" lines and 0 "two-pass DispatchMesh" / "two-pass ExecuteIndirect(DispatchMesh)" lines; head and base log the same 40 "mesh pipeline with its MS … in the AS slot – refused" lines (the separate AS-slot limitation). Within 60 s the title reaches the same loading/menu state on both, so this smoke measures no regression at that point — the PR's execution path is not reached in that window.

Head block (pair 1):

xcl-smoke v1
commit: 2624f00c4e2d8b87aa1828233fb2f60899eb9533
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 60
exit: 0x0
frames shown: 277 (PresentX 279)
presents per 2 s (last 3): 0 1 0
device removals: 0
crashes: 0
peak commit: 11960 MB

Base block (pair 1):

xcl-smoke v1
commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 60
exit: 0x0
frames shown: 306 (PresentX 311)
presents per 2 s (last 3): 1 1 0
device removals: 0
crashes: 0
peak commit: 11643 MB

Base block (pair 2):

xcl-smoke v1
commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 60
exit: 0x0
frames shown: 312 (PresentX 318)
presents per 2 s (last 3): 0 2 5
device removals: 0
crashes: 0
peak commit: 11088 MB

Head block (pair 2):

xcl-smoke v1
commit: 2624f00c4e2d8b87aa1828233fb2f60899eb9533
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 60
exit: 0x0
frames shown: 308 (PresentX 312)
presents per 2 s (last 3): 0 1 3
device removals: 0
crashes: 0
peak commit: 11414 MB

Review
The shape is right: the console mesh root-argument layout is tracked per pipeline, the companion signature replaces only the 12-byte DISPATCH_MESH argument with the 12-byte DISPATCH one so ByteStride is unchanged, both passes use the ABI root signature with its 6 UAV parameters (so writing u0–u5 is in range), UAV barriers bracket the record buffer, and record buffers are held until their allocator resets. Points I would fix before this reaches a title with 8 GB of video memory:

  1. ensure_res_buffer(this, 32 << 20) (bind.rs:547) requests a fixed 32 MB DEFAULT-heap record buffer for every two-pass ExecuteIndirect, while the direct DispatchMesh path sizes from groups * record_dwords * 4 (bind.rs:492). FREE_RES caches up to 16 buffers per device (bind.rs:55), so up to ~512 MB can sit idle on an 8 GB card plus one live buffer per command list. Size the request from max * tp.record.record_dwords() * 4 with the existing 4 MB floor (and a smaller cache); as it stands, max * record_dwords * 4 > 32 MB already loses records (UAV out-of-bounds writes are dropped), and a size-from-max request above the 128 MB cap would too, so clamp or split the call there.
  2. A DISPATCH_MESH signature that also carries a constant/CBV/SRV/UAV argument is root-changing, gets no companion (device_x.rs:1028-1045), and then falls through bind.rs:543-581 to bind.rs:583-602: because a two-pass PSO is in neither TRANSLATED_GRAPHICS nor TRANSLATED_COMPUTE, that is the "PC pipeline" path, so it sets rs_gfx and runs the mesh signature without pass 1 having written res — stale/zero records rather than the "skipped as before" in the description. If two_pass_of(pso).is_some() and the signature is not a known mesh one, skip with a warning instead of pc().
  3. indirect_arg_bytes returns 0 for unknown argument codes (device_x.rs:1001-1012) and only console DispatchX (105) is translated, so any other console code placed before the DISPATCH_MESH argument makes mesh_offset too small; with mesh_groups_per_record > 1 the scaler then multiplies the wrong dword of every record and silently corrupts the following arguments. Make it return an Option and only record the mesh signature when every preceding argument has a known size; otherwise do not scale (or skip with a log).
  4. DISPATCH_MESH_SIGS is keyed by the title's command-signature address, is never pruned, and the companion is never released (bind.rs:250-261, device_x.rs:1044-1045). If the title releases a signature and the runtime hands the same address to a new one, the new signature inherits the old companion/stride/offset (wrong signature executed; the companion also leaks). Release it with the signature, or key it by something stable.
  5. Minor: ensure_res_buffer/make_scaled_args_buffer do a GetDevice + QI + Release per growth/scaled call (bind.rs:326, bind.rs:460) — cache the device in State; scale_indirect_pipeline compiles its HLSL with DXC synchronously on the first use (bind.rs:412), which can hitch the render thread mid-frame once; and the compute pass always assumes the measured MS convention (table pointer in s[8:9], inline from s16, bind.rs:369, console_list.rs:173) with no fallback when layout.inline_ms is 0 while the root signature has parameters — a one-time log there would make a compiler whose user-SGPR count differs visible.

Not tested

  • No gameplay past the loading/menu within 60 s, so the new two-pass execution path, the split>1 indirect-argument scaler and the record buffer's VRAM behaviour were not observed on the title here. The mesh pipelines the title does create in this window are the AS-slot ones refused before this PR.
  • No direct DispatchMesh with a translated two-pass pipeline, and no indirect DispatchMesh with mesh_groups_per_record > 1 on the title; those paths are covered only by the GPU tests above, not end to end.
  • No XCL_SAMPLE_* / real-shader sample runs, no long run (fps/VRAM decline), no Intel or other-vendor GPU, no release-build workspace tests (release was built only for the smokes), and the PR was not merged onto the current origin/main.

AI use
opencode with DeepSeek V4.1 Flash (opencode-go/deepseek-v4.1-flash) built both worktrees, ran the full workspace suite, reran each failing test alone, ran the targeted groups and the two 60 s smoke pairs, and wrote this report and review. It made no code changes; every review point was checked against the diff at 2624f00.

**@⁠iggyvilla** on GitHub · 2026-11-24 07:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7125141443) A test report on `2624f00c4e2d8b87aa1828233fb2f60899eb9533` and a review of the diff, from an AMD RDNA2 (Navi 23) card. The head is still `2624f00`. Its merge base with `origin/main` is `f4ce27ceb6d1b0576d0c659b713b674778bf1968` — which is also the "main" commit of the PR's own smoke block — so I ran that base itself for the second half of the regression instead of the `dd2ae9a` block on file. **Tested** - AMD Radeon RX 6650 XT (RDNA2, gfx1032), driver 32.0.21045.29003; AMD Ryzen 7 5700X (8C/16T), 31.9 GB RAM, Windows 11 Home 26H2 build 26300.9974; rustc 1.100.0 (`0ef1bc386 2026-11-09`), cargo 1.100.0; no `XCL_SAMPLE_*` set. - Detached, clean worktrees for head `2624f00` and base `f4ce27c`; debug for the tests, release `-p xcl` for the smokes. - `cargo test --workspace --no-fail-fast -- --test-threads=4` on `2624f00` (debug): **700 passed, 3 failed, 41 ignored**, exit 101. This is the same test set as the NVIDIA and RDNA4 reports, which list 703 passed and 41 ignored: here the same 703 tests are 700 passed + 3 failed, with the same 41 ignored. This card's 3 known failures are: - `hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels` — assertion `cubemap extra_pages must be reused at same va` (issue #470). Fails alone too (`0 passed; 1 failed`). - `hle::d3d12x::title_textures::tests::transitions_apply_when_their_list_is_submitted` and `hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory` — both `PoisonError` from the #470 panic's lock; each passes alone (`1 passed; 0 failed`). No other test fails; the PR adds no failure. - **No `SKIPPED` lines** at this head on this card. The two tests the NVIDIA report lists as skipped (`gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware`, `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`) run and pass here, as do `gpu_mesh_mode_two_passes` (including its split=4 pass-through pixel comparison), `gpu_mesh_mode_reads_memory_windows`, `mesh_split_wave64_form`, `retail_mesh_pipelines_through_the_hook`, and the PR's `dispatch_mesh_signature_tracking_returns_companion_and_layout` and `mesh_arguments_go_in_user_sgprs_from_s16`. - Targeted, `--test-threads=1`: `-p xcl --lib hle::d3d12x` **104 passed, 3 failed (the same three), 1 ignored**; `-p xcl --lib gpu_mesh` **2 passed**; `-p xcl --lib wave32` **5 passed**. - Smoke with `XCL_NETWORK=0`, `scripts/smoke.ps1 -Game C:\games\retail -Seconds 60`, head and merge base built release in their own worktrees, two pairs in the order below. All four runs: exit `0x0`, 0 device removals, 0 crashes. | pair | run | frames shown | presents per 2 s (last 3) | peak commit | |---|---|---|---|---| | 1 | head `2624f00` (first) | 277 | 0 1 0 | 11960 MB | | 1 | base `f4ce27c` (second) | 306 | 1 1 0 | 11643 MB | | 2 | base `f4ce27c` (third) | 312 | 0 2 5 | 11088 MB | | 2 | head `2624f00` (fourth) | 308 | 0 1 3 | 11414 MB | The 29-frame head/base gap of pair 1 does not reproduce when the order is reversed (4 frames, 1.3 %), so it follows run order/warm-up rather than the commit. All four runs are in the slow state this machine shows (270–320 frames), well below the 700+ of earlier sessions, so only the paired comparison is meaningful; there is no measurable regression and no crash, removal or exit difference. - In both 60 s head runs there are **0** "pipeline from the console MS in two passes" lines and **0** "two-pass DispatchMesh" / "two-pass ExecuteIndirect(DispatchMesh)" lines; head and base log the same **40** "mesh pipeline with its MS … in the AS slot – refused" lines (the separate AS-slot limitation). Within 60 s the title reaches the same loading/menu state on both, so this smoke measures no regression at that point — the PR's execution path is not reached in that window. Head block (pair 1): ``` xcl-smoke v1 commit: 2624f00c4e2d8b87aa1828233fb2f60899eb9533 gpu: AMD Radeon RX 6650 XT title: retail seconds: 60 exit: 0x0 frames shown: 277 (PresentX 279) presents per 2 s (last 3): 0 1 0 device removals: 0 crashes: 0 peak commit: 11960 MB ``` Base block (pair 1): ``` xcl-smoke v1 commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968 gpu: AMD Radeon RX 6650 XT title: retail seconds: 60 exit: 0x0 frames shown: 306 (PresentX 311) presents per 2 s (last 3): 1 1 0 device removals: 0 crashes: 0 peak commit: 11643 MB ``` Base block (pair 2): ``` xcl-smoke v1 commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968 gpu: AMD Radeon RX 6650 XT title: retail seconds: 60 exit: 0x0 frames shown: 312 (PresentX 318) presents per 2 s (last 3): 0 2 5 device removals: 0 crashes: 0 peak commit: 11088 MB ``` Head block (pair 2): ``` xcl-smoke v1 commit: 2624f00c4e2d8b87aa1828233fb2f60899eb9533 gpu: AMD Radeon RX 6650 XT title: retail seconds: 60 exit: 0x0 frames shown: 308 (PresentX 312) presents per 2 s (last 3): 0 1 3 device removals: 0 crashes: 0 peak commit: 11414 MB ``` **Review** The shape is right: the console mesh root-argument layout is tracked per pipeline, the companion signature replaces only the 12-byte `DISPATCH_MESH` argument with the 12-byte `DISPATCH` one so `ByteStride` is unchanged, both passes use the ABI root signature with its 6 UAV parameters (so writing `u0`–`u5` is in range), UAV barriers bracket the record buffer, and record buffers are held until their allocator resets. Points I would fix before this reaches a title with 8 GB of video memory: 1. `ensure_res_buffer(this, 32 << 20)` (`bind.rs:547`) requests a fixed 32 MB **DEFAULT-heap** record buffer for every two-pass `ExecuteIndirect`, while the direct `DispatchMesh` path sizes from `groups * record_dwords * 4` (`bind.rs:492`). `FREE_RES` caches up to 16 buffers per device (`bind.rs:55`), so up to ~512 MB can sit idle on an 8 GB card plus one live buffer per command list. Size the request from `max * tp.record.record_dwords() * 4` with the existing 4 MB floor (and a smaller cache); as it stands, `max * record_dwords * 4 > 32 MB` already loses records (UAV out-of-bounds writes are dropped), and a size-from-`max` request above the 128 MB cap would too, so clamp or split the call there. 2. A `DISPATCH_MESH` signature that also carries a constant/CBV/SRV/UAV argument is root-changing, gets no companion (`device_x.rs:1028-1045`), and then falls through `bind.rs:543-581` to `bind.rs:583-602`: because a two-pass PSO is in neither `TRANSLATED_GRAPHICS` nor `TRANSLATED_COMPUTE`, that is the "PC pipeline" path, so it sets `rs_gfx` and runs the mesh signature **without pass 1 having written `res`** — stale/zero records rather than the "skipped as before" in the description. If `two_pass_of(pso).is_some()` and the signature is not a known mesh one, skip with a warning instead of `pc()`. 3. `indirect_arg_bytes` returns `0` for unknown argument codes (`device_x.rs:1001-1012`) and only console `DispatchX` (105) is translated, so any other console code placed before the `DISPATCH_MESH` argument makes `mesh_offset` too small; with `mesh_groups_per_record > 1` the scaler then multiplies the wrong dword of every record and silently corrupts the following arguments. Make it return an `Option` and only record the mesh signature when every preceding argument has a known size; otherwise do not scale (or skip with a log). 4. `DISPATCH_MESH_SIGS` is keyed by the title's command-signature address, is never pruned, and the companion is never released (`bind.rs:250-261`, `device_x.rs:1044-1045`). If the title releases a signature and the runtime hands the same address to a new one, the new signature inherits the old companion/stride/offset (wrong signature executed; the companion also leaks). Release it with the signature, or key it by something stable. 5. Minor: `ensure_res_buffer`/`make_scaled_args_buffer` do a `GetDevice` + QI + Release per growth/scaled call (`bind.rs:326`, `bind.rs:460`) — cache the device in `State`; `scale_indirect_pipeline` compiles its HLSL with DXC synchronously on the first use (`bind.rs:412`), which can hitch the render thread mid-frame once; and the compute pass always assumes the measured MS convention (table pointer in `s[8:9]`, inline from `s16`, `bind.rs:369`, `console_list.rs:173`) with no fallback when `layout.inline_ms` is 0 while the root signature has parameters — a one-time log there would make a compiler whose user-SGPR count differs visible. **Not tested** - No gameplay past the loading/menu within 60 s, so the new two-pass execution path, the split>1 indirect-argument scaler and the record buffer's VRAM behaviour were not observed on the title here. The mesh pipelines the title does create in this window are the AS-slot ones refused before this PR. - No direct `DispatchMesh` with a translated two-pass pipeline, and no indirect `DispatchMesh` with `mesh_groups_per_record > 1` on the title; those paths are covered only by the GPU tests above, not end to end. - No `XCL_SAMPLE_*` / real-shader sample runs, no long run (fps/VRAM decline), no Intel or other-vendor GPU, no release-build workspace tests (release was built only for the smokes), and the PR was not merged onto the current `origin/main`. **AI use** opencode with DeepSeek V4.1 Flash (opencode-go/deepseek-v4.1-flash) built both worktrees, ran the full workspace suite, reran each failing test alone, ran the targeted groups and the two 60 s smoke pairs, and wrote this report and review. It made no code changes; every review point was checked against the diff at `2624f00`.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-24 10:40 UTC · original

Great progress on two-pass DispatchMesh / ExecuteIndirect, though a few blockers need addressing before merge: (1) bounds/clamping on the record buffer to prevent >32 MiB OOB writes on large indirect dispatches, (2) a shared/capped scratch buffer to avoid unbounded per-allocator VRAM growth, and (3) safe tracked-state transitions on indirect argument buffers.

**@⁠raylitebull** on GitHub · 2026-11-24 10:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7129103209) Great progress on two-pass `DispatchMesh` / `ExecuteIndirect`, though a few blockers need addressing before merge: (1) bounds/clamping on the record buffer to prevent >32 MiB OOB writes on large indirect dispatches, (2) a shared/capped scratch buffer to avoid unbounded per-allocator VRAM growth, and (3) safe tracked-state transitions on indirect argument buffers.
Author
Owner

@⁠oeirughrepuiohg on GitHub · 2026-11-24 13:00 UTC · original

Review and test report on 2624f00.

1. The two-pass io block never gets the UMA base. bind_two_pass_stage builds io from user_data_ms / user_data_gfx, resizes it to KERNEL_SGPRS with zeros, and never sets io[IO_UMA_BASE_HI]. The normal binds do (bind.rs io[crate::gpu::recomp::IO_UMA_BASE_HI] = (u.base() >> 32) as u32, and the same in console_list.rs). The translated mesh-mode program loads it in its prologue (xcl_uma_base = io.Load(448u) in a dumped two-pass compute HLSL) and picks the memory window as hi - xcl_uma_base. With 0 there, xcl_w = hi - 0 is 4–7 for every title address when UMA's base is at 16 GiB (base >> 32 = 4 here), so every access falls into the accessors' default arm: the compute pass reads zeros and its stores are dropped, and the mesh pass draws records that were never written. One line fixes it:

    io.resize(crate::gpu::recomp::KERNEL_SGPRS, 0);
    io[crate::gpu::recomp::IO_UMA_BASE_HI] = (u.base() >> 32) as u32;

Tested (Linux, Wine/GE-Proton 11, vkd3d-proton with XCL's patch, RTX 4070 Ti 12 GB, NVIDIA 620.x; x86_64-pc-windows-gnu release build of main 09940bb + this PR + #684 and other open PRs we run; retail title, own copy):

  • Without this PR: GPU device lost at the world load (kernel Xid 13 "SM Warp Exception: MMU Fault" in most runs).
  • With this PR as is: two-pass draws run (2048+ DispatchMesh, 8192+ ExecuteIndirect(DispatchMesh)) and no MMU fault was seen in two runs; both runs still stall at the same point (a queue's 64-bit fence stops advancing), which we also see without this PR and do not attribute to it.
  • With the one-line fix (in our tree since): the compute pass reads and writes the right UMA windows; the world-load stop that remains is the one described in #505 (a 100 % GPU phase that follows skipped binds under XCL_PSO_WAIT_MS), not this PR.

Not tested: Windows, AMD, the full test suite (the crate is built for Windows only; we run it under Wine).

AI use: Claude Code, Claude Opus 5.5 - found the missing field while debugging the world-load fault, wrote this comment; the runs are ours.

**@⁠oeirughrepuiohg** on GitHub · 2026-11-24 13:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7132208220) Review and test report on `2624f00`. **1. The two-pass `io` block never gets the UMA base.** `bind_two_pass_stage` builds `io` from `user_data_ms` / `user_data_gfx`, resizes it to `KERNEL_SGPRS` with zeros, and never sets `io[IO_UMA_BASE_HI]`. The normal binds do (`bind.rs` `io[crate::gpu::recomp::IO_UMA_BASE_HI] = (u.base() >> 32) as u32`, and the same in `console_list.rs`). The translated mesh-mode program loads it in its prologue (`xcl_uma_base = io.Load(448u)` in a dumped two-pass compute HLSL) and picks the memory window as `hi - xcl_uma_base`. With 0 there, `xcl_w = hi - 0` is 4–7 for every title address when UMA's base is at 16 GiB (`base >> 32` = 4 here), so every access falls into the accessors' `default` arm: the compute pass reads zeros and its stores are dropped, and the mesh pass draws records that were never written. One line fixes it: ```rust io.resize(crate::gpu::recomp::KERNEL_SGPRS, 0); io[crate::gpu::recomp::IO_UMA_BASE_HI] = (u.base() >> 32) as u32; ``` **Tested** (Linux, Wine/GE-Proton 11, vkd3d-proton with XCL's patch, RTX 4070 Ti 12 GB, NVIDIA 620.x; `x86_64-pc-windows-gnu` release build of `main` 09940bb + this PR + #684 and other open PRs we run; retail title, own copy): - Without this PR: GPU device lost at the world load (kernel Xid 13 "SM Warp Exception: MMU Fault" in most runs). - With this PR as is: two-pass draws run (2048+ `DispatchMesh`, 8192+ `ExecuteIndirect(DispatchMesh)`) and no MMU fault was seen in two runs; both runs still stall at the same point (a queue's 64-bit fence stops advancing), which we also see without this PR and do not attribute to it. - With the one-line fix (in our tree since): the compute pass reads and writes the right UMA windows; the world-load stop that remains is the one described in #505 (a 100 % GPU phase that follows skipped binds under `XCL_PSO_WAIT_MS`), not this PR. **Not tested:** Windows, AMD, the full test suite (the crate is built for Windows only; we run it under Wine). **AI use:** Claude Code, Claude Opus 5.5 - found the missing field while debugging the world-load fault, wrote this comment; the runs are ours.
Author
Owner

@⁠Rodriguerra on GitHub · 2026-11-24 15:55 UTC · original

Two heads-up from testing two-pass Mesh Shaders rebased onto current main (RTX 3060 12 GB):

  1. When rebasing onto main (which added IO_UMA_BASE_HI), make sure bind_two_pass_stage also writes io[crate::gpu::recomp::IO_UMA_BASE_HI] = (u.base() >> 32) as u32; — without it, two-pass MS + attached PS read xcl_uma_base == 0 and return zeros for every UMA read when u.base() != 0.
  2. In translated_mesh_pso, skipping subobject 14 (D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY) avoids 0x80070057 (E_INVALIDARG) rejections on retail MS pipeline streams.
**@⁠Rodriguerra** on GitHub · 2026-11-24 15:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7136833800) Two heads-up from testing two-pass Mesh Shaders rebased onto current `main` (RTX 3060 12 GB): 1. When rebasing onto `main` (which added `IO_UMA_BASE_HI`), make sure `bind_two_pass_stage` also writes `io[crate::gpu::recomp::IO_UMA_BASE_HI] = (u.base() >> 32) as u32;` — without it, two-pass MS + attached PS read `xcl_uma_base == 0` and return zeros for every UMA read when `u.base() != 0`. 2. In `translated_mesh_pso`, skipping subobject `14` (`D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY`) avoids `0x80070057` (`E_INVALIDARG`) rejections on retail MS pipeline streams.
Author
Owner

@⁠ivall on GitHub · 2026-11-24 21:06 UTC · original

This is the piece #541 needs: at main e9e94ce nothing runs a two-pass pipeline. two_pass_of has no caller outside tests and one log line, and bind::execute_indirect sends such a pipeline down the PC branch with the title's root signature, so u1 is not bound. I think that is the cause of the device removals reported on #541 (details there). So this should land before #541.

What is open here, from the reviews above, before it can be merged:

  1. rebase: it conflicts with main;
  2. io[IO_UMA_BASE_HI] in bind_two_pass_stage (@⁠oeirughrepuiohg, @⁠Rodriguerra): without it every unified-memory access of the pair misses its window;
  3. a bound on the record buffer (@⁠NathanTheophile, @⁠raylitebull): with large dispatches the compute pass writes past it;
  4. indirect arguments with Y or Z > 1 (@⁠NathanTheophile): groups are lost;
  5. the state of the indirect argument buffer, and a cap on the per-allocator scratch memory (@⁠raylitebull, @⁠badoomtch).

@⁠Cattn, are you still on it? If not, say so here and someone can take it over with your commits kept. Splitting it would help the review, for example direct DispatchMesh with the bound first and indirect dispatch second.

Not tested: I have not built or run this PR; the list is from its reviews and from reading main.

AI use: Claude Code (Claude Opus 5.5) read the code and the thread and wrote this, on the maintainer's behalf.

**@⁠ivall** on GitHub · 2026-11-24 21:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7144486498) This is the piece #541 needs: at `main` `e9e94ce` nothing runs a two-pass pipeline. `two_pass_of` has no caller outside tests and one log line, and `bind::execute_indirect` sends such a pipeline down the PC branch with the title's root signature, so `u1` is not bound. I think that is the cause of the device removals reported on #541 (details there). So this should land before #541. What is open here, from the reviews above, before it can be merged: 1. rebase: it conflicts with `main`; 2. `io[IO_UMA_BASE_HI]` in `bind_two_pass_stage` (@⁠oeirughrepuiohg, @⁠Rodriguerra): without it every unified-memory access of the pair misses its window; 3. a bound on the record buffer (@⁠NathanTheophile, @⁠raylitebull): with large dispatches the compute pass writes past it; 4. indirect arguments with Y or Z > 1 (@⁠NathanTheophile): groups are lost; 5. the state of the indirect argument buffer, and a cap on the per-allocator scratch memory (@⁠raylitebull, @⁠badoomtch). @⁠Cattn, are you still on it? If not, say so here and someone can take it over with your commits kept. Splitting it would help the review, for example direct `DispatchMesh` with the bound first and indirect dispatch second. **Not tested:** I have not built or run this PR; the list is from its reviews and from reading `main`. AI use: Claude Code (Claude Opus 5.5) read the code and the thread and wrote this, on the maintainer's behalf.
Author
Owner

@⁠PracticalStudios on GitHub · 2026-11-24 21:37 UTC · original

@⁠Cattn are you still on the points @⁠ivall listed above? If not, I can take them: rebase onto main and fix 2–5 as separate commits on top of yours (your authorship kept), tested on an RTX 3090 (wave32, mesh shaders). I'm starting now; if you're already on it, say so and I'll hand you the commits instead.

AI use: Claude Code (Claude Opus 5.5) wrote this comment.

**@⁠PracticalStudios** on GitHub · 2026-11-24 21:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7145181348) @⁠Cattn are you still on the points @⁠ivall listed above? If not, I can take them: rebase onto `main` and fix 2–5 as separate commits on top of yours (your authorship kept), tested on an RTX 3090 (wave32, mesh shaders). I'm starting now; if you're already on it, say so and I'll hand you the commits instead. AI use: Claude Code (Claude Opus 5.5) wrote this comment.
Author
Owner

@⁠PracticalStudios on GitHub · 2026-11-24 22:23 UTC · original · edited 2026-11-24 22:47 UTC

@⁠Cattn @⁠ivall the points above are done on PracticalStudios/xcl mesh/two-pass-execution: #724's commit rebased onto main 1d027e5 (authorship kept), then one commit per point:

  • d41d2f3 the two-pass io block gets IO_UMA_BASE_HI;
  • ee561d0 groups stay inside the record buffer (ExecuteIndirect args are rewritten with X capped);
  • ccfe5c1 indirect Y / Z > 1 are folded into X;
  • e284043 the args are read through unified memory instead of transitioning the title's buffer; scratch is per-list 1 MiB blocks, 16 MiB per recording, reuse pool capped at 256 MiB;
  • b718955 one more test case;
  • 3442b58 an ExecuteIndirect with max > 1 runs one command at a time (compute, then mesh), so commands no longer overwrite each other's records; commands past a count buffer's count get no groups.

Each fix has a test that fails without it. RTX 3090 (wave32, mesh shaders), Windows 11, debug: cargo test --workspace --no-fail-fast: 966 passed, 1 failed, 43 ignored. The failure (kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory) fails the same way on main here.

Still open: two-pass ExecuteIndirect calls whose arguments are outside unified memory are skipped with a warning. Not tested: a title run.

Cattn, pull it into #724 if you like; otherwise I'll open it as a PR that supersedes this one.

AI use: Claude Code (Claude Opus 5.5, with Claude Sonnet subagents) wrote the code, the tests and this comment.

**@⁠PracticalStudios** on GitHub · 2026-11-24 22:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7146180828) · edited 2026-11-24 22:47 UTC @⁠Cattn @⁠ivall the points above are done on [`PracticalStudios/xcl` `mesh/two-pass-execution`](https://github.com/PracticalStudios/xcl/commits/mesh/two-pass-execution): #724's commit rebased onto `main` `1d027e5` (authorship kept), then one commit per point: - `d41d2f3` the two-pass io block gets `IO_UMA_BASE_HI`; - `ee561d0` groups stay inside the record buffer (ExecuteIndirect args are rewritten with X capped); - `ccfe5c1` indirect Y / Z > 1 are folded into X; - `e284043` the args are read through unified memory instead of transitioning the title's buffer; scratch is per-list 1 MiB blocks, 16 MiB per recording, reuse pool capped at 256 MiB; - `b718955` one more test case; - `3442b58` an ExecuteIndirect with `max > 1` runs one command at a time (compute, then mesh), so commands no longer overwrite each other's records; commands past a count buffer's count get no groups. Each fix has a test that fails without it. RTX 3090 (wave32, mesh shaders), Windows 11, debug: `cargo test --workspace --no-fail-fast`: 966 passed, 1 failed, 43 ignored. The failure (`kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory`) fails the same way on `main` here. Still open: two-pass ExecuteIndirect calls whose arguments are outside unified memory are skipped with a warning. Not tested: a title run. Cattn, pull it into #724 if you like; otherwise I'll open it as a PR that supersedes this one. AI use: Claude Code (Claude Opus 5.5, with Claude Sonnet subagents) wrote the code, the tests and this comment.
Author
Owner

@⁠veyn-sudo on GitHub · 2026-11-24 23:11 UTC · original

Measurements on the mesh shader's user SGPRs, for the rebased branch (PracticalStudios/xcl mesh/two-pass-execution, read at 3442b58), from a retail title's shader pack:

  1. s16 holds. All 9,282 mesh shaders in the pack read only s3 and s16–s24 before writing them. So FIRST_SGPR_MS = 16 is right, and none of them reads the table address that user_data_ms puts in s8/s9.
  2. Heap addresses are missing. For a root signature with flag 0x400 / 0x800, the console passes the 32-bit address of the view heap / sampler heap after the root arguments, view heap first. #1803 does this for draws and dispatches. In the 40 mesh pipeline layouts I compared, the shaders read exactly the registers this predicts. user_data_ms stops at the arguments, so on this branch those registers are 0 and such a shader reads its descriptors from address 0 on. The pass-through draw's PS has the same gap, through user_data_gfx in two_pass_io.

Once #1803 and this have both landed, it should be a small follow-up: append with_heaps in both cases of two_pass_io. I can send that PR with a test.

Not tested: I only read the branch; I did not build or run it. The layouts are a sample of 40, not all of them. I have not run mesh draws in the title.

AI use: Claude Code (Claude Opus 5.5) made the measurements, read the branch and wrote this.

**@⁠veyn-sudo** on GitHub · 2026-11-24 23:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7147112897) Measurements on the mesh shader's user SGPRs, for the rebased branch (`PracticalStudios/xcl` `mesh/two-pass-execution`, read at `3442b58`), from a retail title's shader pack: 1. **s16 holds.** All 9,282 mesh shaders in the pack read only s3 and s16–s24 before writing them. So `FIRST_SGPR_MS = 16` is right, and none of them reads the table address that `user_data_ms` puts in s8/s9. 2. **Heap addresses are missing.** For a root signature with flag 0x400 / 0x800, the console passes the 32-bit address of the view heap / sampler heap after the root arguments, view heap first. #1803 does this for draws and dispatches. In the 40 mesh pipeline layouts I compared, the shaders read exactly the registers this predicts. `user_data_ms` stops at the arguments, so on this branch those registers are 0 and such a shader reads its descriptors from address 0 on. The pass-through draw's PS has the same gap, through `user_data_gfx` in `two_pass_io`. Once #1803 and this have both landed, it should be a small follow-up: append `with_heaps` in both cases of `two_pass_io`. I can send that PR with a test. **Not tested:** I only read the branch; I did not build or run it. The layouts are a sample of 40, not all of them. I have not run mesh draws in the title. AI use: Claude Code (Claude Opus 5.5) made the measurements, read the branch and wrote this.
Author
Owner

@⁠cafeoh on GitHub · 2026-11-25 01:49 UTC · original

RTX 2080 Ti (Turing): PracticalStudios/xcl mesh/two-pass-execution at 3442b58 with #541, in a retail title. The mesh draws now run (2 000 to 10 000 draws per 2 s in the world, about 200 without them), but the scene's depth targets stay at their clear value, and the device is removed (0x887a0005) at 155 to 160 s in 3 of 3 runs (and at 152 and 249 s in 2 of 2 runs with #724's own head 2624f00). Appending the heap addresses in two_pass_io, as @⁠veyn-sudo suggests, did not change either (1 run).

Setup: RTX 2080 Ti 11 GB (32-lane waves), driver 617.14, Windows 10 19045, release. Retail 1.0.2.1. Tree: main 689f2db + #684, #1053, #929, #1323, #1766, #640, #1329, #1732, #1405, #1464, #1102, #541 (6bd8f64), then 3442b58; run 123 also #1803 (cb00751) and with_heaps in two_pass_io (MS and PS stage), plus local diagnostics and a local split of very long command lists (my comment in #505). XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_COHERENT_HEAPS=0 XCL_COHERENT_MB=512 XCL_UMA_SHADOW=1 XCL_PSO_WAIT_MS=50. Not a clean tree.

What I looked at: a render-target dump at present (Palmwave's XCL_RT_DUMP, ported locally), frames 930 to 945 of each run, which are in the world (the intro's credits are drawn over them):

  • every 2560×1440 depth target (R32G8X24, R24G8), the 1024×4096 / 2048×2048 shadow depths and the R32G32_UINT / R32_UINT targets hold one value; in run 122 one pixel of one depth target differs;
  • without #541 (runs 114 to 116) it is the same, with 40 mesh pipelines refused.
run tree world draws per 2 s end
117 + #541 only – device hung (0x887a0006) at 90 s, no dispatch open (XCL_GPU_CULPRIT)
118, 119 + #724 head 2624f00 up to 10 031 0x887a0005 at 249 s / 152 s
120, 122 + 3442b58 instead up to 7 394 0x887a0005 at 155 s / 160 s
123 + #1803 + heaps in two_pass_io similar 0x887a0005 at 157 s

After each removal the title stops at int3 +0x2474606, as in @⁠Ariorh1337's run 51. In run 119 XCL_GPU_CULPRIT named cs 03e5007cf739d41d (1×1×1 groups) as the one dispatch not done; in runs 117, 120 it found none open. XCL_DRED=1 stopped the title at 6 s (6 presents), so I have no fault address.

Not tested: the test suite on this tree (the two-pass GPU tests pass alone, --test-threads=1; with 4 threads one failed and others skipped, which I have not looked into); AMD; a cleaner tree; more than one run per row.

AI use: Claude Code (Claude Opus 5.5) merged the trees, ran the runs on this machine, read the dumps and wrote this comment.

**@⁠cafeoh** on GitHub · 2026-11-25 01:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7149997823) **RTX 2080 Ti (Turing): `PracticalStudios/xcl` `mesh/two-pass-execution` at `3442b58` with #541, in a retail title. The mesh draws now run (2 000 to 10 000 draws per 2 s in the world, about 200 without them), but the scene's depth targets stay at their clear value, and the device is removed (`0x887a0005`) at 155 to 160 s in 3 of 3 runs (and at 152 and 249 s in 2 of 2 runs with #724's own head `2624f00`). Appending the heap addresses in `two_pass_io`, as @⁠veyn-sudo suggests, did not change either (1 run).** **Setup:** RTX 2080 Ti 11 GB (32-lane waves), driver 617.14, Windows 10 19045, release. Retail 1.0.2.1. Tree: `main` `689f2db` + #684, #1053, #929, #1323, #1766, #640, #1329, #1732, #1405, #1464, #1102, #541 (`6bd8f64`), then `3442b58`; run 123 also #1803 (`cb00751`) and `with_heaps` in `two_pass_io` (MS and PS stage), plus local diagnostics and a local split of very long command lists (my comment in #505). `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_COHERENT_HEAPS=0 XCL_COHERENT_MB=512 XCL_UMA_SHADOW=1 XCL_PSO_WAIT_MS=50`. Not a clean tree. **What I looked at:** a render-target dump at present (Palmwave's `XCL_RT_DUMP`, ported locally), frames 930 to 945 of each run, which are in the world (the intro's credits are drawn over them): - every 2560×1440 depth target (`R32G8X24`, `R24G8`), the 1024×4096 / 2048×2048 shadow depths and the `R32G32_UINT` / `R32_UINT` targets hold one value; in run 122 one pixel of one depth target differs; - without #541 (runs 114 to 116) it is the same, with 40 mesh pipelines refused. | run | tree | world draws per 2 s | end | |---|---|---|---| | 117 | + #541 only | – | device hung (`0x887a0006`) at 90 s, no dispatch open (`XCL_GPU_CULPRIT`) | | 118, 119 | + #724 head `2624f00` | up to 10 031 | `0x887a0005` at 249 s / 152 s | | 120, 122 | + `3442b58` instead | up to 7 394 | `0x887a0005` at 155 s / 160 s | | 123 | + #1803 + heaps in `two_pass_io` | similar | `0x887a0005` at 157 s | After each removal the title stops at `int3` `+0x2474606`, as in @⁠Ariorh1337's run 51. In run 119 `XCL_GPU_CULPRIT` named `cs 03e5007cf739d41d` (1×1×1 groups) as the one dispatch not done; in runs 117, 120 it found none open. `XCL_DRED=1` stopped the title at 6 s (6 presents), so I have no fault address. **Not tested:** the test suite on this tree (the two-pass GPU tests pass alone, `--test-threads=1`; with 4 threads one failed and others skipped, which I have not looked into); AMD; a cleaner tree; more than one run per row. **AI use:** Claude Code (Claude Opus 5.5) merged the trees, ran the runs on this machine, read the dumps and wrote this comment.
Author
Owner

@⁠CharlyRien on GitHub · 2026-11-25 02:45 UTC · original

RTX 3090 (Ampere, 32-lane waves), mesh/two-pass-execution at 3442b58 with #541 in a retail title: same picture as @⁠cafeoh above, plus where it stops. The mesh draws run, but in every non-empty record the compute pass has written (vertices, primitives) = (1, 1), occasionally (2, 2), so the pass-through has nothing to rasterise. Most indirect mesh draws also arrive with 0 groups.

Setup

  • Tree: main 689f2db merged locally with #1329 (+ #1326, #1327), #1448, #1323, #889, #684, #929, #640 (ported), #1850, #765, #1982, #1405, #1464, three allocator-lifetime commits from wondercrash/xcl (150e635, 761ada5, 9b70233), then #541 (6bd8f64), the rebased #724 branch at 3442b58, #1887 and #1803, plus local diagnostics (counters, a capture of each ExecuteIndirect's argument records and of the two-pass records as the calls read them, target dumps) and a local readback change in sparse.rs (one fence per title queue, see #1329). A local switch refuses the mesh pipelines again for the "off" arm on the same build.
  • Run: release, XCL_UMA_SHADOW=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0 XCL_ACTIVITY=1, no XCL_PSO_WAIT_MS (nothing skipped), compute pipelines the title uses prebuilt with --precompile --used-only. The title's own stall watchdog is neutralised locally. Windows TdrDelay 30 s.
  • RTX 3090 24 GB (driver 616.56), Ryzen 9 5950X, 32 GB RAM + 32 GB page file, Windows 11 22631. Lib tests on this tree: 1 003 passed, 0 failed (47 of 47 mesh / two-pass / indirect tests, GPU ones included).

What the title asks for (pipeline streams logged as it passes them): sub-object 24 holds the console container, there is no sub-object 25 and no VS. The container is a single NGG hardware stage with a mesh interface: 128 threads, at most 128 vertices and 128 primitives, 7 vertex outputs. No amplification stage. Without #541 XCL refuses 6 685 distinct ones in a run (the log cap of 40 hides that). The title issues them both ways: direct DispatchMesh (console slots 127 / 129) and ExecuteIndirect with one signature of stride 12; it does not use argument type 107 here.

A/B on the same build, 600 s runs

mesh pipelines refused #541 + #724
two-pass pipelines built 0 (6 685 refused) 267 – 270, no DXC or driver failure
indirect DispatchMesh per world frame 0 2 806 – 6 759, all executed, 0 skipped
main depth target (D32S8, 2560x1440) clear value (at most 230 texels written in 3 frames) clear value (3 texels in 1 frame)
picture flat grey, HUD on top the same flat grey
device removed (0x887a0005) at 199 s at 476 s

Where it stops (one more run, two world frames captured)

frame A frame B
indirect DispatchMesh 2 833 2 144
… with 0 groups 2 572 1 864
… with groups (sum of groups) 261 (941) 280 (1 618)
direct DispatchMesh, all with groups (sum) 789 (3 356) 739 (7 361)
(vertices, primitives) written by the compute pass in non-empty records (1, 1), sometimes (2, 2) same

So two separate things keep the depth empty here:

  1. The compute pass of the two-pass form yields one vertex and one primitive per record for this title's programs, including the direct calls whose groups are real. The PR's tests pass on this card, so the difference is in what the title's programs do: 128 threads (two 64-lane waves, each run in the split form on a 32-lane GPU), and whatever they use to count and compact (the allocation request, a population count over EXEC, a prefix sum across lanes). Not narrowed down yet; that is what I am looking at next.
  2. About 90 % of the indirect mesh draws get 0 groups from the title's GPU-driven culling, the same culling that leaves most ordinary indirect draws with InstanceCount 0 and most indirect dispatches with 0 thread groups in these frames (with or without the mesh pipelines). That is upstream of this PR.

Not tested: AMD, native 64-lane waves, #1984, #1936 / #1937 (no pipeline was rejected at creation here), the GPU time of the two passes (not timed by my markers).

AI use: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the merges, the captures and the runs) did this and drafted the report.

**@⁠CharlyRien** on GitHub · 2026-11-25 02:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7151154254) **RTX 3090 (Ampere, 32-lane waves), `mesh/two-pass-execution` at `3442b58` with #541 in a retail title: same picture as @⁠cafeoh above, plus where it stops. The mesh draws run, but in every non-empty record the compute pass has written (vertices, primitives) = (1, 1), occasionally (2, 2), so the pass-through has nothing to rasterise. Most indirect mesh draws also arrive with 0 groups.** **Setup** - Tree: `main` `689f2db` merged locally with #1329 (+ #1326, #1327), #1448, #1323, #889, #684, #929, #640 (ported), #1850, #765, #1982, #1405, #1464, three allocator-lifetime commits from `wondercrash/xcl` (`150e635`, `761ada5`, `9b70233`), then #541 (`6bd8f64`), the rebased #724 branch at `3442b58`, #1887 and #1803, plus local diagnostics (counters, a capture of each ExecuteIndirect's argument records and of the two-pass records as the calls read them, target dumps) and a local readback change in `sparse.rs` (one fence per title queue, see #1329). A local switch refuses the mesh pipelines again for the "off" arm on the same build. - Run: release, `XCL_UMA_SHADOW=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0 XCL_ACTIVITY=1`, no `XCL_PSO_WAIT_MS` (nothing skipped), compute pipelines the title uses prebuilt with `--precompile --used-only`. The title's own stall watchdog is neutralised locally. Windows `TdrDelay` 30 s. - RTX 3090 24 GB (driver 616.56), Ryzen 9 5950X, 32 GB RAM + 32 GB page file, Windows 11 22631. Lib tests on this tree: 1 003 passed, 0 failed (47 of 47 mesh / two-pass / indirect tests, GPU ones included). **What the title asks for** (pipeline streams logged as it passes them): sub-object 24 holds the console container, there is no sub-object 25 and no VS. The container is a single NGG hardware stage with a mesh interface: 128 threads, at most 128 vertices and 128 primitives, 7 vertex outputs. No amplification stage. Without #541 XCL refuses 6 685 distinct ones in a run (the log cap of 40 hides that). The title issues them both ways: direct `DispatchMesh` (console slots 127 / 129) and ExecuteIndirect with one signature of stride 12; it does not use argument type 107 here. **A/B on the same build, 600 s runs** | | mesh pipelines refused | #541 + #724 | |---|---|---| | two-pass pipelines built | 0 (6 685 refused) | 267 – 270, no DXC or driver failure | | indirect DispatchMesh per world frame | 0 | 2 806 – 6 759, all executed, 0 skipped | | main depth target (D32S8, 2560x1440) | clear value (at most 230 texels written in 3 frames) | clear value (3 texels in 1 frame) | | picture | flat grey, HUD on top | the same flat grey | | device removed (0x887a0005) | at 199 s | at 476 s | **Where it stops** (one more run, two world frames captured) | | frame A | frame B | |---|---|---| | indirect DispatchMesh | 2 833 | 2 144 | | … with 0 groups | 2 572 | 1 864 | | … with groups (sum of groups) | 261 (941) | 280 (1 618) | | direct DispatchMesh, all with groups (sum) | 789 (3 356) | 739 (7 361) | | (vertices, primitives) written by the compute pass in non-empty records | (1, 1), sometimes (2, 2) | same | So two separate things keep the depth empty here: 1. The compute pass of the two-pass form yields one vertex and one primitive per record for this title's programs, including the direct calls whose groups are real. The PR's tests pass on this card, so the difference is in what the title's programs do: 128 threads (two 64-lane waves, each run in the split form on a 32-lane GPU), and whatever they use to count and compact (the allocation request, a population count over EXEC, a prefix sum across lanes). Not narrowed down yet; that is what I am looking at next. 2. About 90 % of the indirect mesh draws get 0 groups from the title's GPU-driven culling, the same culling that leaves most ordinary indirect draws with `InstanceCount` 0 and most indirect dispatches with 0 thread groups in these frames (with or without the mesh pipelines). That is upstream of this PR. **Not tested**: AMD, native 64-lane waves, #1984, #1936 / #1937 (no pipeline was rejected at creation here), the GPU time of the two passes (not timed by my markers). **AI use**: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the merges, the captures and the runs) did this and drafted the report.
Author
Owner

@⁠CharlyRien on GitHub · 2026-11-25 03:44 UTC · original

Follow-up on the (1, 1) records from my comment above: it is the SGPR base of the mesh stage's root arguments, not the translation. With the title's most common root signature the arguments land one register too late with FIRST_SGPR_MS = 16, so the program reads the wrong descriptor table. The binding looks per shader, from metadata in the container, rather than a fixed base.

Same setup as above (RTX 3090, main 689f2db + the stack listed there + #541 + this branch at 3442b58 + #1887 + #1803).

What the title's mesh programs compute (three bound programs read from their translated code): the program takes a 32-bit descriptor table from s17; slot 0 of that table is the meshlet buffer; it reads the entry at 16·group + 12 and sends vertices = (entry & 0x7F) + 1, primitives = ((entry >> 7) & 0x7F) + 1 with s_sendmsg GS_ALLOC_REQ, from thread 0 only. No bit count, ballot or compaction is involved (v_mbcnt only appears with −1, as the lane index), and the GS_ALLOC_REQ decode in emit.rs is right. (1, 1) simply means the entry read as 0.

Offline: the real program, run in the split-wave64 compute pass on the GPU with inputs I control, writes exact counts: (64, 100), (32, 50), (128, 128). So the translation and the two-pass compute are fine for it.

In the title

  • A probe at execution shows that the table the program gets in s17 has a 128-byte block of float 1.0 in slot 0: per-draw constants, not the meshlet buffer. 1.0f gives count 0, entry 0, hence (1, 1).
  • Logged root signatures: 54 of 60 binds are [table, table, table, root SRV, 2 constants]. Starting the arguments at s16 puts the second table in s17 and the third table plus the low half of the SRV address in s[18:19], which the program uses as one 64-bit address. Starting at s15 gives s17 = third table and s[18:19] = the SRV address, which is what the code expects. The other 6 binds are [table, table, root SRV, 2 constants] and fit s16.
  • That agrees with @⁠veyn-sudo's measurement above (only s3 and s16–s24 are read): both bases satisfy it, the difference is which root argument lands in s17 and s[18:19].
  • Two programs with identical code carry different metadata records after their code in the console container (tag 0x10904; types 0x300 and 0x302, which I read as table and descriptor; descriptor offsets 0x18 against 0x20). So the mapping of root arguments to SGPRs is probably described per shader there. I have not decoded it.

Tried: FIRST_SGPR_MS = 15 as a blunt experiment (plus a unit test with this layout, and a GPU test that runs the real program through user_data_ms: (1, 1) with 16, real counts with 15). In the title, for the first time records carry real counts (292 records between 1 and 128 in three frames, e.g. (128, 120) ×42, (98, 86), (126, 120)), but (1, 1) is still the majority, and the other layout is now the broken one (136 of 1 200 probed binds get the SRV's high word in s18). So a fixed base cannot be right for both; it needs the per-shader binding.

And one more wall behind it: the root SRVs of these draws point at addresses with high words 0xe, 0x12, 0x13, outside every unified-memory window on this tree (the windows cover high words 1 – 4 here). That is the situation of issue #697 (the title's large 64 KiB-page reservations fall back to plain memory, buffer views there get an empty V#, root views read 0), so the vertex data would not be readable even with the right counts. Nothing reaches depth yet.

Not tested: depth coverage with the experiment (the run ended in a device removal at 134 s, before the dumps; one run, so I cannot say the change caused it), AMD, the 0x10904 decode.

I can post the two tests and the probe if useful.

AI use: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the code reading, the offline reproduction and the runs) did this and drafted the report.

**@⁠CharlyRien** on GitHub · 2026-11-25 03:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7152202965) **Follow-up on the (1, 1) records from my comment above: it is the SGPR base of the mesh stage's root arguments, not the translation. With the title's most common root signature the arguments land one register too late with `FIRST_SGPR_MS = 16`, so the program reads the wrong descriptor table. The binding looks per shader, from metadata in the container, rather than a fixed base.** Same setup as above (RTX 3090, `main` `689f2db` + the stack listed there + #541 + this branch at `3442b58` + #1887 + #1803). **What the title's mesh programs compute** (three bound programs read from their translated code): the program takes a 32-bit descriptor table from `s17`; slot 0 of that table is the meshlet buffer; it reads the entry at `16·group + 12` and sends `vertices = (entry & 0x7F) + 1`, `primitives = ((entry >> 7) & 0x7F) + 1` with `s_sendmsg` GS_ALLOC_REQ, from thread 0 only. No bit count, ballot or compaction is involved (`v_mbcnt` only appears with −1, as the lane index), and the GS_ALLOC_REQ decode in `emit.rs` is right. (1, 1) simply means the entry read as 0. **Offline**: the real program, run in the split-wave64 compute pass on the GPU with inputs I control, writes exact counts: (64, 100), (32, 50), (128, 128). So the translation and the two-pass compute are fine for it. **In the title** - A probe at execution shows that the table the program gets in `s17` has a 128-byte block of float 1.0 in slot 0: per-draw constants, not the meshlet buffer. 1.0f gives count 0, entry 0, hence (1, 1). - Logged root signatures: 54 of 60 binds are `[table, table, table, root SRV, 2 constants]`. Starting the arguments at `s16` puts the second table in `s17` and the third table plus the low half of the SRV address in `s[18:19]`, which the program uses as one 64-bit address. Starting at `s15` gives `s17` = third table and `s[18:19]` = the SRV address, which is what the code expects. The other 6 binds are `[table, table, root SRV, 2 constants]` and fit `s16`. - That agrees with @⁠veyn-sudo's measurement above (only `s3` and `s16`–`s24` are read): both bases satisfy it, the difference is which root argument lands in `s17` and `s[18:19]`. - Two programs with identical code carry different metadata records after their code in the console container (tag `0x10904`; types `0x300` and `0x302`, which I read as table and descriptor; descriptor offsets `0x18` against `0x20`). So the mapping of root arguments to SGPRs is probably described per shader there. I have not decoded it. **Tried**: `FIRST_SGPR_MS = 15` as a blunt experiment (plus a unit test with this layout, and a GPU test that runs the real program through `user_data_ms`: (1, 1) with 16, real counts with 15). In the title, for the first time records carry real counts (292 records between 1 and 128 in three frames, e.g. (128, 120) ×42, (98, 86), (126, 120)), but (1, 1) is still the majority, and the other layout is now the broken one (136 of 1 200 probed binds get the SRV's high word in `s18`). So a fixed base cannot be right for both; it needs the per-shader binding. **And one more wall behind it**: the root SRVs of these draws point at addresses with high words `0xe`, `0x12`, `0x13`, outside every unified-memory window on this tree (the windows cover high words 1 – 4 here). That is the situation of issue #697 (the title's large 64 KiB-page reservations fall back to plain memory, buffer views there get an empty V#, root views read 0), so the vertex data would not be readable even with the right counts. Nothing reaches depth yet. **Not tested**: depth coverage with the experiment (the run ended in a device removal at 134 s, before the dumps; one run, so I cannot say the change caused it), AMD, the 0x10904 decode. I can post the two tests and the probe if useful. **AI use**: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the code reading, the offline reproduction and the runs) did this and drafted the report.
Author
Owner

@⁠PracticalStudios on GitHub · 2026-11-25 03:47 UTC · original

Opened as #2092 so the branch above can be reviewed and merged: this PR's commit (authorship kept) + the five review points + the shared-heap bind fix, rebased on main, with the suite and a smoke pair. @⁠Cattn, if you'd rather pull the commits into this PR, say so and I'll close #2092. The (1, 1) records @⁠cafeoh and @⁠CharlyRien found are listed there as not fixed.

AI use: Claude Code (Claude Opus 5.5) wrote this note.

**@⁠PracticalStudios** on GitHub · 2026-11-25 03:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7152247779) Opened as #2092 so the branch above can be reviewed and merged: this PR's commit (authorship kept) + the five review points + the shared-heap bind fix, rebased on `main`, with the suite and a smoke pair. @⁠Cattn, if you'd rather pull the commits into this PR, say so and I'll close #2092. The (1, 1) records @⁠cafeoh and @⁠CharlyRien found are listed there as not fixed. AI use: Claude Code (Claude Opus 5.5) wrote this note.
Author
Owner

@⁠CharlyRien on GitHub · 2026-11-25 05:00 UTC · original

Correction to my follow-up above: FIRST_SGPR_MS = 16 is right, and my "one register too late" reading was wrong. The container states the placement per stage, I have decoded it for every stage of the title's shader pack, and it agrees with XCL's packing of the root arguments everywhere. What the mesh programs are missing is the descriptor-heap base addresses after the arguments (s23 / s24 for the most common layout).

Setup: offline only. A standalone Python decoder over the retail title's shader pack (no XCL code involved), plus xcl disasm (a build of main 689f2db with the stack of my first comment; the disassembler is not affected by it) on three mesh programs to check registers against code. No run of the title is behind this comment; the in-title check is running now and I will add its result.

The per-stage table (the metadata I had not decoded; the tag 0x10904 I quoted is the tail of one of its entries)

  • The stage record starts 0x40 before the stage descriptor XCL already reads (code offset / size at +0x00 / +0x08). At +0x28 and +0x30 it has the offsets (relative to FSSM+0x10) of two tables, with their entry counts at +0x38 and +0x3C. The root-layout table starts at the end of the code in 99 % of stages.
  • Root-layout entry, 20 bytes: u32 type | u32 offset in the table (dwords) | u32 user SGPRs | u32 base register | u8 first user-data dword | u8 root slot | u16 0. Types seen: 0 constants, 1 root descriptor, 3 descriptor table (one entry per range), 4 static sampler, 5 view-heap base, 6 sampler-heap base; nothing else in 5.2 million entries, and the last two bytes are always 0.
  • Used-resource entry, 20 bytes: u8 kind (0 SRV, 1 sampler, 2 CBV, 3 UAV) | u8 root type | u16 0 | u32 table offset | u32 | u32 | u8 descriptor dwords | u8 first user-data dword | u8 root slot | u8 0. For every non-sampler entry its (root type, dword) equals the root-layout entry of the same slot: 0 mismatches in 445 625 entries.
  • User-data dword → register: dword i is s(i) in compute, s(i + 8) in mesh programs (checked against the disassembly of two programs), and VS / PS start at dword 8.
  • That these tables exist, and what the fields mean, I took from reading VIctory's container parser (victory-shader/src/native.rs, GPL-3.0) as a reference; no code was taken, and the byte layout above was worked out from the data by a decoder written without its source.

What the tables say about XCL

  • Root arguments: in every stage, the slots are dense, the first is at XCL's base (dword 4 in compute, 8 elsewhere, so s16 in mesh programs) and the rest follow contiguously with no even alignment for root descriptors. XCL's packing gives the same register for every argument of every stage: 0 differences. No mesh stage starts at s15.
  • Heap bases: 91 % of all stages (and all but 23 of the mesh stages) have a type-5 and / or type-6 entry, always right after the last root argument, view heap first, sampler heap next. That is what #1803 provides for compute and graphics; the two-pass mesh path needs the same.

The most common mesh layout, register by register (root signature [table, table, table, root SRV, 2 constants], 87 % of the mesh stages)

register the table says the code uses
s16 table 0 –
s17 table 1 a descriptor table (V# at +0x20)
s18 table 2 –
s[19:20] root SRV the root SRV
s21, s22 constants s21 & 0x3ff = a descriptor index
s23 view-heap base V# loaded from s23 + index × 32
s24 sampler-heap base –

With base 16 everything is right except s23 / s24, which stay 0. With my base 15 every argument is off by one.

Why my experiment looked right: the probe and the GPU test read s17 and s[18:19] the way the 4-slot programs do ([table, table, root SRV, constants], 18 stages, no heap base) and applied that to binds of the 5-slot layout. For that pairing 15 does line things up, but the tables pair the 5-slot layout with other programs, which read s[19:20] and s23. The 54 / 6 split I reported is just the split between the two layouts. The "real counts" I saw in the title with 15 are not explained by this and should not be read as a sign that 15 is right.

Inferred, being checked in the title now: that the (1, 1) records of the 5-slot programs come from s23 = 0 (the meshlet data is reached through a V# taken from the view heap by index).

One thing for #1803 from the same tables: 1 735 stages use only the sampler heap (1 176 pixel, 417 vertex, 128 mesh, 10 compute, 2 + 2 others) and expect its base right after their arguments. If their root signature also has the view-heap flag, a flag-based rule puts the view heap there. That may be the 102 pixel pipelines that "do not take m0 from after the arguments"; I could not match them offline (the pack has no pipelines). The per-stage table would settle which heaps a stage wants.

I can post the decoder (about 300 lines of Python) if useful.

AI use: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the decoder and the cross-checks) did this and drafted the comment.

**@⁠CharlyRien** on GitHub · 2026-11-25 05:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7153368093) **Correction to my follow-up above: `FIRST_SGPR_MS = 16` is right, and my "one register too late" reading was wrong. The container states the placement per stage, I have decoded it for every stage of the title's shader pack, and it agrees with XCL's packing of the root arguments everywhere. What the mesh programs are missing is the descriptor-heap base addresses after the arguments (`s23` / `s24` for the most common layout).** **Setup**: offline only. A standalone Python decoder over the retail title's shader pack (no XCL code involved), plus `xcl disasm` (a build of `main` `689f2db` with the stack of my first comment; the disassembler is not affected by it) on three mesh programs to check registers against code. No run of the title is behind this comment; the in-title check is running now and I will add its result. **The per-stage table** (the metadata I had not decoded; the tag `0x10904` I quoted is the tail of one of its entries) - The stage record starts 0x40 before the stage descriptor XCL already reads (code offset / size at +0x00 / +0x08). At +0x28 and +0x30 it has the offsets (relative to FSSM+0x10) of two tables, with their entry counts at +0x38 and +0x3C. The root-layout table starts at the end of the code in 99 % of stages. - Root-layout entry, 20 bytes: `u32 type | u32 offset in the table (dwords) | u32 user SGPRs | u32 base register | u8 first user-data dword | u8 root slot | u16 0`. Types seen: 0 constants, 1 root descriptor, 3 descriptor table (one entry per range), 4 static sampler, 5 view-heap base, 6 sampler-heap base; nothing else in 5.2 million entries, and the last two bytes are always 0. - Used-resource entry, 20 bytes: `u8 kind (0 SRV, 1 sampler, 2 CBV, 3 UAV) | u8 root type | u16 0 | u32 table offset | u32 | u32 | u8 descriptor dwords | u8 first user-data dword | u8 root slot | u8 0`. For every non-sampler entry its (root type, dword) equals the root-layout entry of the same slot: 0 mismatches in 445 625 entries. - User-data dword → register: dword i is `s(i)` in compute, `s(i + 8)` in mesh programs (checked against the disassembly of two programs), and VS / PS start at dword 8. - That these tables exist, and what the fields mean, I took from reading VIctory's container parser (`victory-shader/src/native.rs`, GPL-3.0) as a reference; no code was taken, and the byte layout above was worked out from the data by a decoder written without its source. **What the tables say about XCL** - Root arguments: in every stage, the slots are dense, the first is at XCL's base (dword 4 in compute, 8 elsewhere, so `s16` in mesh programs) and the rest follow contiguously with no even alignment for root descriptors. XCL's packing gives the same register for every argument of every stage: 0 differences. No mesh stage starts at `s15`. - Heap bases: 91 % of all stages (and all but 23 of the mesh stages) have a type-5 and / or type-6 entry, always right after the last root argument, view heap first, sampler heap next. That is what #1803 provides for compute and graphics; the two-pass mesh path needs the same. **The most common mesh layout, register by register** (root signature `[table, table, table, root SRV, 2 constants]`, 87 % of the mesh stages) | register | the table says | the code uses | |---|---|---| | `s16` | table 0 | – | | `s17` | table 1 | a descriptor table (V# at +0x20) | | `s18` | table 2 | – | | `s[19:20]` | root SRV | the root SRV | | `s21`, `s22` | constants | `s21 & 0x3ff` = a descriptor index | | `s23` | view-heap base | V# loaded from `s23 + index × 32` | | `s24` | sampler-heap base | – | With base 16 everything is right except `s23` / `s24`, which stay 0. With my base 15 every argument is off by one. **Why my experiment looked right**: the probe and the GPU test read `s17` and `s[18:19]` the way the 4-slot programs do (`[table, table, root SRV, constants]`, 18 stages, no heap base) and applied that to binds of the 5-slot layout. For that pairing 15 does line things up, but the tables pair the 5-slot layout with other programs, which read `s[19:20]` and `s23`. The 54 / 6 split I reported is just the split between the two layouts. The "real counts" I saw in the title with 15 are not explained by this and should not be read as a sign that 15 is right. **Inferred, being checked in the title now**: that the (1, 1) records of the 5-slot programs come from `s23 = 0` (the meshlet data is reached through a V# taken from the view heap by index). **One thing for #1803 from the same tables**: 1 735 stages use only the sampler heap (1 176 pixel, 417 vertex, 128 mesh, 10 compute, 2 + 2 others) and expect its base right after their arguments. If their root signature also has the view-heap flag, a flag-based rule puts the view heap there. That may be the 102 pixel pipelines that "do not take m0 from after the arguments"; I could not match them offline (the pack has no pipelines). The per-stage table would settle which heaps a stage wants. I can post the decoder (about 300 lines of Python) if useful. **AI use**: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the decoder and the cross-checks) did this and drafted the comment.
Author
Owner

@⁠CharlyRien on GitHub · 2026-11-25 05:16 UTC · original

In-title result, as promised: the explanation I inferred above is wrong on my tree. With base 16 the two-pass compute pass does get the heap bases in s23 / s24, and the records are still (1, 1). So base 16 stands (the tables say so), but missing heap bases are not what keeps the counts at (1, 1) here.

Setup: same tree as my first comment above (main 689f2db + the stack listed there + #541 + this branch at 3442b58 + #1887 + #1803), with two local additions: the two-pass compute pass takes #1803's heap addresses (with_heaps over user_data_ms, a few lines; neither this branch nor #1803 does that alone), and a switch for the first register, set to 16 for this run. Release, XCL_UMA_SHADOW=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_GPU_WAIT_RELEASE_MS=250, warm caches; local switches as before (the title's own stall watchdog neutralised, compute programs of 4 MB of DXIL or more not handed to the driver). RTX 3090 24 GB (driver 616.56), Windows 11 22631, TdrDelay 30 s. One run, world reached at about 85 s, numbers from one frame at 113 s.

Measured

  • Registers of the compute pass, logged at the bind: the title's mesh root signatures carry both heap flags; in 10 000 of 10 000 binds s16–s22 hold the arguments, s23 the view-heap address and s24 the sampler-heap address. That is the placement the per-stage tables give.
  • Records of that frame (first 4 records of each of 400 calls): 381 × (1, 1), including all 67 direct DispatchMesh calls; 1 192 × (0, 0) in indirect calls whose records were never written; 2 × (2, 2); no other counts.
  • The main depth target stays at its clear value in the seven frames dumped (at most 2 texels differ).

So: with the registers as the console compiler states them, the 5-slot programs still read a zero meshlet entry. What is left between the registers and the entry is the V# they load from s23 + index × 32 (what the view-heap slot holds for that index) and the buffer it points to. My earlier note that the root SRVs of these draws point outside the unified-memory windows (#697) still applies to the vertex data; whether the meshlet buffer behind that heap slot is in the same situation is the next thing I will measure.

For this PR and #2092 that leaves two concrete points: keep FIRST_SGPR_MS = 16, and pass the heap addresses to the compute pass once #1803 is in. Neither is enough for the title on its own.

Not tested: the unit test for the 16 + heaps layout (written, not run); base 15 without heap bases gave the same picture in one run that the memory guard cut short, so I do not count it.

AI use: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the code reading and the runs) did this and drafted the comment.

**@⁠CharlyRien** on GitHub · 2026-11-25 05:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7153609551) **In-title result, as promised: the explanation I inferred above is wrong on my tree. With base 16 the two-pass compute pass does get the heap bases in `s23` / `s24`, and the records are still (1, 1). So base 16 stands (the tables say so), but missing heap bases are not what keeps the counts at (1, 1) here.** **Setup**: same tree as my first comment above (`main` `689f2db` + the stack listed there + #541 + this branch at `3442b58` + #1887 + #1803), with two local additions: the two-pass compute pass takes #1803's heap addresses (`with_heaps` over `user_data_ms`, a few lines; neither this branch nor #1803 does that alone), and a switch for the first register, set to 16 for this run. Release, `XCL_UMA_SHADOW=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_GPU_WAIT_RELEASE_MS=250`, warm caches; local switches as before (the title's own stall watchdog neutralised, compute programs of 4 MB of DXIL or more not handed to the driver). RTX 3090 24 GB (driver 616.56), Windows 11 22631, `TdrDelay` 30 s. One run, world reached at about 85 s, numbers from one frame at 113 s. **Measured** - Registers of the compute pass, logged at the bind: the title's mesh root signatures carry both heap flags; in 10 000 of 10 000 binds `s16`–`s22` hold the arguments, `s23` the view-heap address and `s24` the sampler-heap address. That is the placement the per-stage tables give. - Records of that frame (first 4 records of each of 400 calls): 381 × (1, 1), including all 67 direct `DispatchMesh` calls; 1 192 × (0, 0) in indirect calls whose records were never written; 2 × (2, 2); no other counts. - The main depth target stays at its clear value in the seven frames dumped (at most 2 texels differ). **So**: with the registers as the console compiler states them, the 5-slot programs still read a zero meshlet entry. What is left between the registers and the entry is the V# they load from `s23 + index × 32` (what the view-heap slot holds for that index) and the buffer it points to. My earlier note that the root SRVs of these draws point outside the unified-memory windows (#697) still applies to the vertex data; whether the meshlet buffer behind that heap slot is in the same situation is the next thing I will measure. For this PR and #2092 that leaves two concrete points: keep `FIRST_SGPR_MS = 16`, and pass the heap addresses to the compute pass once #1803 is in. Neither is enough for the title on its own. **Not tested**: the unit test for the 16 + heaps layout (written, not run); base 15 without heap bases gave the same picture in one run that the memory guard cut short, so I do not count it. **AI use**: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the code reading and the runs) did this and drafted the comment.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 06:18 UTC · original

Empirical test report (2624f00c)

Hardware / environment

  • Commit 2624f00c4e2d8b87aa1828233fb2f60899eb9533, tested from a clean detached worktree.
  • Intel Arc A770, driver 32.0.101.9175, and AMD Ryzen 7 3800X. Windows build 10.0.26200.9974.
  • Rust 1.100.0 (0ef1bc386 2026-11-09), host x86_64-pc-windows-msvc. DXC and DXIL 1.9.2609.5. Unoptimized test profile with incremental compilation and debug info disabled.

Commands and results

  • cargo test --workspace --no-run exited 0 and built 16 test executables. This step only compiled the tests.
  • xcl-00e28da3621caf64.exe --exact hle::d3d12x::bind::tests::dispatch_mesh_signature_tracking_returns_companion_and_layout hle::d3d12x::console_list::tests::mesh_arguments_go_in_user_sgprs_from_s16 --test-threads=1 with XCL_ADAPTER=NONE_CPU_ONLY, outside the Arc wrapper. Exit 0. 2 passed / 0 failed / 0 ignored / 0 skipped.
  • xcl-00e28da3621caf64.exe --exact gpu::recomp::tests::gpu_mesh_mode_two_passes --test-threads=1 inside Invoke-ArcTest.ps1, with XCL_ADAPTER=A770. Exit 0. 1 passed / 0 failed / 0 ignored / 0 skipped.
  • Both test runs used RUST_TEST_NOCAPTURE=1. Skip counts use case-sensitive ^SKIPPED lines in the captured output.

Observed behavior

The new CPU tests verified companion signature and layout tracking, and mesh inline arguments starting at s16 with the table pointer in s8:s9. The existing GPU test checked compute-generated records, expected triangle pixels and clear pixels, and identical rasterization with split mesh output.

Not tested

The GPU test uses the recompiler harness. The PR's console DispatchMesh and ExecuteIndirect hooks, including indirect argument scaling, were not directly exercised on the GPU. The full GPU workspace suite and game smoke runs were omitted.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr724-focused.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 06:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7154654712) ### Empirical test report (2624f00c) **Hardware / environment** - Commit `2624f00c4e2d8b87aa1828233fb2f60899eb9533`, tested from a clean detached worktree. - Intel Arc A770, driver `32.0.101.9175`, and AMD Ryzen 7 3800X. Windows build `10.0.26200.9974`. - Rust `1.100.0 (0ef1bc386 2026-11-09)`, host `x86_64-pc-windows-msvc`. DXC and DXIL `1.9.2609.5`. Unoptimized test profile with incremental compilation and debug info disabled. **Commands and results** - `cargo test --workspace --no-run` exited 0 and built 16 test executables. This step only compiled the tests. - `xcl-00e28da3621caf64.exe --exact hle::d3d12x::bind::tests::dispatch_mesh_signature_tracking_returns_companion_and_layout hle::d3d12x::console_list::tests::mesh_arguments_go_in_user_sgprs_from_s16 --test-threads=1` with `XCL_ADAPTER=NONE_CPU_ONLY`, outside the Arc wrapper. Exit 0. 2 passed / 0 failed / 0 ignored / 0 skipped. - `xcl-00e28da3621caf64.exe --exact gpu::recomp::tests::gpu_mesh_mode_two_passes --test-threads=1` inside `Invoke-ArcTest.ps1`, with `XCL_ADAPTER=A770`. Exit 0. 1 passed / 0 failed / 0 ignored / 0 skipped. - Both test runs used `RUST_TEST_NOCAPTURE=1`. Skip counts use case-sensitive `^SKIPPED ` lines in the captured output. **Observed behavior** The new CPU tests verified companion signature and layout tracking, and mesh inline arguments starting at `s16` with the table pointer in `s8:s9`. The existing GPU test checked compute-generated records, expected triangle pixels and clear pixels, and identical rasterization with split mesh output. **Not tested** The GPU test uses the recompiler harness. The PR's console `DispatchMesh` and `ExecuteIndirect` hooks, including indirect argument scaling, were not directly exercised on the GPU. The full GPU workspace suite and game smoke runs were omitted. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr724-focused.log and published.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 11:38 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-25 11:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7161317854) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
Author
Owner

@⁠pickles976 on GitHub · 2026-11-25 17:44 UTC · original

RTX 4060 Laptop / Wine verification of the current PR logic (ported onto a local integration tree, not a clean PR-head run):

  • mesh_arguments_go_in_user_sgprs_from_s16: 1 passed / 0 failed.
  • dispatch_mesh_signature_tracking_returns_companion_and_layout: 1 passed / 0 failed.
  • gpu_mesh_mode_two_passes: 1 passed / 0 failed on the RTX 4060 through Wine/vkd3d-proton; the test rendered the expected split mesh output.
  • Release build completed.

I then ran the retail title with #541 and this PR ported together. A 7.5 GiB VRAM guard stopped it at 120.6 s (7,614 MiB GPU, 2,797 MiB system RAM available). It reached frame 2420 at 25.9 fps over the last 300 frames, but the captured frame was still loading artwork, not the world. No crash, device removal, E_OUTOFMEMORY, or two-pass error appeared. I saw no two-pass execution log in this interval, so the title run does not prove that the title exercised this path; the GPU unit test is the direct execution evidence here.

Hardware/runtime: NVIDIA GeForce RTX 4060 Laptop GPU 8 GiB, driver 590.48.1, Linux 6.17, Wine 11, vkd3d-proton 2576c0b4, DXC 1.9.2609.5, Rust 1.98.1 MSVC cross-build. I used OpenAI Codex (GPT-5.6 Sol) to port the conflicting PR, run the tests/title, and inspect the logs and captured frame; I reviewed this report before posting.

**@⁠pickles976** on GitHub · 2026-11-25 17:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7169929649) RTX 4060 Laptop / Wine verification of the current PR logic (ported onto a local integration tree, not a clean PR-head run): - `mesh_arguments_go_in_user_sgprs_from_s16`: 1 passed / 0 failed. - `dispatch_mesh_signature_tracking_returns_companion_and_layout`: 1 passed / 0 failed. - `gpu_mesh_mode_two_passes`: 1 passed / 0 failed on the RTX 4060 through Wine/vkd3d-proton; the test rendered the expected split mesh output. - Release build completed. I then ran the retail title with #541 and this PR ported together. A 7.5 GiB VRAM guard stopped it at 120.6 s (`7,614 MiB` GPU, `2,797 MiB` system RAM available). It reached frame 2420 at 25.9 fps over the last 300 frames, but the captured frame was still loading artwork, not the world. No crash, device removal, `E_OUTOFMEMORY`, or two-pass error appeared. I saw no two-pass execution log in this interval, so the title run does not prove that the title exercised this path; the GPU unit test is the direct execution evidence here. Hardware/runtime: NVIDIA GeForce RTX 4060 Laptop GPU 8 GiB, driver 590.48.1, Linux 6.17, Wine 11, vkd3d-proton 2576c0b4, DXC 1.9.2609.5, Rust 1.98.1 MSVC cross-build. I used OpenAI Codex (GPT-5.6 Sol) to port the conflicting PR, run the tests/title, and inspect the logs and captured frame; I reviewed this report before posting.
Author
Owner

@⁠CalvyPZ on GitHub · 2026-11-25 22:36 UTC · original

This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.

**@⁠CalvyPZ** on GitHub · 2026-11-25 22:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/724#issuecomment-7176575158) This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.