Repository navigation
Conversation
An ExecuteIndirect of a compute program that the recompiler split into pieces fell back to the program's whole form, and that form was compiled on the recording thread when first needed. On an RTX 5070 Ti with XCL_DIRECT_DXIL=1 a retail title stalls its world load on it: 11 per-material programs, 9-14 pieces each, each dispatched through ExecuteIndirect, each whole form 690-950 KB of DXIL taking 16-40 s to compile, one after another from 326 s to past 600 s. The title's ExecuteIndirects of split programs all have one command signature: one Dispatch, stride 12, MaxCommandCount 1, no count buffer (150 of them in 360 s). Their group counts are written on the GPU, so the CPU cannot slice them when recording. The ExecuteIndirect now runs the chain on the GPU. A small compute pass (pso::record_slicer) reads the title's arguments (and count) and writes, for a fixed number of rounds, one command per piece of each slab of dispatch_slabs (the root constants of record_dispatch_chain, then the slab's group counts); unused rounds get empty dispatches. Each piece then runs one ExecuteIndirect per round with the chain's command signature, with UAV barriers between them, in the bounded scratch. The rounds come from the arguments the CPU sees now and the most slabs an earlier ExecuteIndirect of the program had, plus a quarter (2 to XCL_SPLIT_INDIRECT_ROUNDS, 16). When the arguments need more slabs, the slicer sets a predicate: the rounds are skipped and the title's ExecuteIndirect runs with the whole form if it is built already. If it is not, the rounds run, the lost slabs are counted and warned about once per program, the whole form is built on another thread for the next ones, and the next rounds are sized from the count. Under the title's own predication XCL's is not set. Bundles, lists without scratch and other command signatures keep the whole form. The 'compute split' line counts chained, whole and lost ExecuteIndirects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runner::dispatch_split_indirect records a chain's ExecuteIndirect the way the runtime does (slicer, chain ExecuteIndirects, the whole form under the predicate). dispatch_chain_divergent_forward_edges_3d runs it with one command, several with empty commands and a count buffer that leaves the last out, a stride of 20 bytes, in slabs of 1 to 12 groups and 1 to 16 rounds, and checks the memory against the whole program and the slicer's slab count. With more slabs than rounds it checks that the predicate is set and the whole form runs instead, and that without a whole form only the rounds' groups run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Test report on AMD / Linux (RDNA3, RADV): with #2404 + #2097 no title thread builds a whole form any more, and with Setup: RX 7900 XT 20 GB (Mesa 26.2.5 RADV), Linux 7.2, Proton-CachyOS Wine 11, a local vkd3d-proton build; 24 GB RAM, the game capped at 16 GB. Retail 1.0.2.1,
Not tested: what is on screen (no screenshots of these runs; longer runs with captures are going now), Windows, NVIDIA, this PR without the other carried PRs, a cold cache. AI use: Claude Code (Claude Opus 5.5) ran the builds and runs on this machine, read the logs and thread dumps, and wrote this report. |
|
RTX 3060 12 GB, 32 GB RAM, Tested
By reading (neither exercised here)
Not tested: picture, same caches without this PR, the suite, AMD. Unknown: exit code, whether our low-commit stop script ended it. AI use: Claude Code. Claude Opus 5.5 ran it and wrote this; a second Claude Opus 5.5 checked the numbers; Claude Fable 5.2 reviewed the text; a person checked it. |
|
Independent test and smoke report for head Tested
Regression run (
PR Not tested: NVIDIA/Intel GPUs, Linux/Wine, or world load past the 60 s smoke window. AI use: Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting. |
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
|
Independent Windows/NVIDIA result on clean 5ca9c23. RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, DXC/DXIL 1.8.2502.11.
Adjacent controls on the same head: Not tested: full workspace, retail title, other GPUs. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the checks and drafted this report. |
|
Independent retail check on an RTX 5080 (retail 1.0.2.1, 600 s,
at 600 s. Without the stack, the same title's direct runs fell back to ~900 KB whole forms built on title threads at 93, 135, 176, 224, 265, 303, 357, 398, 437, 474, 505 and 580 s — exactly the wall this PR describes. So the ExecuteIndirect whole-form fallback is gone here (0 whole, 0 slabs lost). Caveat on presentation: this first stack run presented to 116 s (14 two-second intervals after 96 s), but it ran on a new base with a cold direct cache (8 cold compiles). A second run is warming it; I will report the number when it finishes. The AI use: OpenCode, Claude Fable 5.2 built the stack, ran the retail title on this machine and wrote this. |
|
Tested: current PR head merged onto current
Not tested: retail titles (no title data on this lane, counts only). AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Follow-up after a second (warm) run of the same stack: the ExecuteIndirect whole forms are still 0 of them whole, 0 slabs lost ( AI use: OpenCode, Claude Fable 5.2 ran the second stack run on this machine and wrote this. |
…#2404, xcl-dev#2405 Integrates VRAM top-mip pressure shedding (xcl-dev#2385), DXC wanted-compile prioritization & worker headroom (xcl-dev#2423), inline split pipeline foreground path (xcl-dev#2424), ExecuteIndirect split program dispatch (xcl-dev#2404), and hosted view heap exhaustion null-pair fallback (xcl-dev#2405). Assisted-by: Antigravity (Gemini 4 Neon)
, xcl-dev#2333, and UnadoptGuard test submits Assisted-by: Antigravity (Gemini 4 Neon)
|
Read in full (body, thread, diff). The approach is the one I want for #2088: it removes the whole-form compiles from the title's threads, and the retail reports above agree on that (0 whole). Before it can be merged:
@pvfreis's first point (the Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug, Not tested: a title run with this PR, NVIDIA. AI use: Claude Code (Claude Opus 5.5) read the thread and the diff, ran the tests and wrote this on the maintainer's behalf. |
|
@ivall On point 1, a second NVIDIA card: the same failure on an RTX 3070 8 GB (Ampere, driver 616.56; thehollowedone's 3080 Ti is on 621.35), Windows 11, debug, without the D3D12 debug layer. How many words differ, from the assertion's Added 20:1xZ, with the two
So on this card it fails with and without the predicate, and without it the read-back buffer is all zero, guards included. AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only. |
Test report: #2372 and #2404 on an RTX 3080, retail title 7952987ASummary: both PRs remove the world-load freeze on this card. With either one applied, every run then hits the silent Setup
Conflicts with current
Base, 6 runs
#2404, 3 runs
#2372, 3 runs
What this says Not tested: AMD, other titles, and runs without (Runs and report by Claude Code with Claude Opus 5.5. The commands and counts above come from these runs.) |
Part of #2088.
On NVIDIA with
XCL_DIRECT_DXIL=1, a retail title's world load stalls on whole-program compiles. Each per-material ray-tracing resolve program is split into 9–14 pieces, and those build fast. The title then dispatches the program throughExecuteIndirect, andbind.rsfalls back to the program's whole form (690–950 KB of DXIL), compiled synchronously on the title's thread. In a 600 s run onmain0829441(RTX 5070 Ti), 11 of these compiles took 16–40 s each, one after another, from 326 s to past the end of the run.This makes such an
ExecuteIndirectrun the program's pieces. The title's group counts are written on the GPU, so the CPU cannot cut them into slabs when recording. A one-thread compute pass (the slicer) reads the title's arguments and count on the GPU. For a fixed number of rounds it writes, for each slab ofdispatch_slabs, one command per piece: the root constantsrecord_dispatch_chainsets, then the slab's group counts. Each piece then runs oneExecuteIndirectper round with a command signature on the chain's root signature, with UAV barriers between them, in the bounded scratch split dispatches already use. Unused rounds dispatch nothing.All of the title's
ExecuteIndirects of split programs (150 in a 360 s run) used one command signature: one Dispatch, stride 12,MaxCommandCount1, no count buffer. Their group counts were 0 when recorded during load.What is in it
D3D12.X: an ExecuteIndirect of a split program runs its pieces(2b19fec):gpu/recomp/pso.rs: the slicer (HLSL compiled once per device), the chain's command signature,record_slicer,record_dispatch_chain_indirectandslab_count, with a test thatslab_countmatchesdispatch_slabs.hle/d3d12x/real/dispatch_chain.rs:execute_indirect. The number of rounds comes from the arguments the CPU sees when recording and the most slabs an earlierExecuteIndirectof the program needed, plus a quarter (2 toXCL_SPLIT_INDIRECT_ROUNDS, default 16).ExecuteIndirectruns the whole form instead, if it is built already.ExecuteIndirects of the program get more rounds.compute splitline counts chained, whole and lostExecuteIndirects.hle/d3d12x/bind.rs,device_x.rs,list_x.rs: the call site, which command signatures are a single Dispatch, and whether the title's predication is set.Tests: a split program's ExecuteIndirect matches the whole program(5ca9c23):runner::dispatch_split_indirectrecords it the way the runtime does.dispatch_chain_divergent_forward_edges_3dcompares the memory with the whole program's output and checks the slicer's slab count for:With more slabs than rounds, it checks that the predicate is set and that the whole form runs instead. Without a whole form, it checks that only the rounds' groups run.
Tested
cargo test --workspace --no-fail-fast -- --test-threads=4(debug) on5ca9c23(onmain68a284a): 1289 passed, 1 failed, 46 ignored. Failed:gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier. It fails onmain68a284atoo, with the same assertion and output (lower_dxil.rs:1155, the group barriers in the program); main's CI fails since Recompiler: a bridged mask write in the split form meets no barrier #2074. 25 SKIPPED notices: no native wave64 on this card, three per-lane FP16 forms the per-lane lowering refuses, and no heap windows. Thedispatch_chain,split,execute_indirectandslabfilters also ran with the D3D12 debug layer on (XCL_D3D12_DEBUG=1): 39 passed, 0 failed, 1 ignored.XCL_DIRECT_DXIL=all: this branch, against a 300 s run ofmain68a284awith the same environment.mainrun (300 s) did not get that far: from 168 s to its end, a title thread was in the call for an unsplit 1.39 MB compute build.235 programs split, 2007 pieces built, 439 chained dispatches issued in 3326 slabs; scratch 654 MiB (most 654, largest dispatch 2109 in one slab); ExecuteIndirect: 1303 chained (0 of them whole, 0 slabs lost), 28 whole.ExecuteIndirects (from 499 s on) took one of the paths that keep the whole form; which one is not logged.main68a284awith this PR and Recompiler: split wave64 compute groups of several waves across dispatches #2097: past the loading screen into the intro cutscene, the first such run here on NVIDIA. The device was removed at 154 s (0x887a0005, local video memory full); the cause is open (#505 comment).GetCachedBlob).Regression run
scripts/smoke.ps1 -Seconds 120, the same retail title,XCL_DIRECT_DXIL=1, a private XCL cache started from the sameused-pipelines.txt. The two ran one after the other on the machine under Tested, from release builds of clean trees.main68a284a(this PR's base):this PR,
5ca9c23:compute splitcounter at the end of each run:main:compute split: 17 programs split, 78 pieces built, 99 chained dispatches issued in 99 slabs; scratch 79 MiB (most 79, largest dispatch 39 in one slab)compute split: 22 programs split, 114 pieces built, 110 chained dispatches issued in 110 slabs; scratch 337 MiB (most 337, largest dispatch 19 in one slab); ExecuteIndirect: 2 chained (0 of them whole, 0 slabs lost), 0 wholeThe scratch is larger because a chained
ExecuteIndirecttakes the whole scratch budget (XCL_SPLIT_SCRATCH_MB, 256 MiB) for its list: its group counts are not known when it is recorded.Not tested
ExecuteIndirects took (no scratch left, bundles or another signature).AI use
🤖 Generated with Claude Code