Skip to content

D3D12.X: an ExecuteIndirect of a split program runs its pieces - #2404

Open
Kalmarv wants to merge 2 commits into
xcl-dev:mainfrom
Kalmarv:chain-indirect
Open

Kalmarv wants to merge 2 commits into
xcl-dev:mainfrom
Kalmarv:chain-indirect

Conversation

@Kalmarv

@Kalmarv Kalmarv commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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 through ExecuteIndirect, and bind.rs falls back to the program's whole form (690–950 KB of DXIL), compiled synchronously on the title's thread. In a 600 s run on main 0829441 (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 ExecuteIndirect run 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 of dispatch_slabs, one command per piece: the root constants record_dispatch_chain sets, then the slab's group counts. Each piece then runs one ExecuteIndirect per 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, MaxCommandCount 1, 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_indirect and slab_count, with a test that slab_count matches dispatch_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 earlier ExecuteIndirect of the program needed, plus a quarter (2 to XCL_SPLIT_INDIRECT_ROUNDS, default 16).
      • When the arguments need more slabs than that, the slicer sets a predicate. The rounds are skipped, and the title's ExecuteIndirect runs the whole form instead, if it is built already.
      • If it is not built, the rounds still run. The slabs past them are lost, counted, and warned about once per program. The whole form is then built on another thread, and later ExecuteIndirects of the program get more rounds.
      • The slicer's words are read back when the allocator is reset.
      • 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.
    • 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_indirect records it the way the runtime does. dispatch_chain_divergent_forward_edges_3d compares the memory with the whole program's output and checks the slicer's slab count for:

    • one command;
    • several commands, with empty ones and a count buffer that leaves the last one out;
    • a 20-byte stride;
    • slabs of 1–12 groups and 1–16 rounds.

    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

  • Ryzen 9 9950X, RTX 5070 Ti (NVIDIA 610.74), Windows 11 build 26200, rustc 1.99.0, DXC 1.9.2609.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 (debug) on 5ca9c23 (on main 68a284a): 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 on main 68a284a too, 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. The dispatch_chain, split, execute_indirect and slab filters also ran with the D3D12 debug layer on (XCL_D3D12_DEBUG=1): 39 passed, 0 failed, 1 ignored.
  • The title, 600 s, XCL_DIRECT_DXIL=all: this branch, against a 300 s run of main 68a284a with the same environment.
    • Whole compiles on the title's threads: 1 cdb sample of 132 between 90 and 600 s (one program under 256 KB, at 508 s, about 6 thread-seconds). The main run (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.
    • Counter at 595 s: 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.
    • No slab lost or warned about, and the predicated whole form was never needed. The 28 whole ExecuteIndirects (from 499 s on) took one of the paths that keep the whole form; which one is not logged.
    • No device removal and no crash.
    • The world was not reached in 600 s on either build. What holds it now is two unsplit shadow-cascade compute programs that the driver builds one after the other on worker threads (1.39 MB and 1.58 MB of DXIL, 216 s and 211 s). This PR does not change them; Recompiler: split wave64 compute groups of several waves across dispatches #2097 splits them.
  • The title, 300 s, main 68a284a with 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).
  • Native code size: the whole form of one ray-tracing resolve program (707,256 B DXIL) has an 894,574 B driver blob (GetCachedBlob).

Regression run

scripts/smoke.ps1 -Seconds 120, the same retail title, XCL_DIRECT_DXIL=1, a private XCL cache started from the same used-pipelines.txt. The two ran one after the other on the machine under Tested, from release builds of clean trees.

main 68a284a (this PR's base):

xcl-smoke v1
commit: 68a284a596bd558b6bd9db6eedda6d6aa178c360
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 120
exit: 0x0
frames shown: 1295 (PresentX 1295)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 28407 MB

this PR, 5ca9c23:

xcl-smoke v1
commit: 5ca9c23ffd858e487b7611211492afc456fadbad
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 120
exit: 0x0
frames shown: 1295 (PresentX 1295)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 28867 MB

compute split counter 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)
  • this PR: 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 whole

The scratch is larger because a chained ExecuteIndirect takes 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

  • AMD and other GPUs; NVIDIA only.
  • In the title: count buffers, a stride other than 12, more than one command, arguments outside unified memory, the title's own predication, and the predicated whole form. The title used none of these; the GPU tests cover all but the title's own predication and arguments outside unified memory.
  • The NVIDIA limit of 512 MB of native code for pipelines in use (NVIDIA: the device is removed when the pipelines in use need more than 512 MB of shader code (0x887a0005) #2403): not measured. The pieces' native size was not paired with their program. Across the cache's chained blobs, native size is about 1.22× DXIL size for pieces and 1.27× for whole forms, so a chain should take about 1.3–1.4× its whole form's native size, by Recompiler: give each split handoff value one scratch slot and load it where it's used #2126's DXIL sizes. With this PR, a program uses its pieces and its whole form at the same time only after its arguments needed more slabs than its rounds.
  • Which path the 28 whole ExecuteIndirects took (no scratch left, bundles or another signature).

AI use

  • Claude Code with Claude Opus 5.5 wrote the code, the tests and this description, and ran the tests, the title runs and the regression run on the hardware above.

🤖 Generated with Claude Code

Kalmarv and others added 2 commits November 25, 2026 12:42
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>
@GreemSC

GreemSC commented Nov 25, 2026

Copy link
Copy Markdown

Test report on AMD / Linux (RDNA3, RADV): with #2404 + #2097 no title thread builds a whole form any more, and with XCL_PSO_WAIT_MS=50 on top the title kept presenting to the end of both 180 s runs (+85 / +88 s after the first #101, against +4 / +7 s without the PRs).

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, XCL_DIRECT_DXIL=1, A pressed every 4 s from 22 s, 180 s runs, caches as left by earlier runs. Release build of main 68a284a + #1732 (2fb4601, has #871 and #877) + #684 (e56dbc3) + #1860 (bcc71b6) + the sparse.rs part of #203 + local logging, then this PR (5ca9c23f) and #2097 (d5c2781d).

tree (2 runs each) first #101 last present after #101 title threads at the thread dumps
without #2404/#2097 96.1 / 90.8 s 100.1 / 98.3 s +4 / +7 s one in bind::execute_indirect → dispatch_chain::whole → driver_pso (whole forms, median 5.3–5.7 s each on RADV); in one run a second in pso_async::resolve_for_bind
same + XCL_PSO_WAIT_MS=50 92.5 / 90.5 s 94.4 / 92.1 s +2 / +2 s still one (then two) in dispatch_chain::whole
+ #2097 + #2404 90.9 / 68.6 s 94.3 / 96.2 s +3 / +28 s none in whole; one or two in pso_async::resolve_for_bind → build_compute
+ #2097 + #2404 + XCL_PSO_WAIT_MS=50 91.7 / 94.6 s 179.9 / 179.4 s +88 / +85 s (the runs end at 180 s) none held by XCL's compiles
  • Split counters with both PRs at 180 s: 157 programs split, 1,664 pieces; ExecuteIndirect 150 chained, 0 whole. With XCL_PSO_WAIT_MS=50 as well: 13,249 / 17,508 chained, 0 whole, 0 slabs lost.
  • No crash, no device removal in any of the 8 runs. Past #101 the last tree presents 0.5–0.6 frames per second. Peak RAM + swap 15.7 GB, right under our 16 GB cap.
  • How the stop was read: the stalled runs' thread dumps (28 frames deep) and the SYNC_GRAPH cells: two Wait64 cells (0x42437fe00/fe08) had their value recorded (0x620) but never submitted while the title thread that recorded it was in Chain::whole, so the bridged prod=qNone waits of the same runs were not the block.

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.

@pvfreis

pvfreis commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

RTX 3060 12 GB, 32 GB RAM, main 3ceb5507 + 5ca9c23 (no #2097): the whole-form stall did not occur before the title crashed at 527.7 s. One run.

Tested

  • Windows 11 26300, NVIDIA 617.14, Ryzen 9 5900XT, release; XCL_DIRECT_DXIL=1 XCL_PSO_WAIT_MS=50 XCL_COHERENT_HEAPS=0 XCL_COHERENT_MB=512 XCL_NETWORK=0. XCL cache empty, driver cache from earlier runs.
  • At 520 s: ExecuteIndirect: 8418 chained (0 of them whole, 0 slabs lost), 0 whole. From the first counted (150 s): 504,780 dispatches, 277 presents, one 2 s window without submits (470 s, two queue.Wait timeouts). Compute compiles >= 256 KB: 47, none on a title thread. Skipped console dispatches: 114,560 (524,288 ran).
  • Two earlier runs stopped in a title thread's 851 KB whole-form compile, at 213,267 dispatches (main 68a284a + a log patch) and 132,798 (0829441 + DirectStorage: read a physical-page list again when its request runs #1405 + D3D12.X: title texture reads outside the coherent window use the safe copy #751). Here its 11 pieces built on workers. Mains and caches differ: not a controlled pair.
  • Crash: 0x80000003 on 7 title threads at one address; cause unknown, not attributed to this PR. The process then did not exit (39 GiB private 88 s later) and the PC froze. Commit at equal dispatch counts was within 0.6 GB of the 68a284a run (to 213,267).
  • Free RAM under 1 GiB in 60 of 75 samples from 150 s (earlier runs: 8 and 29 of 32). Scratch peak 658 MiB (total 384; yours 654).

By reading (neither exercised here)

  1. xcl-chain-whole threads, one per program, skip the huge-build gate (xcl-pso* only). The whole is wanted even when slabs <= most_rounds(), which the next call in equal scratch fits.
  2. If bind()? fails, buffer is released with the slicer's dispatch recorded.

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.

@thiagocalile

Copy link
Copy Markdown

Independent test and smoke report for head 5ca9c23ffd858e487b7611211492afc456fadbad on an AMD Radeon RX 6600 (8 GB VRAM, RDNA2, native wave64).

Tested

  • Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64 + mesh shaders, driver 32.0.21045.29003, XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.8.2502.11.
  • XCL_ADAPTER=radeon cargo test --no-fail-fast -p xcl --lib -- split --test-threads=4: 32 passed, 0 failed, 1 ignored (0 skipped).

Regression run (scripts/smoke.ps1, release builds, XCL_ADAPTER=radeon)

main (2898511):

xcl-smoke v1
commit: 2898511af1c038a2ef809719e9b6f89e5675c422
gpu: AMD Radeon RX 6600
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1488 (PresentX 1489)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 11934 MB

PR #2404 (5ca9c23):

xcl-smoke v1
commit: 5ca9c23ffd858e487b7611211492afc456fadbad
gpu: AMD Radeon RX 6600
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1565 (PresentX 1565)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15400 MB

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.

@emirduran707

Copy link
Copy Markdown
Contributor

Independent AMD RDNA4 (native wave64) test report on exact head 5ca9c23ffd858e487b7611211492afc456fadbad (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1287 passed, 3 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests and dispatch_chain tests ran and passed.

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: 5ca9c23ffd858e487b7611211492afc456fadbad
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1607 (PresentX 1607)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13956 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.

@thehollowedone

Copy link
Copy Markdown

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. XCL_ADAPTER=RTX 3080 Ti, XCL_D3D12_DEBUG=1, XCL_NETWORK=0; offline Cargo, no sample data.

cargo test --offline --locked -p xcl --lib dispatch_chain_divergent_forward_edges_3d --jobs 6 -- --test-threads=1 --nocapture failed reproducibly on the untouched head: 0 passed, 1 failed, 0 ignored, 0 skipped. The earlier whole, split, slabbed, and non-overflow indirect cases in that fixture pass. At the first overflow fallback (threads=32, most=1, rounds=11), the slicer result matches the expected [partial=1, 0, slabs=12, 0], but the whole-form output does not appear: output word 0 remains 17 instead of 100000. This also reproduces with the D3D12 debug layer enabled. I have not established whether this is a fixture-only problem or affects runtime fallback.

Adjacent controls on the same head: cargo test --offline --locked -p xcl --lib execute_indirect --jobs 6 -- --test-threads=1 --nocapture 4 passed, 0 failed, 0 ignored, 0 skipped; cargo test --offline --locked -p xcl --lib slabs_cover_a_dispatch_once_within_their_size --jobs 6 -- --test-threads=1 --nocapture 1 passed, 0 failed, 0 ignored, 0 skipped.

Not tested: full workspace, retail title, other GPUs. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the checks and drafted this report.

@b3IKK

b3IKK commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Independent retail check on an RTX 5080 (retail 1.0.2.1, 600 s, XCL_DIRECT_DXIL=1, default wait): on a clean tree 68a284a + this PR's 2b19fec/5ca9c23 + #2097's 8524858/d5c2781, the run reports

compute split: 152 programs split, 1,413 pieces built, 159 chained dispatches issued in 1,318 slabs; ... ExecuteIndirect: 51 chained (0 of them whole, 0 slabs lost), 0 ...

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 0 whole ExecuteIndirect count is the PR working as intended.

AI use: OpenCode, Claude Fable 5.2 built the stack, ran the retail title on this machine and wrote this.

@SlopTart

Copy link
Copy Markdown

Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

gpu_ suite, cold cache: 160 passed / 4 failed. Three are the known baseline trio on this lane; the fourth is the new gpu_promoted_uav_clear_values_pass_create_committed_resource failure that current main carries (reported here), not caused by this PR. Everything else is green.
Split-program ExecuteIndirect is in the area that produced the d3d12core.dll + 0x1AB118 crashes on #2338/#2344/#2349; no crash reproduces at this head on this lane.

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.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

@b3IKK

b3IKK commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Follow-up after a second (warm) run of the same stack: the ExecuteIndirect whole forms are still 0 of them whole, 0 slabs lost (392 chained), and the split counter grew to 294 programs, 2,778 pieces. Presentation did not improve: 92 s, with 31 cold split pieces of 291–372 KB starting every 5–10 s from 6 s to 185 s. So this PR does exactly what it says — the ExecuteIndirect fallback is gone — but on this title the remaining cost is the split pieces themselves, not the whole forms. The next lever is a warm/offline precompile of those pieces (#2338's path), not the ExecuteIndirect path.

AI use: OpenCode, Claude Fable 5.2 ran the second stack run on this machine and wrote this.

gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 25, 2026
…#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)
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 25, 2026
, xcl-dev#2333, and UnadoptGuard test submits

Assisted-by: Antigravity (Gemini 4 Neon)
@ivall

ivall commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

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:

  1. The overflow fallback on the RTX 3080 Ti. @thehollowedone's report above: dispatch_chain_divergent_forward_edges_3d fails every time at the first case with more slabs than rounds. The slicer's words are right (partial 1, 12 slabs), but output word 0 stays 17, so the whole form's result is missing. It passes here on AMD RDNA4 and on your RTX 5070 Ti, so it looks driver- or card-dependent. Merging it would make that test red on such cards, and in a title the slabs past the rounds would be lost while read_back counts them as run whole. Does the predicate reach the pieces and the whole form with the same value there (did the pieces run in that case)? @thehollowedone, could you say how many words differ from the expected output, and whether it also fails with the two SetPredication calls taken out around the whole form?
  2. The command buffer on the error paths (@pvfreis's second point; I agree by reading, not reproduced). In dispatch_chain::execute_indirect, buffer is already referenced by the recorded slicer dispatch and transition when bind()? or the first compute piece lookup returns Err. It is then released while the list still uses it. It should be kept in RECORDINGS (or an equivalent) before the first call that can fail.
  3. Rebase. It conflicts with D3D12.X: keep caller allocator for untracked lists and retain whole PSOs in dispatch_chain #2333 in dispatch_chain.rs; D3D12.X: keep caller allocator for untracked lists and retain whole PSOs in dispatch_chain #2333 goes first (one test fix is pending there). The CI failure is the old a_bridged_mask_write… check, fixed on main by Tests: check divergent block barriers in a_bridged_mask_write #2420, so a rebase clears it too. #2372 would come after this one, for the cases that still need the whole form.

@pvfreis's first point (the xcl-chain-whole threads skip the huge-build gate) can be a follow-up; with #2372 the whole form would go through the PSO workers anyway.

Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug, main 06055a7 with #2097 and this PR (5ca9c23) merged locally: whole suite 1413 passed, 2 failed, 46 ignored, 7 SKIPPED; with XCL_DIRECT_DXIL=1, gpu:: hle::d3d12x 943 passed, 2 failed, 24 ignored. The two failures are fuzz_validate_and_gpu_1 and _3, the same on main here. dispatch_chain list_x::tests --test-threads=8: 10 of 10 runs pass.

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.

@upipibi

upipibi commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

@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. cargo test -p xcl --lib dispatch_chain -- --test-threads=1 at 5ca9c23 as is, 3 runs: 8 passed and 1 failed each time, dispatch_chain_divergent_forward_edges_3d at split.rs:1101, "whole form for 1 groups, 11 rounds". That is the first of the overflow cases this PR adds to the test.

How many words differ, from the assertion's left / right (400 words): 368, 368 and 360. Word 0 stays 17 (initial), where the whole form would write 100000. The words that match are all at indices that are multiples of 4 (32, 36, …, 60, 224, 228, …): 32 of them in runs 1 and 2, 40 in run 3. Which words match varies slightly between runs.

Added 20:1xZ, with the two SetPredication calls taken out. These are the calls around the whole form's ExecuteIndirect in runner.rs (the test's path, lines 1707 and 1710), as a local patch only. I ran the test alone (--exact), 3 runs each on the same card:

  • As is: fails 3 of 3. All 384 output words differ, the 16 guard words after them (0xdeadbeef) are intact, and word 0 is 17. (In the dispatch_chain filter runs above it was 368, 368 and 360.)
  • Without the two SetPredication calls: it still fails 3 of 3, now with all 400 words 0, the 16 guard words included.

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.

@treybertram06

Copy link
Copy Markdown
Contributor

Test report: #2372 and #2404 on an RTX 3080, retail title 7952987A

Summary: both PRs remove the world-load freeze on this card. With either one applied, every run then hits the silent 0x887a0005 device removal (#1452) at about 85–122 s.

Setup

Conflicts with current main

Base, 6 runs

  • Freeze: in 5 of 6 runs everything stops: presents, submits, dispatches and DirectStorage. Four froze at about 90 s and one at about 270 s. Audio keeps going until the end of the run.
  • Where it waits: thread dumps at 120, 240 and 400 s show a title thread in bind::execute_indirect → dispatch_chain::whole → Chain::whole. In 2 of the 3 dumps it is waiting; in the other it is in nvgpucomp64.dll. One dump also shows a second title thread in Chain::whole, presumably behind the build lock.
  • Device removal: 2 of 6 runs (90 s and 387 s).

#2404, 3 runs

  • Freeze: none. Log: ExecuteIndirect: 3455 chained (0 of them whole, 0 slabs lost), 37 whole, and no title thread builds a whole form.
  • Device removal: 0x887a0005 in 3 of 3 runs, at 90, 90 and 122 s. Each comes about 2 s after the first chained ExecuteIndirects, after a burst of 1-tile sparse maps.
  • Skips: the no buffer for the commands of a chained ExecuteIndirect skips come 2 ms after the removal, so they are a consequence of it.

#2372, 3 runs

  • Freeze: none. Log: whole form: 146 asked for, 146 built, 0 dispatches skipped while it was being built.
  • Device removal: 0x887a0005 in 3 of 3 runs, at 85, 90 and 94 s.

What this says
On this card the freeze has been hiding the removal: while the title waits on a whole build, it submits nothing. Once it keeps submitting, the removal comes at the next step every time. These runs can't tell whether either PR's GPU work contributes to the removal. One base run was also removed at 89.8 s, before the freeze took hold.

Not tested: AMD, other titles, and runs without XCL_UMA_SHADOW.

(Runs and report by Claude Code with Claude Opus 5.5. The commands and counts above come from these runs.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.