Skip to content

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

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

Kalmarv wants to merge 11 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

Rebased onto main b49be18. The hashes in this list are the rebased commits. Under Tested, 77cfec2, d76f773 and 809da30 are the same commits before the rebase (now 9125edb, f0cef78 and 3ca9071).

  • D3D12.X: an ExecuteIndirect of a split program runs its pieces (4aadaab):

    • gpu/recomp/pso.rs: the slicer (HLSL compiled once per device), the chain's command signature, a one-Dispatch command signature for the whole form, 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).
      • The slicer first counts the slabs. When there are more than the rounds and the whole form is built already, it leaves the rounds empty and writes the title's Dispatch arguments after its own words. The whole form then runs on them through ExecuteIndirect. Otherwise it leaves those arguments empty, so exactly one of the two has groups. The whole form's ExecuteIndirect is recorded first, and the rounds follow after a UAV barrier. Nothing is predicated: on NVIDIA Ampere cards, the predicated form of this ran the first piece in some skipped rounds and never ran the whole form. On an RTX 3080 Ti the whole form ran right after the slicer alone, but not after the pieces' ExecuteIndirects (review of this PR).
      • If the whole form 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.
      • The title's own predication also holds for the slicer, so the same choice is made under it.
      • Once the slicer is recorded, nothing returns early. If binding fails, the recording still keeps the commands buffer until the allocator is reset, with a test.
      • 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: the call site, and which command signatures are a single Dispatch.
  • Tests: a split program's ExecuteIndirect matches the whole program (dbc793d): 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;
    • each without and with a whole form built (its arguments then empty).

    With more slabs than rounds, it checks the slicer's flag and that the output matches with a whole form. That output would not match if the rounds also ran, because the whole form would then read words the pieces had already changed. Without a whole form, it checks that only the rounds' groups run.

  • D3D12.X: a chained ExecuteIndirect drops slabs only past 32 before its whole form (9125edb), in dispatch_chain.rs, after review:

    • An ExecuteIndirect of a program with none read back yet gets the most rounds: the arguments the CPU sees when recording read 0 while a title loads.
    • XCL_SPLIT_INDIRECT_ROUNDS defaults to 32, not 16.
    • The whole form is asked for at the program's first chained ExecuteIndirect. It is built on an xcl-pso thread, so a huge one waits for the huge-build gate. It is bound only on an overflow.
    • Tests for the first ExecuteIndirect's rounds and for the gate.

    In ten title runs of the earlier head 5ca9c23, six lost slabs: 158 over 73,714 chained ExecuteIndirects. All of them came from one program with 17 slabs per run: 15 at its first ExecuteIndirect (2 rounds), then 1 at each later one (16 rounds) until its whole form was built. With this commit none of them would have been lost. More than 32 slabs before the whole form is built are still lost, counted and warned about. Waiting for the whole form when recording would make it exact, but the precompile does not build the whole forms of split programs, so that is a cold 16–40 s compile on the title's thread. A follow-up records which programs a title runs as chained ExecuteIndirects, so that the precompile builds their whole forms; the runtime can then wait.

  • D3D12.X: a chained ExecuteIndirect under the title's predication is not read back (f0cef78), in dispatch_chain.rs, bind.rs and list_x.rs, after review. Under the title's predication the slicer may be skipped, and its zeroed words were then taken as a count: the program counted as measured with 0 slabs, so its next ExecuteIndirect whose arguments read 0 got 2 rounds instead of 32. Such an ExecuteIndirect is no longer read back. Tests: the device test also records one predicated and one plain ExecuteIndirect, and the list_x predication test checks the state the call reads. Reported by @thehollowedone.

  • Tests: the predicated ExecuteIndirect test binds the chain's root signature (70f687a): the device test of f0cef78 bound no root signature for the two ExecuteIndirects it records, which gave 258 messages under the debug layer with GPU-based validation (953, 744, 712). It still passed.

  • D3D12.X: once a split program's whole form is built, its last ExecuteIndirect sizes the rounds (3ca9071), in dispatch_chain.rs, with a unit test. Each round of a chained ExecuteIndirect is one barrier and one ExecuteIndirect per piece, also when empty, and on the RTX 5070 Ti such a step takes 14.4 µs of GPU time (144 µs a round for 10 pieces; measured with timestamps, review of this PR). The rounds followed the most slabs any ExecuteIndirect of the program had. Once the whole form is built, an overflow runs it, so the rounds now follow the last one read back. The cost per step comes from the barrier before an ExecuteIndirect whose signature sets root constants (0.41 µs with a Dispatch-only signature). A follow-up PR removes the root constants from the pieces' ExecuteIndirects.

  • Tests: the chained ExecuteIndirect device test binds descriptor heaps (0755bd7): under GPU-based validation the device test gave 4 errors (1419) at 809da30. Its bind set the chain's root signature, which indexes the descriptor heaps directly, on a list without heaps. It now sets two shader-visible heaps first, as a title's list has them.

  • D3D12.X: a chained ExecuteIndirect takes on a list the pool does not track (50205bc), in alloc_pool.rs and dispatch_chain.rs, with a unit test.

  • D3D12.X: a list made or released at an address drops the chain scratch (073f8ea), in dispatch_chain.rs and list_x.rs, with a unit test. The chains of one recording share one scratch, found by the list's address. Addresses are reused (D3D12.X: a direct list at a released compute list's heap vtable address gets the compute list's methods #2588): a list created where a released one was could share the old list's scratch with work the GPU may still be running. list_x now forgets the entry when a list is created and when it is released.

  • D3D12.X: a PC allocator put aside lets go of its chain recordings once free (551a75e), in alloc_pool.rs, with three unit tests.

    • When the title resets an allocator whose recordings are still held or on the GPU, the pool puts the PC allocator aside and gives the title another. The one put aside was reset, and its chain recordings released, only when the same title allocator reused it, which may never happen.
    • Every title Reset now also releases the recordings of each PC allocator put aside that nothing holds any more: no list records on it and its submits are done.
    • Found by @dhillonjagdeep650-boop. On an RTX 3080 Ti, recordings went from 1 at 80 s to 1,887 under 48 allocators at 110 s, and local and non-local video memory grew about 150 MB/s each until a removal. The pool's line said 119 made, 119 put aside.
    • @Royalflamejlh traced the same leak independently (7181244718): a put-aside allocator keeps its recordings until a later Reset of the same title allocator takes it back. D3D12.X: reclaim idle put-aside allocators and retire orphaned batches #2138's reclaim_idle_in resets idle put-aside allocators, except a title's own allocator once put aside, and in their run that case held 2,258 of 11,061 recordings at 170 s. Their candidate, Royalflamejlh/xcl@f4608d7, differs from this commit:
  • D3D12.X: a title thread does not wait behind a background whole build's turn (97a70a7), in pso_async.rs and dispatch_chain.rs, with a unit test, after review (@pvfreis, review). want_whole builds the whole form on an xcl-pso* thread, so a huge one waits in big_compile_turn for a background slot and 3 GB of free commit, holding Chain::build_whole, and nothing told it a title thread waited. A title thread that needed the same form (bind.rs, or dispatch without scratch) waited behind that turn, without the wanted cap or the commit skip. Now such a thread counts itself in Chain::waiting while it waits, and the background build runs in pso_async::build_waited_on, so build_is_wanted is true on its thread while one does: the build goes as one the title waits for.

999 changed lines (984 added), over the ~400 target: 121 are the GPU test and its runner, about 330 are unit tests, and 52 are the slicer's HLSL. The runtime part cannot be split further without leaving a commit whose ExecuteIndirect path runs nothing or is not called. The last four commits fix how this PR's own recordings are kept and how its own background build of the whole form waits, so they go with it.

Tested

  • Ryzen 9 9950X, RTX 5070 Ti (NVIDIA 610.74), Windows 11 build 26200, rustc 1.99.0, DXC 1.9.2609.
  • On 97a70a7, on the GPU (debug):
    • cargo test --workspace --no-fail-fast -- --test-threads=4: 1445 passed, 0 failed, 47 ignored (the new test among them). 25 SKIPPED notices, as on 551a75e below.
    • The new a_title_thread_does_not_wait_behind_a_background_whole_build_waiting_for_its_turn, three runs: 1 passed each. With the count left out (Chain::waiting not raised, as on 551a75e): failed, "the title thread waited for the background build's turn" (still waiting after 5 s).
    • The dispatch_chain unit tests, --test-threads=1: 7 passed. The dispatch_chain, split, execute_indirect and slab filters, --test-threads=1: 48 passed, 0 failed, 1 ignored, 1 SKIPPED (dispatch_chain_native_wave64_builds_whole, no wave64). pso_async and big_compile: 25 passed.
  • On 551a75e (rebased onto main b49be18), on the GPU (debug):
    • cargo test --workspace --no-fail-fast -- --test-threads=4: 1444 passed, 0 failed, 47 ignored. 25 SKIPPED notices: 21 for no native wave64 on this card, three per-lane FP16 forms the per-lane lowering refuses, and no heap windows. a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, which failed on 68a284a and d76f773, passes on this base.
    • The dispatch_chain unit tests, --test-threads=1: 6 passed, 0 failed.
    • The dispatch_chain, split, execute_indirect and slab filters, --test-threads=1: 47 passed, 0 failed, 1 ignored. 1 SKIPPED: dispatch_chain_native_wave64_builds_whole (no wave64).
    • list_x: 41 passed. alloc_pool: 8 passed (the four new tests among them).
    • The same filters with the debug layer and GPU-based validation, --nocapture, on the local build described below: 47 passed, 0 failed, 1 ignored. During the tests: 1 error, 884, from main's split_compute_program_prebuilds_and_caches_chain_pieces, which feeds the driver a deliberately invalid blob; and 275 warnings, 1328 and 926 as below. The device test's 4 errors (1419) at 809da30 are gone.
    • Without the GPU: cargo check -p xcl --lib --tests builds each of 50205bc, 073f8ea and 551a75e. The first of 551a75e's tests failed with the release taken out ("a free allocator put aside still held its chain recordings"; run on an earlier version of the same commit, with the same test and release), and passes with it.
  • On 551a75e, on an RTX 2060 (NVIDIA 595.91) under Wine (wine-staging 11.21) + vkd3d-proton 30b0eb9, a release windows-gnu test build, --test-threads=1, no XCL_D3D12_DEBUG or GPU-based validation set; correctness only: the dispatch_chain unit tests 6 passed; the dispatch_chain, split, execute_indirect and slab filters 47 passed, 0 failed, 1 ignored, SKIPPED dispatch_chain_native_wave64_builds_whole (no wave64); list_x 41 passed; alloc_pool 8 passed.
  • Tested by others, on this PR's head 97a70a7: @LocranKing, RTX 3060 Ti 8 GB (NVIDIA 621.40), Ryzen 5 5500, Windows 11 build 26300, rustc 1.100.0, debug (review). cargo test --workspace --no-fail-fast -- --test-threads=4: 1445 passed, 0 failed, 47 ignored, 27 SKIPPED: 21 no wave64, 3 per-lane FP16/FP32 forms, no heap windows, and two 0x887A002D (texture_states's uploads_start_from_each_subresources_state, no D3D12 debug layer; shaders's pso_measurement_compiles_an_exact_synthetic_record, no Developer Mode). Those two are main's tests of files this PR does not change. A 60 s smoke on their own title, from release builds: main b49be18 1409 frames, peak commit 14,032 MB; 97a70a7 1567 frames, 14,026 MB; no device removal or crash. It covers boot, intro and menus, not the world.
  • Tested by others, of their own change, not of this PR's head: @Royalflamejlh's Royalflamejlh/xcl@f4608d7 (put-aside allocators reset at the title's Reset once their GPU work is done), on this PR at 77cfec2 with D3D12.X: keep caller allocator for untracked lists and retain whole PSOs in dispatch_chain #2333 (RTX 4060 Ti 16 GB, Linux, Wine + vkd3d-proton, 1 run each; review). Recordings held went from 11,061 under 156 allocators at 170 s to 3,316–5,563 under 59–82 allocators between 120 and 200 s, and non-local video memory from 8.7 GB at 169 s to 7.1 GB at 166 s. Their memory guard still stopped that run at 204.5 s for low system RAM.
  • On 77cfec2, d76f773 and 809da30, without the GPU:
    • cargo build --release -p xcl: builds on each. Its 2 warnings are deprecations in files this PR does not change (real.rs:3797, xgameruntime/mod.rs:547).
    • cargo clippy -p xcl --lib --tests: no warning on a line this PR changes, on each. It stops at 3 approx_constant errors (6.283_185_3 for TAU) in lower_valu.rs, lower_wide.rs and recomp/lower.rs, which this PR does not touch.
    • cargo test -p xcl --lib on the unit tests of the chain that need no GPU: 4 passed, 0 failed on each (slab_count against dispatch_slabs, the bounded scratch, the first ExecuteIndirect's rounds, the gate). On d76f773 and 809da30 also set_predication_buffer_state_transitions_and_lifecycle, and on 809da30 once_the_whole_form_is_built_the_last_execute_indirect_sizes_the_rounds: 1 passed each.
    • Not cargo fmt: the tree is not rustfmt-clean. The changed lines follow the code around them.
  • On d76f773, on the GPU (debug):
    • dispatch_chain_divergent_forward_edges_3d --test-threads=1, three runs: 1 passed, 0 failed each.
    • The dispatch_chain unit tests, --test-threads=1: 4 passed, 0 failed (the device test included).
    • The dispatch_chain, split, execute_indirect and slab filters with XCL_D3D12_DEBUG=1, --test-threads=4: 42 passed, 0 failed, 1 ignored. 1 SKIPPED: dispatch_chain_native_wave64_builds_whole (no wave64).
    • cargo test --workspace --no-fail-fast -- --test-threads=4: 1292 passed, 1 failed, 46 ignored. Failed: gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, as on 5ca9c23 and main 68a284a (below). 25 SKIPPED notices, as below.
    • The same filters with the debug layer and GPU-based validation, --nocapture, on a local build of the test runner that switches GPU-based validation on and prints every layer message (neither is an XCL option): 42 passed, 0 failed, 1 ignored. The messages printed during the tests showed 258 errors (953, 744, 712), all from the device test added in d76f773; 54a936a fixes that test. Also 266 warnings: 1328 (a buffer's initial state ignored) and 926 (a root view's address in a heap).
  • On 809da30, on the GPU (debug):
    • dispatch_chain_divergent_forward_edges_3d --test-threads=1, three runs: 1 passed, 0 failed each.
    • The dispatch_chain unit tests, --test-threads=1: 5 passed, 0 failed.
    • The dispatch_chain, split, execute_indirect and slab filters with XCL_D3D12_DEBUG=1, --test-threads=4: 43 passed, 0 failed, 1 ignored. 1 SKIPPED: dispatch_chain_native_wave64_builds_whole (no wave64).
    • The same filters with the debug layer and GPU-based validation, --nocapture, on the same local build (GPU-based validation and the messages are switched on there, not by an XCL option): 43 passed, 0 failed, 1 ignored. During the tests: 273 warnings, 1328 and 926 as above, and 4 errors, all 1419 and all from the device test: its bind sets the chain's root signature on a list without descriptor heaps (a title's list has them). No other test gave an error.
  • On the earlier, predicated head 5ca9c23 (on main 68a284a): cargo test --workspace --no-fail-fast -- --test-threads=4 (debug): 1289 passed, 1 failed, 46 ignored. Failed: gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, which fails on main 68a284a too, with the same assertion and output (lower_dxil.rs:1155); 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. An earlier version of this description gave the filters with XCL_D3D12_DEBUG=1 as a debug-layer pass. The runner registers no message callback, so such a run shows no layer messages; it showed nothing.
  • The two title runs below are of 5ca9c23. In them no ExecuteIndirect needed more slabs than its rounds.
  • 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 whole form in place of the rounds 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 60, the same retail title, XCL_DIRECT_DXIL=1, a private XCL cache started from the same used-pipelines.txt. Both ran back to back in one queue job on the machine under Tested, from release builds of clean trees, after earlier runs on the same route had warmed its driver cache. That job ran in the queue's title lane, beside 3 to 4 other jobs (builds, suites or precompiles; no other title run or timing job runs at the same time there).

main b49be18 (this PR's base):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1446 (PresentX 1446)
presents per 2 s (last 3): 61 60 59
device removals: 0
crashes: 0
peak commit: 14491 MB

this PR, 97a70a7:

xcl-smoke v1
commit: 97a70a73c96ee39cadffe1baafbc6725091277f6
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1570 (PresentX 1570)
presents per 2 s (last 3): 59 60 59
device removals: 0
crashes: 0
peak commit: 16372 MB

compute split counter at the end of each run:

  • main: compute split: 11 programs split, 72 pieces built, 0 chained dispatches issued in 0 slabs; scratch 0 MiB (most 0, largest dispatch 0 in one slab)
  • this PR: compute split: 11 programs split, 72 pieces built, 0 chained dispatches issued in 0 slabs; scratch 0 MiB (most 0, largest dispatch 0 in one slab); ExecuteIndirect: 0 chained (0 of them whole, 0 slabs lost), 0 whole

Neither side of this 60 s pair reaches a chained ExecuteIndirect. 551a75e alone, 120 s, same setup, in an earlier title-lane job beside other jobs (no main side: our harness failed it), reaches 6: 1324 frames, peak commit 30,050 MB, 0 device removals, 0 crashes, and the counter compute split: 92 programs split, 935 pieces built, 51 chained dispatches issued in 51 slabs; scratch 390 MiB (most 390, largest dispatch 9 in one slab); ExecuteIndirect: 6 chained (0 of them whole, 0 slabs lost), 0 whole.

Its scratch is 390 MiB 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

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

@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

Added for 97a70a7 (2026-11-26)

On an RTX 3060 12 GB, the PR run recorded 177 chained ExecuteIndirect calls, with zero whole-form executions or lost slabs. It compiled no whole forms and resumed presenting after a roughly 33 s stall. On main, title threads compiled whole forms from 126.5 s until the stop. Non-local video memory rose by about 1 GB after the early put-off bursts in both runs.

Tested

  • One release xcl run per build on an RTX 3060 12 GB with 31.9 GB RAM. main b49be183 + PR head 97a70a73 was built as b4bd408fe. The b49be183 baseline was built as 2f421655c. Each has one local logging line. Both runs started with an empty XCL cache and used the same scripted input and XCL_DIRECT_DXIL=1 XCL_COHERENT_HEAPS=0 XCL_COHERENT_MB=512 XCL_PSO_WAIT_MS=50 XCL_PSO_TRACE=1 XCL_NETWORK=0 XCL_ACTIVITY=1.
  • With this PR. The 37 GiB private-memory guard stopped the run at 192 s. The first chained dispatches and ExecuteIndirect calls appeared in the 140 s split line. At 190 s, 17 programs had been split and 594 dispatches chained. The log read ExecuteIndirect: 177 chained (0 of them whole, 0 slabs lost), 0 whole. The largest compute compile was 509 KB of DXIL.
  • The log counted 54, 111, 112, 138, 328 and 583 recordings held at 140, 150, 160, 170, 180 and 190 s. The count at 170 s matched all 117 chained dispatches and 21 chained ExecuteIndirect calls. At 190 s it was 583 of 771, with 40 PC allocator entries, including empty ones. Of the held recordings, 158 were ExecuteIndirect calls with 2 MiB of command buffers total. The pool logged 84 allocators made and 84 put aside at 170 s, then 409 made and 408 put aside at 190 s.
  • From about 135 to 168 s there were no presents and 0–5 submits per 2 s. Afterwards there were 0–2 presents and 5–56 submits per 2 s. By 188 s, 17,328 dispatches had followed the first chained ExecuteIndirect. Put-off dispatches #4096 and #8192 appeared at 173.8 and 183.5 s.
  • At 168, 170, 180 and 190 s, process commit was 30,550, 31,023, 33,858 and 37,459 MB, local video memory was 14,889, 14,977, 15,427 and 15,654 MB, and non-local video memory was 2,243, 2,398, 4,044 and 6,668 MB. From 170 to 190 s, non-local video memory rose by 214 MB/s and commit by 322 MB/s. The logged scratch (480 MiB at 190 s, 486 MiB peak) and 2 MiB of command buffers are far smaller than the late increase.
  • Without this PR. The 210 s time limit stopped the run. Put-off bursts #64–#1024 appeared at 111.7–112.2 s and #2048 at 116.2 s. Non-local video memory was 1,129 MB at 110 s, 1,378 at 112 s, 1,661 at 114 s, 1,880 at 118 s and 2,061 at 130 s. Commit rose from 27,691 to 30,000 MB. After 130 s, non-local video memory stayed within 2,063–2,073 MB and commit within 30,150–31,297 MB. With the PR, those bursts appeared at 133.5–134.9 s and 148.8 s, with non-local video memory rising from 1,142 to 2,184 MB and commit from 27,794 to 30,196 MB between 134 and 150 s.
  • On main, presenting stopped at 112 s and submits stayed at 0–2 per 2 s from 114 s. At the stop there were 956 dispatches after the first chained dispatch, with 106 chained dispatches and 106 recordings held since 130 s. Title threads started whole forms of three split programs (859, 899 and 943 KB of DXIL). Two compiled at 126.5–149.6 s and 149.6–182.4 s on a thread that issued ExecuteIndirect calls. The third started at 182.5 s on the PresentX thread and was still building at the stop.
  • The writes after the GPU … (fence at 5, wanted 6; 1 writes) warning appeared once on main, at 136.2 s. With the PR, the first warning was at 158.5 s, and the counter reached 64 by 187.2 s. The older 5ca9c23 run logged none.

The single run per build leaves open what drove the late 4.3 GB rise in non-local video memory, why the PR run stalled from 135 to 168 s, and whether main would show a similar rise if it resumed presenting.

Not tested

Rendered picture, the suite at 97a70a7, debug builds or AMD.

AI use

Claude Code (Claude Opus 5.5) ran the tests and drafted the report. Claude Fable 5.2 rechecked it. OpenAI Codex (GPT-6, exact serving variant unavailable) checked the live PR and applied the edits.


Added for 77cfec2 (2026-11-25): RTX 3060 12 GB (Ampere), dispatch_chain lib tests, one process per run: 5ca9c23 failed 3 of 3, 77cfec2 passed 10 of 10. Not run at d76f773, which leaves split.rs, pso.rs and runner.rs unchanged but changes one of the 12 tests (bind failure).

  • NVIDIA 617.14, Rust 1.100.0; non-interactive session, Low integrity, debug, --test-threads=1 (suite: 4), 32-lane waves only. Both unrebased; our hook in lib.rs repeats the runs, crates/xcl/tests left out.
  • 5ca9c23: 8 passed, 1 failed each: dispatch_chain_divergent_forward_edges_3d, split.rs:1101, 352, 384, 384 of 400 words differ. 77cfec2: 12 passed each. Both: dispatch_chain_native_wave64_builds_whole SKIPPED every run.
  • Suite: 77cfec2 merged onto e1d84b7 1425/1/46 (passed/failed/ignored), main e1d84b7 1422/1/46; same failure (e2e.rs:249, presents) and 25 SKIPPED.

Not tested: title, debug layer, wave64, AMD.

AI use: Claude Code; Claude Opus 5.5 ran and wrote this, a second Claude Opus 5.5 checked it against the logs, Claude Fable 5.2 reviewed the text.


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

Update: this report covers 5ca9c23 only. On 809da30 the same card passes: #2404 (comment) (13 passed, 0 failed, 3 processes); razormontana's RTX 3070 also passes there, including a run with the D3D12 debug layer: #2404 (comment).

@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 (384 output words plus 16 guard words): in runs 1 and 2, 16 output words hold the expected 100000+i (indices 32-60 and 224-252, every 4th), and in run 3, 24 do (also 256-284). All the other output words still hold their initial value (index + 17), and the 16 guard words are intact. Word 0 stays 17.

Added 20:13Z, corrected 20:50Z. Run alone (--exact) on this card, the output words that got their expected value: 0, 0 and 0 in three runs without the debug layer; 0, 8, 0, 56, 0, 0 and 8 in seven runs with XCL_D3D12_DEBUG=1. All other output words kept their initial value and the 16 guard words were intact every time. In those runs the device was not removed (GetDeviceRemovedReason S_OK, every fence completed), and the debug layer, with its messages captured through an info-queue callback, logged no errors, only a CreateCommittedResource initial-state warning.

With the two SetPredication calls taken out, the read-back buffer is all zero. Withdrawn: as @thehollowedone found, the pieces' own predicate (pso.rs:1387) stays set through the read-back copy, so that result shows the copy being skipped, not what the shaders wrote.

(Edited 20:20Z: corrected the counts above. I had first counted the 16 guard words as matching output words, and the time of the addition was a placeholder.)

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.)

@thehollowedone

thehollowedone commented Nov 25, 2026 •

Copy link
Copy Markdown

For the requested RTX 3080 Ti overflow check on #2404 head 5ca9c23: the unmodified dispatch_chain_divergent_forward_edges_3d failed in four single-threaded runs at the first overflow case (split 32, 1 group per slab, 11 rounds). Of 400 compared words, 376, 368, 360, and 328 differed. The 16 guard words stayed intact. The slicer tail assertion passed ([1, 0, 12, 0]). In those runs 8, 16, 24, and 56 output words changed from their initial values to the expected values, all at indices divisible by four; the other output words remained at their initial values. That shows some compute output, but the readback alone cannot establish which dispatch wrote it or whether the pieces and whole form observed the same predicate.

I then removed only the two SetPredication calls around the whole-form ExecuteIndirect in the test runner (runner.rs, lines 1707 and 1710), leaving the chain call, the whole-form ExecuteIndirect, and its command arguments in place. It still failed in three of three runs: all 400 readback words were zero, including the guards. This matches the separate RTX 3070 observation above. The edit was diagnostic only and is not proposed as a fix.

Windows 11 build 26300, NVIDIA RTX 3080 Ti / 621.35, Rust 1.99.1; cargo test --offline --locked -p xcl --lib dispatch_chain_divergent_forward_edges_3d --jobs 6 -- --test-threads=1 --nocapture. Each run: 0 passed, 1 failed, 0 ignored. Synthetic fixture only; no retail run for this check. AI-assisted: Codex (GPT-6, exact variant unavailable) made the local diagnostic edit, ran the tests, and drafted this report.

Update after predicate-isolation controls (same head and GPU): The two-call deletion above left the chain's earlier SetPredication active through the final CopyBufferRegion. Since D3D12 also predicates copies, the all-zero readback cannot establish what the shaders wrote. That experiment still fails, but its output should not be read as zero shader output.

  • Replacing only the first whole-form SetPredication with SetPredication(NULL) (keeping the final clear, the piece chain, and whole ExecuteIndirect) still failed in four runs: 344, 352, 384, and 336 of 400 words differed; the guard words stayed intact. Clearing the predicate before the fallback alone does not make this fixture pass.
  • Keeping the slicer, chain predicate setup, scratch binding, whole-form ExecuteIndirect and readback, but omitting the piece ExecuteIndirect loop only when a whole form is available, made the complete dispatch_chain_divergent_forward_edges_3d test pass (1/1, both 32- and 64-thread fixtures). This is a diagnostic control, not a proposed runtime behavior: it skips work that normal calls need.
  • The unmodified test still failed with XCL_D3D12_DEBUG=1. I queried the D3D12 InfoQueue after each synthetic dispatch: it recorded routine buffer initial-state warnings, but no error or corruption messages. This was the standard debug layer, not GPU-based validation.

These controls narrow the failing path to the piece indirect-command sequence before the fallback. They do not establish whether the cause is command recording, synchronization, or a driver interaction. All edits stayed in the scratch test worktree; no retail run or PR patch was made.

@bmjask bmjask left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: valid ExecuteIndirect work is knowingly truncated when slab count exceeds rounds and no whole form is ready. dispatch_chain.rs:337-355 leaves full=None unless chain.whole already exists, but still records only rounds chain commands. The new test at split.rs:1102-1107 explicitly accepts partial output for that first call. A later background-built whole form does not make the initial valid dispatch correct. Under title predication, full is forced None even when built and feedback is disabled, so over-limit predicated calls are permanently truncated. Please fall back to the original whole ExecuteIndirect whenever complete chain coverage cannot be guaranteed, including predicated cases.

@dhillonjagdeep650-boop

Copy link
Copy Markdown

@Royalflamejlh @Kalmarv The same on Windows with an RTX 3080 Ti: on today's main the put-off ExecuteIndirects run whole, and #2333's resolve_allocator in execute_indirect makes them chain, but then their recordings pile up. One run per row.

Setup: RTX 3080 Ti 12 GB (driver 617.42), Ryzen 7 5800X, 48 GB RAM, Windows 11 Pro 26300, release; retail 1.0.2.1, scripted A, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_COHERENT_MB=512 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PSO_WAIT_MS=50 XCL_DEFER_PRIVATE_HOME_TILES=1 XCL_DRED=1 XCL_NETWORK=0, compute pipelines prebuilt with the same build. Tree: main e1d84b7 + this PR at d76f773 + #751, #684, #2097, #1803, #2229, #2384 (switch off), #1975, #1182, #1916. A guard of mine ends a run above 11.8 GB local.

run tree ExecuteIndirect at the end result
e13 as above 2 chained, 19 whole no present after 76 s; whole forms of 0.7-1.1 MB DXIL compiled 12-22 s each on a title thread to the end of 420 s
e14 + #2333 (a7b93a8), and execute_indirect takes resolve_allocator 2846 chained, 0 whole (120 s) presents on, but local and non-local video memory grow about 150 MB/s each from 82 s (local 6.3 -> 11.9 GB, non-local 1.7 -> 6.8 GB, commit 23 -> 35 GB) with texture pools, arenas and sparse pools flat; guard at 129 s
e15 e14 + one log line of what RECORDINGS holds 2104 chained, 0 whole (110 s) recordings held: 1 at 80 s, 671 under 17 allocators at 90 s, 1064 under 26 at 100 s, 1887 under 48 at 110 s, 1470 of them chained ExecuteIndirects; then 0x887a0005 at 110.8 s, DRED with no page fault and no breadcrumbs (#2403's kind)

So with resolve_allocator the chained ExecuteIndirects' recordings (scratch plus the CUSTOM write-back commands buffer) are mostly not released 10-20 s later, which fits the growth in both kinds of memory. Why they are not released I have not shown. A lead from alloc_pool's own line: in e14, 128 title allocator resets made 119 new PC allocators ("119 made, 119 put aside"), against 503 made for 4 096 resets in e12. dispatch_chain::allocator_reset runs for a put-aside allocator only when it is reset for reuse, so recordings filed under backings that are never free again stay. Whether the backings of the segments list_x replays put-off calls on are never marked done is my guess, not checked. In e12 (main 2898511, before #2118, this PR at 5ca9c23) the same title ran 420 s with 47 623 chained and 7.7 GB local peak.

Not tested: #2333 without my execute_indirect change; this PR at 809da30; the removal's cause (one run).

AI use: Claude Code with Claude Opus 5.5 merged the tree, made the change and the log line, ran the scripts and wrote this.

Kalmarv and others added 2 commits November 25, 2026 21:07
…track

With the allocator pool on, `execute_indirect` kept the recording with the
PC allocator the list records on (`alloc_pool::recording_backing`). For a
list the pool does not track it got 0, so it returned Ok(false) and the
ExecuteIndirect ran its whole form. XCL makes such lists itself: a mid-list
split's next list is created on `alloc_pool::current(alloc)` with no
`created_on`. Under Wine + vkd3d-proton on an RTX 4060 Ti, this branch
chained 2 ExecuteIndirects and ran 26-30 whole in three runs of a title,
and the title presented nothing after its loading burst. In a fourth run
with a log line, all 32 that declined did so for this reason.

Such a list is now taken on by the pool, on the PC allocator the title's
allocator stands for, which is the one the list was made on
(`alloc_pool::recording_backing_or_take_on`), and the recording is kept
there. xcl-dev#2333 keeps these recordings with the title's allocator instead
(its `resolve_allocator`). The pool then knows nothing of the list, so it
can take that allocator for free and release the recordings (scratch and
commands buffer) while the list still records or runs on the GPU. Taken
on, the list keeps its backing busy until it is reset elsewhere or
released, and its submits mark the backing like any other list's.

The title's allocator also gets the list's type, so that a Reset while
the list holds its backing swaps it like the title's own lists.

Reported by @Royalflamejlh (xcl-dev#2404). With xcl-dev#2333 merged under this branch
and its fallback in `execute_indirect`, every ExecuteIndirect chained in
four runs (22 to 70,341 of them, 0 whole).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The chains of one recording share one scratch, which `dispatch_chain`
finds by the list's address (`SHARED`). Only a list's Reset forgot it.
Addresses are reused (xcl-dev#2588). A list created at the address of a
released one, on the same allocator while the old recordings were still
held, found the old list's scratch and shared it with work the GPU may
still be running. A chained ExecuteIndirect takes its scratch the same
way. `list_x` now forgets the entry when a list is created and when it
is released, with a unit test that fails without the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e free

A chained ExecuteIndirect keeps its slicer scratch and commands buffer
with the recording of its PC allocator until that allocator is reset
(dispatch_chain::allocator_reset, from reset_pc_allocator) or released.
When the title resets an allocator whose recording is still held or on
the GPU, alloc_pool puts the PC allocator aside and gives the title
another. The one put aside is reset only when the same title allocator
is reset again and reuses it, which may never happen. Until then its
recordings, and the memory they keep, stay.

dhillonjagdeep650-boop found it on an RTX 3080 Ti (xcl-dev#2404): 1,887
recordings under 48 allocators at 110 s, local and non-local memory
growing about 150 MB/s, then a device removal at 110.8 s. The allocator
log said 119 made and 119 put aside.

Every title Reset now also releases the recordings of each PC allocator
put aside that nothing holds any more: no list records on it and its
submits are done. This happens outside the pool's lock.
allocator_reset of an allocator without recordings does nothing, and
the allocator is reset as before when it is reused.

This relies on every chained recording being filed with the PC
allocator its list records on, and on that list being known to the pool
(an earlier commit here takes on the lists it had not seen). A recording
filed with a title's allocator, as xcl-dev#2333's lines file one, would go when
that allocator is free, while its list still records or runs on the GPU
elsewhere.

The first test fails without the sweep: the free allocator put aside still
holds its recordings after another title allocator's Reset. Two more
show that a taken-on list's recording stays while the list records on
its allocator put aside and while its submit runs, and goes after both;
and that a free title allocator put aside does not take a live list's
recording with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DavidM1911

Copy link
Copy Markdown
Contributor

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

Royalflamejlh added a commit to Royalflamejlh/xcl that referenced this pull request Nov 26, 2026
A title allocator's backing that is still busy at the title's Reset is
put aside, and another takes its place. A put-aside backing was reset
only when a later Reset of the same title allocator found the current
one busy and took it back; until then it kept what was recorded on it:
its command memory and the recordings of split compute dispatches on it
(`dispatch_chain::allocator_reset`), with their scratch and, with
xcl-dev#2404, each chained ExecuteIndirect's command buffer.

At a title Reset, each put-aside backing of that allocator that was
used since its last reset and whose GPU work is done is now reset.

With xcl-dev#2404 and xcl-dev#2333 on Linux (RTX 4060 Ti, 1 run each), the split
recordings held went from 672 to 11,061 under 156 allocators in 100 s
of frames; with this change they stayed between 3,316 and 5,563 under
59 to 82 allocators from 120 to 200 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Royalflamejlh

Copy link
Copy Markdown
Contributor

@dhillonjagdeep650-boop a put-aside PC allocator keeps what was recorded on it until a later Reset of the same title allocator takes it back, which happens only when the one in use is busy at that Reset (title_reset_in); dispatch_chain::allocator_reset runs only at a PC allocator's reset or last release. The line your "119 made, 119 put aside" comes from counts only such Resets: in our run without the change it read 116 made, 116 put aside at 128 of them (79 s), and 655 and 655 at 2,048 (130 s). #2138 resets idle put-aside allocators, at most every 500 ms at a title Reset, except a title's own allocator once put aside (reclaim_idle_in, f == title_alloc); in our run that case held 2,258 of the 11,061 recordings at 170 s.

Setup: the tree, kit and switches of our comment above (RTX 4060 Ti 16 GB, Linux; this PR at 77cfec2 with #2333 and resolve_allocator in execute_indirect), a warm shader cache, and a log line of what RECORDINGS holds; 1 run each.

without with put-aside allocators reset at the title's Reset once the GPU is done with them (first #101 7 s later)
recordings held 672 at 70 s, 11,061 under 156 allocators at 170 s 3,316 to 5,563 under 59 to 82 allocators, 120 to 200 s
non-local video memory 8.7 GB at 169 s 7.1 GB at 166 s, 8.1 GB at 204 s

Not tested: #2138 in this case; this PR at 809da30; Windows; your guess about the backings of list_x's segments.

AI use: Claude Code (Claude Opus 5.5) read the code, made the change and the log line, ran the Linux runs through a script, and wrote this.

Posted without review by a person: the account owner was away and reads replies later.

@Kalmarv

Kalmarv commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@dhillonjagdeep650-boop thank you for e13–e15 (7179803338). Your lead was right, and there was a second half to it. Both are fixed in 551a75e (pushed, rebased onto main b49be18):

Unit tests show both. Our machine can't show the growth: this title chains 2 to 6 ExecuteIndirects in 120 s here, against your 2,846. Could you rerun e14/e15 on 551a75e, with the same setup but without #2333's execute_indirect change? That is the RTX 3080 Ti, release, scripted A, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_COHERENT_MB=512 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PSO_WAIT_MS=50 XCL_DEFER_PRIVATE_HOME_TILES=1 XCL_DRED=1 XCL_NETWORK=0, compute pipelines prebuilt with the same build, and your other PRs if they still merge. What would answer it:

  • your RECORDINGS line over time;
  • local and non-local video memory from 80 s on;
  • the compute split line's ExecuteIndirect counts;
  • the pool's allocator resets so far … (N made, M put aside now) line. If made still climbs with the resets, a list taken on is holding its allocator, which is the case I could not rule out.

@Royalflamejlh thank you for 7181244718: the same trace, and the title_alloc case #2138 leaves out (2,258 of your 11,061). 551a75e covers that case: a title's own allocator, once put aside, is one of the allocators the release looks at, and one of its tests is that case. How it differs from your f4608d7:

The PR body cites your numbers as a run of your change, not of this head. Could you rerun your case on 551a75e, with the same kit and switches but without #2333's resolve_allocator in execute_indirect (this branch no longer needs it)? The RECORDINGS line and non-local memory over time would answer it. If RAM still runs out, the pool's N made, M put aside line would say whether the allocators' own command memory is the other part that grows.

AI use: Claude Code with Claude Opus 5.5 found the cause in the code, wrote the fix and its tests, ran them, and wrote this.

@pvfreis

pvfreis commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

By reading only, not run, at 551a75e5: both points are fixed.

  • 2: nothing returns between record_slicer and the push (dispatch_chain.rs:402-418): bind()'s result is kept, the recording holding buffer goes into RECORDINGS either way, and checked is false on a failed bind (:417), so read_back skips it (:182).
  • 1: the whole form builds on xcl-pso-chain-whole (:102), which driver_compile_identified gates by name (real.rs:4047).
  • A side effect of 1: Chain::whole holds build_whole while it waits for its turn (:81-83), and that thread is never wanted (pso_async.rs:56: BUILDING is set only on the workers). A title thread that needs the same whole form meanwhile (bind.rs:370, dispatch_chain.rs:326) blocks on the mutex, so it waits for a free slot and at least 3 GB of free commit (real.rs:4097, no timeout) before the compile starts, where on main it compiled at once. big_compile_turn lets a build the title waits for skip the commit wait and use the wanted cap; this one gets neither. Only for a whole form of 256 KB or more with no cached blob. Not measured.

AI use: Claude Code (Claude Opus 5.5) checked this; Claude Fable 5.2 rechecked it; checked by a person before posting.

…'s turn

`want_whole` builds a split program's whole form on `xcl-pso-chain-whole`, an `xcl-pso*` thread,
so a huge one waits in `big_compile_turn` for a background slot and 3 GB of free commit, with no
timeout. It waits holding `Chain::build_whole`, and nothing on that thread says a title thread
waits for it (`pso_async::build_is_wanted` reads only a worker's build). So a title thread that
needs the same whole form meanwhile (`bind.rs` for an ExecuteIndirect it cannot chain,
`dispatch` without scratch) blocked on the mutex until the background turn came. It got neither
the wanted cap nor the commit skip of a build the title waits for, where before `want_whole` it
compiled at once (found by @pvfreis in the review of xcl-dev#2404).

A title thread now counts itself in `Chain::waiting` while it waits for the whole form, and
`want_whole`'s build runs in `pso_async::build_waited_on`, so `build_is_wanted` is true on that
thread while one does. The background build then goes as one the title waits for, and the title
thread gets the form when it is built. The test fills the background slots, starts the build and
asks for the form on another thread: without the count it waited until the slots were freed
("the title thread waited for the background build's turn").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kalmarv

Kalmarv commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@pvfreis thank you for reading 551a75e (7181852695), and for the side effect of the background build. It was real: a title thread that needed the whole form waited on build_whole behind a background build that was never wanted. 97a70a7 fixes it:

  • A title thread that needs the whole form counts itself on the chain while it waits (Chain::waiting).
  • want_whole's build runs in pso_async::build_waited_on, so build_is_wanted is true on its thread while that count is above 0. big_compile_turn checks it at every look, so as soon as a title thread waits, the build gets the wanted cap and skips the commit wait, like a worker's build the title waits for. The title thread then gets the form that build makes.
  • The new test, a_title_thread_does_not_wait_behind_a_background_whole_build_waiting_for_its_turn, fills the background slots, starts the background build of a huge whole form and asks for the form from another thread. With the count left out, as on 551a75e, it failed: the title thread was still waiting after 5 s. With it, it passed in 3 of 3 runs.

The results are in the description.

AI use: Claude Code with Claude Opus 5.5 wrote the fix, its test and this reply, and ran the tests.

Kalmarv added a commit to Kalmarv/xcl that referenced this pull request Nov 26, 2026
A chained ExecuteIndirect records, per round and piece, a UAV barrier, the piece's pipeline
and an ExecuteIndirect whose command signature sets the eight root constants of the slab. On
an RTX 5070 Ti (NVIDIA 610.74) such an ExecuteIndirect after the barrier takes 15.3 us of GPU
time, empty or not: 32 rounds of 10 pieces are 4.9 ms, every time (xcl-dev#2404). With a Dispatch-only
signature it takes 0.41 us; a barrier only to the scratch does not help (15.3 us).

The pieces read only the slab's size and origin (`split.rs`, `Slab::new`), the same for every
piece of a round. So the chain's root signature takes them as a root CBV (b0 space2, the
register the pieces already read) instead of root constants, and the pieces do not change:
- ExecuteIndirect: the slicer writes one 256-byte command a round (the slab's constants, its
  Dispatch 32 bytes in) instead of one 44-byte command per piece; the CPU points the CBV at the
  round's command, and the pieces' ExecuteIndirects take the Dispatch-only signature. The buffer
  for 32 rounds is 8 KiB, whatever the pieces.
- Dispatch: the CPU writes the slabs' constants into 64 KiB upload-heap blocks of the list's
  allocator, used again once it is reset; without one the whole form runs, as without scratch.

Measured on the RTX 5070 Ti, GPU timestamps, 16 rounds x 10 pieces, median per piece step:
  ExecuteIndirect, root constants (before)       15.3 us empty, 15.6 us with one group
  ExecuteIndirect, root CBV, Dispatch-only        0.41 us empty,  1.01 us with one group
  Dispatch, root constants (before)               0.25 us empty,  0.61 us with one group
  Dispatch, root CBV in the upload heap           0.25 us empty,  0.61 us with one group

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LocranKing

Copy link
Copy Markdown

Independent NVIDIA test report on exact head 97a70a73c96ee39cadffe1baafbc6725091277f6 (clean detached checkout, no local changes).

Tested

  • Hardware: NVIDIA GeForce RTX 3060 Ti 8 GB (Ampere, wave32, driver 32.0.16.2140 / 621.40), AMD Ryzen 5 5500, 32 GB RAM, Windows 11 Home (build 26300), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100.0.
  • cargo build --workspace + cargo test --workspace --no-fail-fast -- --test-threads=4 (debug): 1445 passed, 0 failed, 47 ignored (xcl --lib: 1319 passed, 0 failed, 27 ignored).
  • 27 SKIPPED GPU tests on this adapter: 21 wave64-only (no wave64), 3 wave32 per-lane f16/f32 semantics, 1 no heap windows, 1 no D3D12 debug layer (0x887A002D), 1 cannot disable driver cache without Developer Mode (0x887A002D).

Regression run
scripts/smoke.ps1 -Seconds 60, release builds of origin/main (b49be18) and this PR's head (97a70a7):

main:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 3060 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1409 (PresentX 1409)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14032 MB

PR:

xcl-smoke v1
commit: 97a70a73c96ee39cadffe1baafbc6725091277f6
gpu: NVIDIA GeForce RTX 3060 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1567 (PresentX 1567)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14026 MB

Not tested

  • AMD / Intel / Linux GPUs; XCL_SAMPLE_* tests; the 60 s smoke run covers boot/intro/menus and does not enter the 3D world.

AI use

  • Antigravity (Gemini 4 Hydrogen) ran the builds, test suite, and smoke.ps1 commands on this machine and drafted this report from the captured outputs.

@Kalmarv

Kalmarv commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@LocranKing thank you for the run on 97a70a7 (7182924347): the whole suite on an RTX 3060 Ti, and the main/head smoke pair. It is in the description under Tested, with your note that the smoke covers boot, intro and menus. Your two 0x887A002D skips are main's tests (texture_states's debug-layer test and shaders's --measure-pso test, which needs Developer Mode), not this PR's.

AI use: Claude Code with Claude Opus 5.5 read the report and the tests and wrote this reply.

@futurepro62

Copy link
Copy Markdown

NVIDIA and AMD full-suite run, to go with the reports above by LocranKing, pvfreis, upipibi, since none of them covers AMD. Tested exact head 97a70a73 (on its base b49be18).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1433 passed, 0 failed, 45 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, dispatch_chain_native_wave64_builds_whole, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: a_list_the_pool_has_not_seen_is_taken_on_with_the_pc_allocator_it_records_on, a_free_allocator_put_aside_lets_go_of_its_chain_recordings_at_the_next_title_reset, a_taken_on_lists_chain_recording_stays_until_it_moves_on_and_its_submit_is_done, a_free_title_allocator_put_aside_does_not_take_a_live_lists_chain_recording_with_it, a_list_at_a_released_lists_address_starts_without_its_chain_scratch, a_programs_first_execute_indirect_gets_the_most_rounds, once_the_whole_form_is_built_the_last_execute_indirect_sizes_the_rounds, the_whole_form_built_in_the_background_waits_for_a_huge_compiles_turn, a_chained_execute_indirect_keeps_its_commands_when_binding_fails, a_title_thread_does_not_wait_behind_a_background_whole_build_waiting_for_its_turn.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1444 passed, 0 failed, 47 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main b49be183 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (Tests: heap_window_out_of_memory_falls_back_to_the_switch_form fails under XCL_REQUIRE_GPU=mesh (opt-in skip counted as missing coverage) #1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

@Royalflamejlh

Copy link
Copy Markdown
Contributor

On Linux + NVIDIA without #2333, 97a70a7 presented after the title's burst in 3 of 3 runs and chained every split ExecuteIndirect, but lost slabs in 2. In those runs non-local video memory grew from 4.1 to 12.3–13.9 GB, and our memory guard stopped two of them; this PR's own command buffers and chain scratch held 1.3 GB at 270 s in run 3. From the same caches, the tree without this PR presented nothing after 76 s in 2 of 2 runs, with a title thread compiling a whole form in Chain::whole in all four dumps.

Setup: the machine, kit and switches of our comment above (7178119858), 300 s; first-run screens completed once, no story progress; main b49be18 + #684, #751, #1599, #1860, #2082, with and without this PR. Every run started from a fresh copy of the same caches: NVIDIA's as two earlier runs left it, one of each tree.

run tree presents after 90 s (2 s windows with one) ExecuteIndirect at the end non-local video memory, start → end least available RAM end
1 this PR 38 (21) 15,299 chained, 0 whole, 40 slabs lost 4,129 → 12,341 MB 4 GB our memory guard (low RAM), 213.7 s
2 this PR, + a count line 69 (38) 32,861 chained, 0 whole, 0 slabs lost 4,129 → 13,879 MB 5 GB 300 s
3 this PR, + a count line 82 (41) 35,755 chained, 0 whole, 20 slabs lost 4,129 → 13,536 MB 4 GB our memory guard (low RAM), 272.6 s
4 without 0 – 4,129 → 4,146 MB 20 GB 300 s
5 without 0 – 4,129 → 4,146 MB 26 GB 300 s
– this PR: 2 runs that another title run joined – – – – our memory guard at 100.8 and 115.6 s; left out
  • In runs 1 and 3 one program lost 20 of 22 slabs at 193 s, before its whole form was built: had 22 slabs for 2 rounds: 20 lost (warned once per program; in run 1 the counter reached 40 by 200 s). By slabs_before and indirect_rounds (dispatch_chain.rs:376, :365), 2 rounds means its earlier ones had read back at most 1 slab, so 9125edb's 32 rounds held only until the program's first read-back.
  • On your request (7181303913), from run 3: recordings held 385 at 90 s, 1,705 at 150 s, 5,222 at 210 s and 7,410 under 115 allocators at 270 s, 2,297 of them under an allocator the pool had swapped out; at 270 s, 370 MiB of chained ExecuteIndirect command buffers and 937 MiB of chain scratch (62–72 MiB without this PR). The pool's made still climbed with the resets: 115 at 128, 324 at 512, 709 at 2,048 (261.6 s), all put aside.
  • Read: each program's whole form gets an OS thread of its own (dispatch_chain.rs:103); at 280 s in run 2, 199 of 200 waited for a compile turn. Is that meant?

Not tested: Windows; 551a75e from the same caches.

AI use: Claude Code (Claude Opus 5.5) merged the trees, added two logging-only count lines, made the runs, read the logs and the code, and wrote this.

Posted without review by a person: the account owner was away and reads replies later.

@KDenKC

KDenKC commented Nov 26, 2026 •

Copy link
Copy Markdown

Windows + NVIDIA data on 97a70a7: allocators are still put aside about 1:1 with those made. This answers the Windows NVIDIA question. The numbers come from runs we already had, not new ones.

RTX 5090 32 GB (driver 621.24), Ryzen 7 9800X3D, Windows 11, release, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0, the retail title. Two builds:

The alloc_pool line (N made, M put aside now, logged at power-of-two reset counts):

run build last line before the end end
1 base 32 made, 32 put aside at 128.9 s (32 resets) #2403 heap removal 0x887a0005 at 131.4 s
2 base (warm-up) 31 made, 31 put aside at 141.3 s #2403 removal at 141.5 s
3 + tail release 381 / 381 at 164.2 s, 549 / 549 at 182.8 s (2,048 resets) device hung at 228.4 s (see below)
4 + tail release, XCL_DRED=1 570 / 569 at 164.7 s, 710 / 709 at 439.8 s (4,096 resets) #2403 removal at 465.5 s
  • In every run, the allocators put aside stayed within one of those made, so almost none were taken again. They grew with the resets until the run ended.
  • These builds do not log a RECORDINGS count, so I can't tell you whether 551a75e let go of the recordings on those allocators, only that the allocators themselves were not reused.
  • Non-local VRAM peaked at about 2.9 GB (run 4, 440 s). On a 32 GB card that is probably not the limit the smaller cards hit.
  • slabs lost stayed 0, and the overflow whole form (of them whole) stayed 0, in all runs.

On your heads-up in #2403 (7181669291): thanks, all three points are right about the main-based version. The version we ran above is stacked on 97a70a7:

  • Point 1: the tail is released only after a successful whole build (build_whole_form, which want_whole also calls).
  • Point 2: once the whole form is ready, a chained ExecuteIndirect returns early, and the caller binds the whole form. When the tail is still taken, the recording holds its own Arc of it.
  • Point 3: Chain::tail is an Option<Arc<…>> that the release only detaches, so recordings still on the GPU keep the pieces until their allocator resets.

So if this goes ahead, it will be on top of #2404, and you won't need to rebase. I'm not opening it yet: run 3 ended in a device hang (0x887a0006, two nvlddmkm resets at 222.5 and 224.3 s), and two reruns with DRED did not reproduce it. The tail release does not line up with the hang (the last release was 17 s before it), but I want a cause before asking anyone to review it.

As ever, your loyal testing minion and their 5090, reporting for allocator duty.

AI use: Gemini (Antigravity) extracted the log tables and checked the three points against our commits. Claude Code (Claude Opus 5.5) checked the log lines and the alloc_pool code at 97a70a7 and wrote this.

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.