Repository navigation
Conversation
…irect 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)
|
Independent test report on Tested
Not tested
AI use
|
…irect Integrates upstream PR ivall#724 on top of subobject-24 console MS translation: - Hook console DispatchMesh (slot 127 / newer 129) and pair DISPATCH_MESH command signatures with companion DISPATCH signatures. - Run the compute pass into a recycled per-allocator record buffer, barrier, scale indirect arguments when split > 1, and run the mesh pass.
|
Independent GPU readback for the split >1 indirect-argument scaler at A temporary synthetic fixture called the PR’s
This covers the argument scaler. End-to-end |
…irect Integrates upstream PR ivall#724 on top of subobject-24 console MS translation: - Hook console DispatchMesh (slot 127 / newer 129) and pair DISPATCH_MESH command signatures with companion DISPATCH signatures. - Run the compute pass into a recycled per-allocator record buffer, barrier, scale indirect arguments when split > 1, and run the mesh pass.
|
Test run of Tested
Review: The PR adds the missing execution path: Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
…irect Integrates upstream PR xcl-dev#724 on top of subobject-24 console MS translation: - Hook console DispatchMesh (slot 127 / newer 129) and pair DISPATCH_MESH command signatures with companion DISPATCH signatures. - Run the compute pass into a recycled per-allocator record buffer, barrier, scale indirect arguments when split > 1, and run the mesh pass.
…irect Integrates upstream PR ivall#724 on top of subobject-24 console MS translation: - Hook console DispatchMesh (slot 127 / newer 129) and pair DISPATCH_MESH command signatures with companion DISPATCH signatures. - Run the compute pass into a recycled per-allocator record buffer, barrier, scale indirect arguments when split > 1, and run the mesh pass.
|
A retail data point for the 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. |
…irect Integrates upstream PR ivall#724 on top of subobject-24 console MS translation: - Hook console DispatchMesh (slot 127 / newer 129) and pair DISPATCH_MESH command signatures with companion DISPATCH signatures. - Run the compute pass into a recycled per-allocator record buffer, barrier, scale indirect arguments when split > 1, and run the mesh pass.
|
Review of 1. The record buffer is not sized to the dispatch, and root UAVs have no bounds check. 2. Indirect arguments with Y or Z > 1 lose groups. The direct path flattens 3. Not run, from reading only: the 65,535 groups-per-dimension 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 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. 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. |
|
A test report on Tested
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.
Head block (pair 1): Base block (pair 1): Base block (pair 2): Head block (pair 2): Review
Not tested
AI use |
…h rendering) Consolidate critical engine subsystems required to transition from Stage 5 (2D menus presentation loop) to Stage 6 (ingame 3D world loading, streaming, and gameplay rendering) on Apple Silicon / macOS via D3DMetal: 1. Two-pass mesh shader execution on DispatchMesh and ExecuteIndirect (PR ivall#724): - Hook DispatchMesh (slot 127 / newer 129) on console command list vtable. - Execute TwoPassPso (Pass 1 compute -> UAV barrier -> Pass 2 mesh+PS -> UAV barrier). - Track console mesh root-argument layout (s[8:9] spill table, inline arguments from s16). - Create companion DISPATCH command signature alongside DISPATCH_MESH in device_x. - Allocate/recycle DEFAULT-heap UAV record buffer per command list (recycled on allocator reset). - Scale indirect DispatchMesh group counts on GPU when mesh_groups_per_record > 1. 2. GPU-side root-changing ExecuteIndirect repack (PR ivall#869): - Repack root-changing indirect draw and dispatch commands on the GPU. - Allow translated pipelines on XCL ABI root signature to consume title root-changing signatures. - Retain native count buffer support and track allocator lifetime for indirect argument buffers. 3. DirectStorage BCPack decompression acceptance (XCL_DSTORAGE_BCPACK_ACCEPT=1): - Prevent E_DECOMPRESSION (0x89240030) errors when streaming assets. - Maintain since_status = S_OK when solid blocks are filled. 4. Watchdog & fatal crash bypass at 0x23cf683 (eh.rs): - Prevent GPU hang watchdog ('GPU Loc Sig') and null write at 0x23cf683 from terminating the process when compute PSO compilation or decompression stalls >30s. 5. Sparse buffer lock safety: - Use try_lock in forget_buffer and drain deferred GONE queue on forget_gone. - Eliminates D3DMetal re-entrancy deadlocks during command list reset/execution. 6. Expanded verification suite: - 30 host subsystem checks passing in scripts/verify_mac_build.sh.
|
Great progress on two-pass |
|
Review and test report on 1. The two-pass 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;
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. |
…irect Integrates upstream PR ivall#724 on top of subobject-24 console MS translation: - Hook console DispatchMesh (slot 127 / newer 129) and pair DISPATCH_MESH command signatures with companion DISPATCH signatures. - Run the compute pass into a recycled per-allocator record buffer, barrier, scale indirect arguments when split > 1, and run the mesh pass.
|
Two heads-up from testing two-pass Mesh Shaders rebased onto current
|
|
This is the piece #541 needs: at What is open here, from the reviews above, before it can be merged:
@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 Not tested: I have not built or run this PR; the list is from its reviews and from reading AI use: Claude Code (Claude Opus 5.5) read the code and the thread and wrote this, on the maintainer's behalf. |
|
@Cattn are you still on the points @ivall listed above? If not, I can take them: rebase onto AI use: Claude Code (Claude Opus 5.5) wrote this comment. |
|
@Cattn @ivall the points above are done on
Each fix has a test that fails without it. RTX 3090 (wave32, mesh shaders), Windows 11, debug: 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. |
|
Measurements on the mesh shader's user SGPRs, for the rebased branch (
Once #1803 and this have both landed, it should be a small follow-up: append 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. |
|
RTX 2080 Ti (Turing): Setup: RTX 2080 Ti 11 GB (32-lane waves), driver 617.14, Windows 10 19045, release. Retail 1.0.2.1. Tree: What I looked at: a render-target dump at present (Palmwave's
After each removal the title stops at Not tested: the test suite on this tree (the two-pass GPU tests pass alone, AI use: Claude Code (Claude Opus 5.5) merged the trees, ran the runs on this machine, read the dumps and wrote this comment. |
|
RTX 3090 (Ampere, 32-lane waves), Setup
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 A/B on the same build, 600 s runs
Where it stops (one more run, two world frames captured)
So two separate things keep the depth empty here:
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. |
|
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 Same setup as above (RTX 3090, What the title's mesh programs compute (three bound programs read from their translated code): the program takes a 32-bit descriptor table from 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
Tried: And one more wall behind it: the root SRVs of these draws point at addresses with high words 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. |
|
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 AI use: Claude Code (Claude Opus 5.5) wrote this note. |
|
Correction to my follow-up above: Setup: offline only. A standalone Python decoder over the retail title's shader pack (no XCL code involved), plus The per-stage table (the metadata I had not decoded; the tag
What the tables say about XCL
The most common mesh layout, register by register (root signature
With base 16 everything is right except Why my experiment looked right: the probe and the GPU test read Inferred, being checked in the title now: that the (1, 1) records of the 5-slot programs come from 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. |
|
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 Setup: same tree as my first comment above ( Measured
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 For this PR and #2092 that leaves two concrete points: keep 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. |
Empirical test report (2624f00)Hardware / environment
Commands and results
Observed behavior The new CPU tests verified companion signature and layout tracking, and mesh inline arguments starting at Not tested The GPU test uses the recompiler harness. The PR's console 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. |
Console mesh shaders translated to a two-pass pair (compute + mesh/PS,
TwoPassPso) were already built duringCreatePipelineState, but there was no execution path for them:DispatchMeshwas not hooked on the console command list vtable, andExecuteIndirectdid 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_msacross 16 SGPRs froms16with the spill table pointer ins[8:9]) viauser_data_ms, and recycle per-allocator two-pass record buffers onallocator_reset.crates/xcl/src/hle/d3d12x/device_x.rs: increate_command_signature_x, create a companionDISPATCHcommand signature alongside non-root-changingDISPATCH_MESHcommand signatures and register(sig, companion, byte_stride, mesh_offset).crates/xcl/src/hle/d3d12x/real.rs: hookDispatchMeshat console command list slot127(newer layout slot129) and addlist_devicehelper.crates/xcl/src/hle/d3d12x/bind.rs: implementdispatch_meshandTwoPassPsohandling inexecute_indirect: allocate/recycle aDEFAULT-heap UAV record buffer per command list, bindu0(io),u1(res),u2..u5(UMA), run Pass 1 compute -> UAV barrier -> Pass 2 mesh+PS -> UAV barrier, and scale indirectDispatchMeshgroup counts on the GPU whenmesh_groups_per_record > 1.console_list::tests::mesh_arguments_go_in_user_sgprs_from_s16andbind::tests::dispatch_mesh_signature_tracking_returns_companion_and_layout.Tested
rustc 1.93.1 (01f6ddf75 2026-02-11), debug for workspace tests, release for regression runs.cargo build --workspace && cargo test --workspace -- --test-threads=4on2624f00: 703 passed, 0 failed, 41 ignored.gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware.7f4b2c91past loading:128+two-passExecuteIndirect(DispatchMesh)calls executed cleanly and rendered 3D world geometry (streetlights, gantries, foliage) without device removal.Regression run
main:
PR:
Not tested
DispatchMeshor indirectExecuteIndirect(DispatchMesh)withmesh_groups_per_record > 1on a standalone GPU unit test (observed calls on title7f4b2c91hadsplit 1).DISPATCH_MESHcommand signatures (skipped as before).AI use