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

Open
github-bot wants to merge 14 commits from github-bot/gh-2404 into main AGit
Owner

@⁠Kalmarv on GitHub · 2026-11-25 17:53 UTC · original
Kalmarv:chain-indirect → main · +1127 −15 · 9 files · 14 commits · open

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.

    • With the allocator pool on, a list the pool did not track got no allocator, so its ExecuteIndirect ran the whole form. XCL makes such lists itself: a mid-list split's next list is created on the PC allocator the title's allocator stands for, and the pool is not told.
    • Such a list is now taken on by the pool, on that PC allocator, and the chained recording is kept there. The allocator stays busy until the list is reset elsewhere or released, and the list's submits mark it like any other list's.
    • This replaces #2333's fallback filing for chained ExecuteIndirects. #2333 keeps such a recording with the title's allocator, which the pool knows nothing of. So the pool can take that allocator for free, and the recording (scratch and commands buffer) is then released while the list still records or runs on the GPU, i.e. memory freed under the GPU. So this PR will not take #2333's resolve_allocator for ExecuteIndirect; dispatch stays #2333's.
    • Reported by @⁠Royalflamejlh: all 32 ExecuteIndirects that declined in a run did so for this reason.
  • 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 (#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. #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:
      • f4608d7 resets (PC Reset) a put-aside allocator, which frees its command memory as well, but only at a Reset of the same title allocator, and only one that was submitted and is done. This commit releases only the chain recordings (scratch and commands buffer), at any title Reset. The allocator itself is still reset when it is reused (or by #2138).
      • This commit counts an allocator as free only when no list records on it and its submits are done. With 50205bc, that covers the lists the pool had not seen, which f4608d7 (on #2333's filing) does not, so the release cannot free a recording under a live list.
      • The title's own allocator once put aside, the case #2138 leaves out, is covered here: it is one of the put-aside allocators the release looks at. The last of the three tests is that case.
  • 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.

  • D3D12.X: the split-program counter line says what holds chain recordings (99ca688), in alloc_pool.rs and dispatch_chain.rs, with a unit test. Logging only. Every 10 s, with the compute split line, a second line splits the recordings held by the PC allocator they are under: compute split: N of M recordings held, under K PC allocators: put aside with a list on it …, put aside with submits on the GPU …, put aside and free …; in use and busy …, in use and free …; not the pool's … (M: all recordings made). In @⁠pvfreis's and @⁠Royalflamejlh's runs of 97a70a7 the recordings held kept rising (583 of 771 at 190 s, review; 7,410 under 115 allocators at 270 s, only 2,297 of them under ones put aside, review). This line says what holds them; the runs here do not reach that part of the title.

  • D3D12.X: whole forms of split programs are built in turn, not a thread each (c9904d7), in dispatch_chain.rs, with a unit test, after review (@⁠Royalflamejlh). want_whole started an OS thread for each whole form, and each waited for its turn in big_compile_turn: at 280 s, 199 of 200 such threads were waiting. The whole forms now queue in three lanes, one for each slot set of driver_compile (under 256 KiB, huge, giant). A lane has at most one thread, which builds its forms one after another and ends when its queue is empty. A form whose program was released before its turn is not built. A title thread that needs a whole form still builds it itself.

  • D3D12.X: a chained ExecuteIndirect keeps the most rounds until the whole form is built (5b9d4ff), in dispatch_chain.rs, with its unit test changed, after review (@⁠Royalflamejlh). 9125edb's 32 rounds held only until a program's first read-back. After it, the most slabs read back set the rounds, so a program whose earlier ExecuteIndirects had 1 slab got 2 rounds, and its next one, of 22 slabs, lost 20 (2 of 3 runs in that review). Until the whole form is built, a chained ExecuteIndirect now records XCL_SPLIT_INDIRECT_ROUNDS (32) rounds whatever was read back. Once it is built, the last one read back sizes them, as with 3ca9071. The cost is the empty rounds until the whole form is built (14.4 µs per piece step on the RTX 5070 Ti, as under 3ca9071; #2633 makes that step 0.41 µs).

1142 changed lines (1127 added), over the ~400 target: 121 are the GPU test and its runner, about 390 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 seven commits fix how this PR's own recordings are kept, how its own background builds of the whole form wait and are run, and how many rounds it records before one is built, or count what holds its recordings, 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 5b9d4ff (this head), on the GPU (debug):
    • cargo test --workspace --no-fail-fast -- --test-threads=4: 1447 passed, 0 failed, 47 ignored (the two new tests among them). 25 SKIPPED notices, as on 551a75e below.
    • The dispatch_chain and alloc_pool unit tests, --test-threads=1: 21 passed.
    • The dispatch_chain, split, execute_indirect and slab filters with the debug layer and GPU-based validation, --nocapture, on the local build described below, --test-threads=1: 50 passed, 0 failed, 1 ignored. 1 SKIPPED: dispatch_chain_native_wave64_builds_whole (no wave64). During the tests: 1 error, 884, from main's split_compute_program_prebuilds_and_caches_chain_pieces (a deliberately invalid blob); 275 warnings, 195 of 1328 and 80 of 926, as on 551a75e.
    • Without the GPU, each against the code before it (--test-threads=1): the_recordings_held_are_split_by_what_holds_their_allocator, whole_forms_wanted_together_are_built_one_after_another_on_one_thread and once_the_whole_form_is_built_the_last_execute_indirect_sizes_the_rounds: 1 passed each. With InTurn::push starting a thread for each item, as want_whole did: failed, 5 threads for 5 whole forms. With 97a70a7's rounds: failed, 2 rounds, not 32, after a read-back of 1 slab.
  • 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, on 97a70a7: @⁠pvfreis, RTX 3060 12 GB, 31.9 GB RAM, one release run each of 97a70a7 and main b49be18 from an empty cache, both with one local logging line (review). With this PR: 177 chained ExecuteIndirects, 0 whole, 0 slabs lost, no whole forms compiled, presenting again after a stall of about 33 s; recordings held rose from 54 at 140 s to 583 of 771 at 190 s, and their 37 GiB guard stopped the run at 192 s, with commit +322 MB/s and non-local video memory +214 MB/s over 170–190 s. On main, title threads compiled whole forms from 126.5 s to the 210 s limit and presenting stopped at 112 s. What holds the recordings is open; 99ca688's line is for that.
  • Tested by others, on 97a70a7: @⁠Royalflamejlh, Linux + NVIDIA, 300 s runs from the same caches (review). With this PR: presenting after the title's burst in 3 of 3 runs, 15,299–35,755 chained ExecuteIndirects, 0 whole; 20 slabs lost in 2 runs (5b9d4ff above); non-local video memory 4.1 → 12.3–13.9 GB, their memory guard stopped 2 of 3. Without it: no presents after 76 s in 2 of 2, a title thread compiling a whole form in all four dumps.
  • Tested by others, on 97a70a7 + #2551: @⁠KDenKC, RTX 5090 32 GB (NVIDIA 621.24), Windows 11, release (review): 0 slabs lost and 0 whole in 4 runs; the pool's PC allocators made kept growing with the resets (to 549 by 183 s, 710 by 440 s). Their runs ended in #2403's removals and one device hang they are still looking into.
  • Tested by others, on this PR's head 5b9d4ff: @⁠thehollowedone, RTX 3080 Ti (NVIDIA 621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 (review). cargo test --workspace --no-fail-fast -- --test-threads=4: 1447 passed, 0 failed, 47 ignored, 25 SKIPPED. dispatch_chain_divergent_forward_edges_3d, --test-threads=1: 1 passed, no SKIPPED notice, the 32- and 64-thread cases on the card. Synthetic tests only, no title run.
  • Tested by others, on 97a70a7 (this PR's previous head): @⁠jennydeth, RTX 3060 12 GB (NVIDIA 32.0.16.2101), Ryzen 5 5600X, Windows 11, rustc 1.100.0, release (review). cargo test --workspace --release --no-fail-fast -- --test-threads=4: 1445 passed, 0 failed, 47 ignored, 29 SKIPPED (21 no wave64, 3 per-lane FP16/FP32 forms, 3 no D3D12 debug layer, no heap windows, and pso_measurement_compiles_an_exact_synthetic_record). A 600 s smoke pair with default settings: main b49be18 2171 frames, peak commit 35,030 MB; 97a70a7 2211 frames, 36,162 MB; no device removal or crash. No program is split with default settings, so this pair does not reach this PR's code. With XCL_DIRECT_DXIL=1 (900 s, warm driver cache), one run of 97a70a7 logged 397 chained ExecuteIndirects, 0 whole, 0 slabs lost. Every direct run ended in a 0x887a0005 removal (DRED: page fault at VA 0x0) between 99 and 115 s, main's run too, as in #2403, so the removal is not from this PR.
  • 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 #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 #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; #2097 splits them.
  • The title, 300 s, main 68a284a with this PR and #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. That job ran in the queue's title lane, beside 2 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: 1228 (PresentX 1228)
presents per 2 s (last 3): 4 19 9
device removals: 0
crashes: 0
peak commit: 26156 MB

this PR, 5b9d4ff:

xcl-smoke v1
commit: 5b9d4ff6f5f4a2142c3c633bb1e0d700f6be5e22
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1231 (PresentX 1231)
presents per 2 s (last 3): 0 28 6
device removals: 0
crashes: 0
peak commit: 26117 MB

compute split counter at the end of each run:

  • main: compute split: 171 programs split, 1811 pieces built, 0 chained dispatches issued in 0 slabs; scratch 0 MiB (most 0, largest dispatch 0 in one slab)
  • this PR: compute split: 171 programs split, 1811 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

  • What 97a70a7 changes in a title: the wait it removes was found by reading the code, and the runs here reach no title thread waiting for a whole form.
  • What holds the recordings that kept rising in @⁠pvfreis's and @⁠Royalflamejlh's runs of 97a70a7 (above), and whether 551a75e stopped the growth @⁠dhillonjagdeep650-boop saw (review). Two 240 s runs of 97a70a7 here, one from an empty cache and one from our seeded cache, both with @⁠pvfreis's switches, issued 0 chained dispatches and held 0 recordings, so this card does not show it. 99ca688's line is for a run that does; I asked for one each.
  • The cost of 5b9d4ff's empty rounds before a whole form is built, in a title.
  • A list the pool takes on keeps its PC allocator busy until it is reset elsewhere or released. If one is never reset or released, that allocator is never free again.
  • A chained Dispatch on a list the pool does not track still runs whole; that is #2333's.
  • Calls put off to the submit (#2118) with bounded waits (XCL_PSO_WAIT_MS), the path of #2617. This PR does not change whether a call is put off, or skipped there. It changes what a put-off ExecuteIndirect of a split program records at the submit (its chain, on the segment). The Reset of a list's own allocator there (record_deferred, reset_own_alloc) now also releases the recordings of free allocators put aside. #2617's hang is on main without this PR (RDNA2); none of our runs of this PR set XCL_PSO_WAIT_MS.
  • AMD and other GPUs; only NVIDIA Blackwell here. NVIDIA Ampere: the GPU test failed with the earlier, predicated version on four Ampere cards (testers in the review). At 77cfec2 and at this head 5b9d4ff it passed on an RTX 3080 Ti (review, review). At 809da30 it passed on an RTX 3080 (review) and on two RTX 3070s (review, review). The RTX 3070 Laptop is not confirmed, and we have no Ampere card.
  • 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 whole form in place of the rounds. 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 (#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 #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** on GitHub · 2026-11-25 17:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404) `Kalmarv:chain-indirect` → `main` · +1127 −15 · 9 files · 14 commits · open 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 `ExecuteIndirect`s 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' `ExecuteIndirect`s (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 `ExecuteIndirect`s 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 `ExecuteIndirect`s. - `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 `ExecuteIndirect`s. 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 `ExecuteIndirect`s, 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 `ExecuteIndirect`s 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' `ExecuteIndirect`s. - `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. - With the allocator pool on, a list the pool did not track got no allocator, so its `ExecuteIndirect` ran the whole form. XCL makes such lists itself: a mid-list split's next list is created on the PC allocator the title's allocator stands for, and the pool is not told. - Such a list is now taken on by the pool, on that PC allocator, and the chained recording is kept there. The allocator stays busy until the list is reset elsewhere or released, and the list's submits mark it like any other list's. - This replaces #2333's fallback filing for chained `ExecuteIndirect`s. #2333 keeps such a recording with the title's allocator, which the pool knows nothing of. So the pool can take that allocator for free, and the recording (scratch and commands buffer) is then released while the list still records or runs on the GPU, i.e. memory freed under the GPU. So this PR will not take #2333's `resolve_allocator` for `ExecuteIndirect`; `dispatch` stays #2333's. - Reported by @⁠Royalflamejlh: all 32 `ExecuteIndirect`s that declined in a run did so for this reason. - `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 (#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. #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: - f4608d7 resets (PC `Reset`) a put-aside allocator, which frees its command memory as well, but only at a Reset of the same title allocator, and only one that was submitted and is done. This commit releases only the chain recordings (scratch and commands buffer), at any title Reset. The allocator itself is still reset when it is reused (or by #2138). - This commit counts an allocator as free only when no list records on it and its submits are done. With `50205bc`, that covers the lists the pool had not seen, which f4608d7 (on #2333's filing) does not, so the release cannot free a recording under a live list. - The title's own allocator once put aside, the case #2138 leaves out, is covered here: it is one of the put-aside allocators the release looks at. The last of the three tests is that case. - `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](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404)). `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. - `D3D12.X: the split-program counter line says what holds chain recordings` (`99ca688`), in `alloc_pool.rs` and `dispatch_chain.rs`, with a unit test. Logging only. Every 10 s, with the `compute split` line, a second line splits the recordings held by the PC allocator they are under: `compute split: N of M recordings held, under K PC allocators: put aside with a list on it …, put aside with submits on the GPU …, put aside and free …; in use and busy …, in use and free …; not the pool's …` (M: all recordings made). In @⁠pvfreis's and @⁠Royalflamejlh's runs of `97a70a7` the recordings held kept rising (583 of 771 at 190 s, [review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404); 7,410 under 115 allocators at 270 s, only 2,297 of them under ones put aside, [review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404)). This line says what holds them; the runs here do not reach that part of the title. - `D3D12.X: whole forms of split programs are built in turn, not a thread each` (`c9904d7`), in `dispatch_chain.rs`, with a unit test, after review (@⁠Royalflamejlh). `want_whole` started an OS thread for each whole form, and each waited for its turn in `big_compile_turn`: at 280 s, 199 of 200 such threads were waiting. The whole forms now queue in three lanes, one for each slot set of `driver_compile` (under 256 KiB, huge, giant). A lane has at most one thread, which builds its forms one after another and ends when its queue is empty. A form whose program was released before its turn is not built. A title thread that needs a whole form still builds it itself. - `D3D12.X: a chained ExecuteIndirect keeps the most rounds until the whole form is built` (`5b9d4ff`), in `dispatch_chain.rs`, with its unit test changed, after review (@⁠Royalflamejlh). `9125edb`'s 32 rounds held only until a program's first read-back. After it, the most slabs read back set the rounds, so a program whose earlier `ExecuteIndirect`s had 1 slab got 2 rounds, and its next one, of 22 slabs, lost 20 (2 of 3 runs in that review). Until the whole form is built, a chained `ExecuteIndirect` now records `XCL_SPLIT_INDIRECT_ROUNDS` (32) rounds whatever was read back. Once it is built, the last one read back sizes them, as with `3ca9071`. The cost is the empty rounds until the whole form is built (14.4 µs per piece step on the RTX 5070 Ti, as under `3ca9071`; #2633 makes that step 0.41 µs). 1142 changed lines (1127 added), over the ~400 target: 121 are the GPU test and its runner, about 390 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 seven commits fix how this PR's own recordings are kept, how its own background builds of the whole form wait and are run, and how many rounds it records before one is built, or count what holds its recordings, 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 `5b9d4ff` (this head), on the GPU (debug): - `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1447 passed, 0 failed, 47 ignored (the two new tests among them). 25 SKIPPED notices, as on `551a75e` below. - The `dispatch_chain` and `alloc_pool` unit tests, `--test-threads=1`: 21 passed. - The `dispatch_chain`, `split`, `execute_indirect` and `slab` filters with the debug layer and GPU-based validation, `--nocapture`, on the local build described below, `--test-threads=1`: 50 passed, 0 failed, 1 ignored. 1 SKIPPED: `dispatch_chain_native_wave64_builds_whole` (no wave64). During the tests: 1 error, 884, from `main`'s `split_compute_program_prebuilds_and_caches_chain_pieces` (a deliberately invalid blob); 275 warnings, 195 of 1328 and 80 of 926, as on `551a75e`. - Without the GPU, each against the code before it (`--test-threads=1`): `the_recordings_held_are_split_by_what_holds_their_allocator`, `whole_forms_wanted_together_are_built_one_after_another_on_one_thread` and `once_the_whole_form_is_built_the_last_execute_indirect_sizes_the_rounds`: 1 passed each. With `InTurn::push` starting a thread for each item, as `want_whole` did: failed, 5 threads for 5 whole forms. With `97a70a7`'s rounds: failed, 2 rounds, not 32, after a read-back of 1 slab. - 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](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404)). `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, on `97a70a7`: @⁠pvfreis, RTX 3060 12 GB, 31.9 GB RAM, one release run each of `97a70a7` and `main` `b49be18` from an empty cache, both with one local logging line ([review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404)). With this PR: 177 chained `ExecuteIndirect`s, 0 whole, 0 slabs lost, no whole forms compiled, presenting again after a stall of about 33 s; recordings held rose from 54 at 140 s to 583 of 771 at 190 s, and their 37 GiB guard stopped the run at 192 s, with commit +322 MB/s and non-local video memory +214 MB/s over 170–190 s. On `main`, title threads compiled whole forms from 126.5 s to the 210 s limit and presenting stopped at 112 s. What holds the recordings is open; `99ca688`'s line is for that. - Tested by others, on `97a70a7`: @⁠Royalflamejlh, Linux + NVIDIA, 300 s runs from the same caches ([review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404)). With this PR: presenting after the title's burst in 3 of 3 runs, 15,299–35,755 chained `ExecuteIndirect`s, 0 whole; 20 slabs lost in 2 runs (`5b9d4ff` above); non-local video memory 4.1 → 12.3–13.9 GB, their memory guard stopped 2 of 3. Without it: no presents after 76 s in 2 of 2, a title thread compiling a whole form in all four dumps. - Tested by others, on `97a70a7` + #2551: @⁠KDenKC, RTX 5090 32 GB (NVIDIA 621.24), Windows 11, release ([review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404)): 0 slabs lost and 0 whole in 4 runs; the pool's PC allocators made kept growing with the resets (to 549 by 183 s, 710 by 440 s). Their runs ended in #2403's removals and one device hang they are still looking into. - Tested by others, on this PR's head `5b9d4ff`: @⁠thehollowedone, RTX 3080 Ti (NVIDIA 621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 ([review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404)). `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1447 passed, 0 failed, 47 ignored, 25 SKIPPED. `dispatch_chain_divergent_forward_edges_3d`, `--test-threads=1`: 1 passed, no SKIPPED notice, the 32- and 64-thread cases on the card. Synthetic tests only, no title run. - Tested by others, on `97a70a7` (this PR's previous head): @⁠jennydeth, RTX 3060 12 GB (NVIDIA 32.0.16.2101), Ryzen 5 5600X, Windows 11, rustc 1.100.0, release ([review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404)). `cargo test --workspace --release --no-fail-fast -- --test-threads=4`: 1445 passed, 0 failed, 47 ignored, 29 SKIPPED (21 no wave64, 3 per-lane FP16/FP32 forms, 3 no D3D12 debug layer, no heap windows, and `pso_measurement_compiles_an_exact_synthetic_record`). A 600 s smoke pair with default settings: `main` `b49be18` 2171 frames, peak commit 35,030 MB; `97a70a7` 2211 frames, 36,162 MB; no device removal or crash. No program is split with default settings, so this pair does not reach this PR's code. With `XCL_DIRECT_DXIL=1` (900 s, warm driver cache), one run of `97a70a7` logged 397 chained `ExecuteIndirect`s, 0 whole, 0 slabs lost. Every direct run ended in a `0x887a0005` removal (DRED: page fault at VA 0x0) between 99 and 115 s, `main`'s run too, as in #2403, so the removal is not from this PR. - 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 #2333 (RTX 4060 Ti 16 GB, Linux, Wine + vkd3d-proton, 1 run each; [review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404)). 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 #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 `ExecuteIndirect`s (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; #2097 splits them. - **The title, 300 s, `main` `68a284a` with this PR and #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](https://git.gtahub.st/github/xcl-dev--xcl/issues/505)). - 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. That job ran in the queue's title lane, beside 2 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: 1228 (PresentX 1228) presents per 2 s (last 3): 4 19 9 device removals: 0 crashes: 0 peak commit: 26156 MB ``` this PR, `5b9d4ff`: ``` xcl-smoke v1 commit: 5b9d4ff6f5f4a2142c3c633bb1e0d700f6be5e22 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1231 (PresentX 1231) presents per 2 s (last 3): 0 28 6 device removals: 0 crashes: 0 peak commit: 26117 MB ``` `compute split` counter at the end of each run: - `main`: `compute split: 171 programs split, 1811 pieces built, 0 chained dispatches issued in 0 slabs; scratch 0 MiB (most 0, largest dispatch 0 in one slab)` - this PR: `compute split: 171 programs split, 1811 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** - What `97a70a7` changes in a title: the wait it removes was found by reading the code, and the runs here reach no title thread waiting for a whole form. - What holds the recordings that kept rising in @⁠pvfreis's and @⁠Royalflamejlh's runs of `97a70a7` (above), and whether `551a75e` stopped the growth @⁠dhillonjagdeep650-boop saw ([review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404)). Two 240 s runs of `97a70a7` here, one from an empty cache and one from our seeded cache, both with @⁠pvfreis's switches, issued 0 chained dispatches and held 0 recordings, so this card does not show it. `99ca688`'s line is for a run that does; I asked for one each. - The cost of `5b9d4ff`'s empty rounds before a whole form is built, in a title. - A list the pool takes on keeps its PC allocator busy until it is reset elsewhere or released. If one is never reset or released, that allocator is never free again. - A chained `Dispatch` on a list the pool does not track still runs whole; that is #2333's. - Calls put off to the submit (#2118) with bounded waits (`XCL_PSO_WAIT_MS`), the path of #2617. This PR does not change whether a call is put off, or skipped there. It changes what a put-off `ExecuteIndirect` of a split program records at the submit (its chain, on the segment). The Reset of a list's own allocator there (`record_deferred`, `reset_own_alloc`) now also releases the recordings of free allocators put aside. #2617's hang is on `main` without this PR (RDNA2); none of our runs of this PR set `XCL_PSO_WAIT_MS`. - AMD and other GPUs; only NVIDIA Blackwell here. NVIDIA Ampere: the GPU test failed with the earlier, predicated version on four Ampere cards (testers in the review). At `77cfec2` and at this head `5b9d4ff` it passed on an RTX 3080 Ti ([review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404), [review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404)). At `809da30` it passed on an RTX 3080 ([review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404)) and on two RTX 3070s ([review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404), [review](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404)). The RTX 3070 Laptop is not confirmed, and we have no Ampere card. - 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 whole form in place of the rounds. 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 (#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 #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 `ExecuteIndirect`s 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](https://claude.com/claude-code)
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 and
the whole form is built already, the slicer leaves the rounds empty and
writes the title's Dispatch arguments after them, and the whole form runs
on those through a command signature of one Dispatch; otherwise it leaves
those empty. So one of the two runs, without predication: under one
predicate, two NVIDIA Ampere cards (RTX 3080 Ti, RTX 3070) ran some of
the rounds and not the whole form (#2404). The whole form's
ExecuteIndirect is recorded first, and the rounds' UAV barriers follow
it: on the RTX 3080 Ti it ran right after the slicer alone but not
after the pieces' ExecuteIndirects. If the whole form is not
built, 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. The title's own
predication holds for the slicer too, so the same choice is made under
it. 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 <[email protected]>
runner::dispatch_split_indirect records a chain's ExecuteIndirect the way
the runtime does: the slicer, the whole form on the slicer's arguments
when there is one, then the rounds' ExecuteIndirects.
dispatch_chain_divergent_forward_edges_3d runs it with one command,
several with empty commands and a count buffer that leaves the last out,
and a stride of 20 bytes, in slabs of 1 to 12 groups and 1 to 16 rounds,
each without and with a whole form. It checks the memory against the
whole program and the slicer's slab count. With more slabs than rounds
it checks that the slicer says so and that the whole form runs instead
(the memory would not match if the rounds had run too). Without a whole
form it checks that only the rounds' groups run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A chained ExecuteIndirect whose arguments have more slabs than its
rounds runs the program's whole form instead, but only when that form is
built already. Until then the slabs past the rounds are lost, counted and
warned about. Across ten title runs of the earlier version, 158 slabs were
lost in six, in 73,714 chained ExecuteIndirects. In each run it was one
program with 17 slabs: 15 at its first ExecuteIndirect, whose arguments
read 0 when it was recorded and which so got 2 rounds, then 1 at each
later one (at most 16 rounds) until its whole form was built.

- An ExecuteIndirect of a program none of whose ExecuteIndirects has been
  read back yet gets the most rounds. After that, the most slabs any of
  them had (not only those that lost some) size the rounds. This costs
  the empty rounds of a program's first ExecuteIndirects: one
  ExecuteIndirect and one UAV barrier per piece and round. The scratch
  does not grow with the rounds; the command buffer does, by 44 bytes a
  piece and round.
- XCL_SPLIT_INDIRECT_ROUNDS defaults to 32, not 16. Rounds are sized from
  the slabs read back, so the cap matters only for programs that need
  more. With both, none of those runs would have lost a slab.
- The whole form is asked for at the program's first chained
  ExecuteIndirect, not after a loss is read back. It is built on an
  xcl-pso-chain-whole thread, so a huge whole form waits for its turn
  (driver_compile) as the workers' builds do. Before, it was built on a
  thread named xcl-chain-whole, which the huge-build gate did not hold
  (pvfreis, #2404). It is bound only when an ExecuteIndirect has more
  slabs than its rounds.

More than 32 slabs before the whole form is built are still lost, counted
and warned about. Waiting for the whole form when the ExecuteIndirect is
recorded would make it exact. But the precompile does not build the whole
forms of split programs, so that wait is a cold compile on the title's
thread: the 16-40 s stalls this chain removes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The slicer's words after the rounds size the next ExecuteIndirects of
the program: the most slabs one had, and whether any had been measured
at all. Under the title's predication (SetPredicationBufferX) the slicer's
Dispatch may be skipped, and its words then stay as the buffer was
created, all 0. read_back still took them as a count: the program counted
as measured with 0 slabs, so its next ExecuteIndirect whose arguments read
0 on the CPU got 2 rounds instead of the 32 of one never measured.

A chained ExecuteIndirect recorded while the title's predication is set
is no longer read back, as one whose binding failed. Its slicer still
runs the same choice under the predicate.

Reported by @thehollowedone (#2404).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
a_chained_execute_indirect_keeps_its_commands_when_binding_fails records
two chained ExecuteIndirects whose binding succeeds, but its bind closure
did not set the chain's root signature, as bind_abi does. The pieces'
ExecuteIndirects then ran under the slicer's root signature: with the D3D12
debug layer and GPU-based validation, 258 messages (953, 744 and 712). The
test still passed; the runtime's path sets the root signature.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A chained ExecuteIndirect records rounds x pieces ExecuteIndirects, each
after a UAV barrier, also when the slicer leaves them empty. On an RTX
5070 Ti (NVIDIA 610.74) such a step takes 14.4 us of GPU time with the
chain's command signature (eight root constants and a Dispatch): 144 us a
round for 10 pieces, 2.3 ms for 16 rounds, 4.6 ms for 32, empty or not.
Without the barrier it is 0.17 us, and with a Dispatch-only signature
0.41 us; a count buffer of 0 makes it 11.5 us. The rounds came from the
most slabs any ExecuteIndirect of the program had, so one large one kept
every later one at that size.

Until the whole form is built that is needed, since the slabs past the
rounds are lost. Once it is built, an ExecuteIndirect with more slabs than
its rounds runs the whole form, so the rounds now follow the last one
read back (and the arguments seen when recording), not the most.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The chain's root signature indexes the descriptor heaps directly, so setting it on a list
without heaps is a debug-layer error (1419, four of them under GPU-based validation at
809da30). A title's list has its heaps set when XCL binds the ABI; the test's `bind` now sets
two shader-visible heaps before the root signature, as that list has.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. #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 (#2404). With #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 <[email protected]>
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 (#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 <[email protected]>
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 (#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 #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 <[email protected]>
`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 #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 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:29:55 +00:00
Author
Owner

@⁠GreemSC on GitHub · 2026-11-25 18:51 UTC · original

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.

**@⁠GreemSC** on GitHub · 2026-11-25 18:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7171491179) **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.
Author
Owner

@⁠thiagocalile on GitHub · 2026-11-25 19:12 UTC · original

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.

**@⁠thiagocalile** on GitHub · 2026-11-25 19:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7171956128) 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.
Author
Owner

@⁠emirduran707 on GitHub · 2026-11-25 19:13 UTC · original

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.
    • The 3 failures are pre-existing on the PR's base main: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722) and fuzz_validate_and_gpu_3 (seed 1599) on this GPU, plus gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier (from 50a9fde / #2074, fixed later on main in #2420).

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.
**@⁠emirduran707** on GitHub · 2026-11-25 19:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7172003297) 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. - The 3 failures are pre-existing on the PR's base `main`: `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` (seed 722) and `fuzz_validate_and_gpu_3` (seed 1599) on this GPU, plus `gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier` (from `50a9fde` / #2074, fixed later on `main` in #2420). **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.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-25 19:15 UTC · original

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.

**@⁠thehollowedone** on GitHub · 2026-11-25 19:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7172045907) Independent Windows/NVIDIA result on clean [5ca9c23](https://github.com/xcl-dev/xcl/commit/5ca9c23ffd858e487b7611211492afc456fadbad). 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.
Author
Owner

@⁠b3IKK on GitHub · 2026-11-25 19:18 UTC · original

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.

**@⁠b3IKK** on GitHub · 2026-11-25 19:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7172111366) 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.
Author
Owner

@⁠SlopTart on GitHub · 2026-11-25 19:18 UTC · original

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.

**@⁠SlopTart** on GitHub · 2026-11-25 19:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7172122994) **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](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2280)), 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.
Author
Owner

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

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

  • cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 19:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7172334930) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun. Thanks!
Author
Owner

@⁠b3IKK on GitHub · 2026-11-25 19:28 UTC · original

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.

**@⁠b3IKK** on GitHub · 2026-11-25 19:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7172346236) 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.
Author
Owner

@⁠ivall on GitHub · 2026-11-25 19:43 UTC · original

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 #2333 in dispatch_chain.rs; #2333 goes first (one test fix is pending there). The CI failure is the old a_bridged_mask_write… check, fixed on main by #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.

**@⁠ivall** on GitHub · 2026-11-25 19:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7172689600) 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 #2333 in `dispatch_chain.rs`; #2333 goes first (one test fix is pending there). The CI failure is the old `a_bridged_mask_write…` check, fixed on `main` by #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.
Author
Owner

@⁠treybertram06 on GitHub · 2026-11-25 20:08 UTC · original

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

  • Hardware: RTX 3080 10 GB (driver 621.40), Ryzen 9 5900X, Windows 11 26300, Rust 1.100.0, release build.
  • Tree: #2057 plus the title-queue upload wait from #455, merged with main be67bfcf. The base below is that tree.
  • PR builds: for each PR, its head (#2404 5ca9c23, #2372 9dd8715) is merged onto the base.
  • Pipelines: all 2,689 compute pipelines are built ahead (--precompile --only cs --pipelines).
  • Settings: XCL_DIRECT_DXIL=1 XCL_UMA_SHADOW=1, scripted A presses, 600 s per run.

Conflicts with current main

  • #2404: bind::execute_indirect now has skip_named_cs and indirect_guard::check. I placed the chained block after skip_named_cs and before indirect_guard::check, so the guard does not see a chained ExecuteIndirect's arguments. device_x.rs: kept both note_signature and note_dispatch_only_signature.
  • #2372: translated_dispatch now returns early for skip_named_cs, and I made that Ok(false). console_list.rs: the bool result with the dispatch counted as skipped.

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

**@⁠treybertram06** on GitHub · 2026-11-25 20:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7173246937) ### 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** - **Hardware:** RTX 3080 10 GB (driver 621.40), Ryzen 9 5900X, Windows 11 26300, Rust 1.100.0, release build. - **Tree:** #2057 plus the title-queue upload wait from #455, merged with `main` `be67bfcf`. The base below is that tree. - **PR builds:** for each PR, its head (#2404 `5ca9c23`, #2372 `9dd8715`) is merged onto the base. - **Pipelines:** all 2,689 compute pipelines are built ahead (`--precompile --only cs --pipelines`). - **Settings:** `XCL_DIRECT_DXIL=1 XCL_UMA_SHADOW=1`, scripted A presses, 600 s per run. **Conflicts with current `main`** - **#2404:** `bind::execute_indirect` now has `skip_named_cs` and `indirect_guard::check`. I placed the chained block after `skip_named_cs` and before `indirect_guard::check`, so the guard does not see a chained ExecuteIndirect's arguments. `device_x.rs`: kept both `note_signature` and `note_dispatch_only_signature`. - **#2372:** `translated_dispatch` now returns early for `skip_named_cs`, and I made that `Ok(false)`. `console_list.rs`: the `bool` result with the dispatch counted as skipped. **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.)
Author
Owner

@⁠KDenKC on GitHub · 2026-11-25 20:40 UTC · original

Tested 5ca9c23 in the retail title, merged onto main 2898511, RTX 5090 (driver 621.24), on a cache that already had one --precompile --only cs --pipelines done. This is the measurement for the #2088 closing bar, with the details there.

Tested

  • RTX 5090 32 GB, Ryzen 7 9800X3D, Windows 11 26200, release. XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0, default XCL_PSO_WAIT_MS. Local merge 06b3082 (+501/−11, no conflicts).
  • Two title runs, 600 s and 240 s, through the menus into world load:
    • 0 cold compute builds ≥ 256 KB in either run. On the base with the same cache there were 33, 30 of them whole forms of split programs.
    • End counters: ExecuteIndirect: 382 chained (0 of them whole, 0 slabs lost), 0 whole (600 s run) and 362 chained (0 …, 0 …), 0 whole (240 s run).
    • No ExecuteIndirect of a split program skipped, no lost-slab warning, no device removal, no crash, 0 GPU-wait timeouts.
  • Peak local video memory 15.0 GB, peak commit 32.2 GB. The base was at 14.8 / 31.0 GB.

Not tested

  • The whole test suite and scripts/smoke.ps1 on this merge.
  • The Ampere overflow failure ivall mentioned (no Ampere card here).
  • AMD.
  • Frames: they still stop at 116–125 s, as on the base. A thread dump puts that on serial graphics-pipeline builds on a title thread, not on this PR (details on #2088).

AI use: Claude Code (Claude Opus 5.5) reviewed the diff, built and ran it, read the logs and wrote this.

**@⁠KDenKC** on GitHub · 2026-11-25 20:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7174030037) Tested `5ca9c23` in the retail title, merged onto `main` `2898511`, RTX 5090 (driver 621.24), on a cache that already had one `--precompile --only cs --pipelines` done. This is the measurement for the #2088 closing bar, with the details there. **Tested** - RTX 5090 32 GB, Ryzen 7 9800X3D, Windows 11 26200, release. `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0`, default `XCL_PSO_WAIT_MS`. Local merge `06b3082` (+501/−11, no conflicts). - Two title runs, 600 s and 240 s, through the menus into world load: - **0 cold compute builds** ≥ 256 KB in either run. On the base with the same cache there were 33, 30 of them whole forms of split programs. - End counters: `ExecuteIndirect: 382 chained (0 of them whole, 0 slabs lost), 0 whole` (600 s run) and `362 chained (0 …, 0 …), 0 whole` (240 s run). - No `ExecuteIndirect of a split program skipped`, no lost-slab warning, no device removal, no crash, 0 GPU-wait timeouts. - Peak local video memory 15.0 GB, peak commit 32.2 GB. The base was at 14.8 / 31.0 GB. **Not tested** - The whole test suite and `scripts/smoke.ps1` on this merge. - The Ampere overflow failure ivall mentioned (no Ampere card here). - AMD. - Frames: they still stop at 116–125 s, as on the base. A thread dump puts that on serial graphics-pipeline builds on a title thread, not on this PR (details on #2088). AI use: Claude Code (Claude Opus 5.5) reviewed the diff, built and ran it, read the logs and wrote this.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-25 20:17 UTC · original · edited 2026-11-25 20:42 UTC

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.

**@⁠thehollowedone** on GitHub · 2026-11-25 20:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7173460787) · edited 2026-11-25 20:42 UTC For the requested RTX 3080 Ti overflow check on [#2404 head `5ca9c23`](https://github.com/xcl-dev/xcl/commit/5ca9c23ffd858e487b7611211492afc456fadbad): 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.
Author
Owner

@⁠b3IKK on GitHub · 2026-11-25 21:24 UTC · original

Combined test on an RTX 5080 (retail 1.0.2.1, XCL_DIRECT_DXIL=1, default wait, 600 s): 68a284a + #2097 (8524858/d5c2781) + this PR (2b19fec/5ca9c23) + #2519 (the list-keyed scratch for no-allocator/bundle dispatches).

  • ExecuteIndirect: 0 whole, 0 slabs lost (this PR's path).
  • Whole forms in total: 0 with #2519. Without #2519, the same stack still had 46 whole forms from Dispatch/bundles (the 68a284a+this-PR runs), so the two changes together remove the whole-form wall.
  • Presentation reaches 98 s, then the device is removed: 0x887a0005 at 98.1 s, when CreatePlacedResourceX of 1024×512 textures (formats 71/72/98) fails. This is the same device removal you report on the 5070 Ti at 153.7 s, now at 98 s here — not a whole-form stall.

So this PR does what it says for ExecuteIndirect, and the next wall is the device removal / GPU fault. Note: the stack's suite has one failure, gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, the same test that failed in #2372's CI; it passes on this GPU in other trees, so it looks like a parallel/DXC flake rather than this PR.

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

**@⁠b3IKK** on GitHub · 2026-11-25 21:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7175037954) Combined test on an RTX 5080 (retail 1.0.2.1, `XCL_DIRECT_DXIL=1`, default wait, 600 s): `68a284a` + #2097 (`8524858`/`d5c2781`) + this PR (`2b19fec`/`5ca9c23`) + #2519 (the list-keyed scratch for no-allocator/bundle dispatches). - ExecuteIndirect: **0 whole, 0 slabs lost** (this PR's path). - Whole forms in total: **0** with #2519. Without #2519, the same stack still had 46 whole forms from Dispatch/bundles (the `68a284a`+this-PR runs), so the two changes together remove the whole-form wall. - Presentation reaches **98 s**, then the device is removed: `0x887a0005` at **98.1 s**, when `CreatePlacedResourceX` of 1024×512 textures (formats 71/72/98) fails. This is the same device removal you report on the 5070 Ti at 153.7 s, now at 98 s here — not a whole-form stall. So this PR does what it says for ExecuteIndirect, and the next wall is the device removal / GPU fault. Note: the stack's suite has one failure, `gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier`, the same test that failed in #2372's CI; it passes on this GPU in other trees, so it looks like a parallel/DXC flake rather than this PR. AI use: OpenCode, Claude Fable 5.2 built the stack, ran the retail title on this machine and wrote this.
Author
Owner

@⁠b3IKK on GitHub · 2026-11-25 21:28 UTC · original

Device-removal isolation for the combined stack (68a284a + #2097 + this PR + #2519): with the full scratch path the title presents to 98 s, then 0x887a0005; the CreatePlacedResourceX failures come after. With bundles excluded from the scratch (only allocator == 0 direct lists) it still removes, at 99.752 s, with only 11 dispatch chains and 0 ExecuteIndirect chained. So the ExecuteIndirect path is not the trigger here, and neither is the bundle half; the first fault is a GPU suspend after the pieces for allocator-less direct dispatches, consistent with your 5070 Ti DRED page fault at VA 0. I am testing whether the owned path records the pieces under the wrong root signature (params 6/7) and will report; the full analysis is on #505.

AI use: OpenCode, Claude Fable 5.2 ran the isolation passes on this machine and wrote this.

**@⁠b3IKK** on GitHub · 2026-11-25 21:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7175127486) Device-removal isolation for the combined stack (`68a284a` + #2097 + this PR + #2519): with the full scratch path the title presents to 98 s, then `0x887a0005`; the `CreatePlacedResourceX` failures come after. With bundles excluded from the scratch (only `allocator == 0` direct lists) it still removes, at 99.752 s, with only 11 `dispatch` chains and 0 ExecuteIndirect chained. So the ExecuteIndirect path is not the trigger here, and neither is the bundle half; the first fault is a GPU suspend after the pieces for allocator-less direct dispatches, consistent with your 5070 Ti DRED page fault at VA 0. I am testing whether the owned path records the pieces under the wrong root signature (params 6/7) and will report; the full analysis is on #505. AI use: OpenCode, Claude Fable 5.2 ran the isolation passes on this machine and wrote this.
Author
Owner

@⁠b3IKK on GitHub · 2026-11-25 21:36 UTC · original

DRED on the combined stack with #2519 (9820c9b, retail 1.0.2.1, RTX 5080, XCL_DIRECT_DXIL=1, default wait): the device is removed at 91.7 s with an empty DRED page-fault output (VA 0x0, no allocations) and no breadcrumb nodes, at the title's own 9,067-dispatch/2 s burst; at the 90 s snapshot ExecuteIndirect was 0 chained, 0 whole, and no driver compile happened in the last 12 s. So this PR's ExecuteIndirect path is not what removes the device — it is the shader-code budget of #2403. Details on #505/#2403.

AI use: OpenCode, Claude Fable 5.2 ran the DRED pass and wrote this.

**@⁠b3IKK** on GitHub · 2026-11-25 21:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7175305193) DRED on the combined stack with #2519 (`9820c9b`, retail 1.0.2.1, RTX 5080, `XCL_DIRECT_DXIL=1`, default wait): the device is removed at 91.7 s with an **empty DRED page-fault output** (VA 0x0, no allocations) and no breadcrumb nodes, at the title's own 9,067-dispatch/2 s burst; at the 90 s snapshot ExecuteIndirect was **0 chained, 0 whole**, and no driver compile happened in the last 12 s. So this PR's ExecuteIndirect path is not what removes the device — it is the shader-code budget of #2403. Details on #505/#2403. AI use: OpenCode, Claude Fable 5.2 ran the DRED pass and wrote this.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-25 21:39 UTC · original

Follow-up to my earlier RTX 3080 Ti failure report on head 5ca9c23. The stock dispatch_chain_divergent_forward_edges_3d test still fails here with XCL_D3D12_DEBUG=1. An isolated, test-only experiment passed the same full fixture in 6/6 separate processes on the RTX 3080 Ti: both 32- and 64-thread cases, the fitting cases, and all three overflow fallback cases. No skips. Six overflow InfoQueue checks in the final process reported zero D3D12 ERROR/CORRUPTION messages.

The experiment has the GPU slicer append two 32-bit indirect counts: piece count = 1 when all slabs fit, otherwise 0; whole count = the effective title command count on overflow, otherwise 0. Each piece ExecuteIndirect uses the first count, and the whole fallback uses the second. This replaces XCL's internal SetPredication in the synthetic runner. It allows production to keep the title's own predication state while selecting the split or whole path using GPU-written counts. The production path is unchanged in this experiment, so this is a verified mechanism, not a verified retail fix. The whole callback would need to receive the generated count buffer while retaining its existing fresh_indirect_arguments handling.

Two other correctness gates remain. When the whole PSO is not ready, an overflow still discards slabs; count gating alone cannot recover them. Also, record_slicer records GPU use before bind()?, but the command buffer is retained in the allocator's RECORDINGS only after binding succeeds. I built a separate local error-path fix that retains the buffer before recording and initializes readback metadata only on success; it passed a focused test, but it lacks a regression that exercises the failing bind path. Neither local experiment was committed or posted as a PR.

Still to test on a production change: title predication on and off, counted and empty commands, the native whole callback, another GPU, full workspace tests, and the required paired smoke runs. No game files or retail diagnostics were used here. AI-assisted: Codex (GPT-6, exact variant unavailable); GPT-6.2 Astra reviewed the D3D12 reasoning.

**@⁠thehollowedone** on GitHub · 2026-11-25 21:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7175359633) Follow-up to [my earlier RTX 3080 Ti failure report](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404) on [head `5ca9c23`](https://github.com/xcl-dev/xcl/commit/5ca9c23ffd858e487b7611211492afc456fadbad). The stock `dispatch_chain_divergent_forward_edges_3d` test still fails here with `XCL_D3D12_DEBUG=1`. An isolated, test-only experiment passed the same full fixture in 6/6 separate processes on the RTX 3080 Ti: both 32- and 64-thread cases, the fitting cases, and all three overflow fallback cases. No skips. Six overflow InfoQueue checks in the final process reported zero D3D12 ERROR/CORRUPTION messages. The experiment has the GPU slicer append two 32-bit indirect counts: piece count = 1 when all slabs fit, otherwise 0; whole count = the effective title command count on overflow, otherwise 0. Each piece `ExecuteIndirect` uses the first count, and the whole fallback uses the second. This replaces XCL's internal `SetPredication` in the synthetic runner. It allows production to keep the title's own predication state while selecting the split or whole path using GPU-written counts. The production path is unchanged in this experiment, so this is a verified mechanism, **not** a verified retail fix. The whole callback would need to receive the generated count buffer while retaining its existing `fresh_indirect_arguments` handling. Two other correctness gates remain. When the whole PSO is not ready, an overflow still discards slabs; count gating alone cannot recover them. Also, `record_slicer` records GPU use before `bind()?`, but the command buffer is retained in the allocator's `RECORDINGS` only after binding succeeds. I built a separate local error-path fix that retains the buffer before recording and initializes readback metadata only on success; it passed a focused test, but it lacks a regression that exercises the failing bind path. Neither local experiment was committed or posted as a PR. Still to test on a production change: title predication on and off, counted and empty commands, the native whole callback, another GPU, full workspace tests, and the required paired smoke runs. No game files or retail diagnostics were used here. AI-assisted: Codex (GPT-6, exact variant unavailable); GPT-6.2 Astra reviewed the D3D12 reasoning.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-25 21:51 UTC · original

Independent RTX 3080 Ti follow-up on the new #2404 head 77cfec2: the formerly failing dispatch_chain_divergent_forward_edges_3d fixture passed in 4 separate processes with XCL_D3D12_DEBUG=1, covering its 32/64-thread fit and overflow cases. The new a_chained_execute_indirect_keeps_its_commands_when_binding_fails test also passed. The zero-Dispatch-argument selection appears to resolve the Ampere fixture that I reported on the prior head.

I found a separate readback error in the new head. A title predicate can suppress the slicer's Dispatch, leaving its command-buffer tail unwritten. Recording::read_back still sets chain.measured = true after a successful bind. In an isolated GPU regression, I set a suppressing predicate, recorded a production chain, prefilled the tail with a sentinel, submitted and fence-waited. The sentinel remained unchanged, proving the slicer did not write it; the stock code nevertheless treated it as a measurement. With a zero tail, the next CPU-zero call gets 2 rounds instead of the intended cold 32. A nonzero stale tail can report false lost slabs. Passing the already tracked title-predication state into execute_indirect and setting checked = bound.is_ok() && !predicated made that same regression pass locally. This is a proposed narrow correction, not a committed change.

cargo build --offline --locked --workspace passed. cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 on this unrebased PR head: 1,292 passed, 1 failed, 46 ignored, 25 GPU skip notices. The sole failure was a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier (3 barriers versus 1); it also failed 3/3 isolated runs on this head and passed on clean current main e1d84b7. #2404's merge base is older 68a284a, before the merged #2420 test fix. The Windows CI merge check is green; the PR branch still needs the requested rebase. The PR description checks currently fail.

The new 32-round cap and early background whole build reduce the cold-loss window, but the code still acknowledges that slabs beyond the cap are dropped before the whole PSO is ready. I did not run a retail title or the required paired smoke checks. AI-assisted: Codex (GPT-6, exact variant unavailable).

**@⁠thehollowedone** on GitHub · 2026-11-25 21:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7175627837) Independent RTX 3080 Ti follow-up on the new [#2404 head `77cfec2`](https://github.com/xcl-dev/xcl/commit/77cfec27e5dbd9f320439a79112ff47eef479aeb): the formerly failing `dispatch_chain_divergent_forward_edges_3d` fixture passed in 4 separate processes with `XCL_D3D12_DEBUG=1`, covering its 32/64-thread fit and overflow cases. The new `a_chained_execute_indirect_keeps_its_commands_when_binding_fails` test also passed. The zero-Dispatch-argument selection appears to resolve the Ampere fixture that I reported on the prior head. I found a separate readback error in the new head. A title predicate can suppress the slicer's `Dispatch`, leaving its command-buffer tail unwritten. `Recording::read_back` still sets `chain.measured = true` after a successful bind. In an isolated GPU regression, I set a suppressing predicate, recorded a production chain, prefilled the tail with a sentinel, submitted and fence-waited. The sentinel remained unchanged, proving the slicer did not write it; the stock code nevertheless treated it as a measurement. With a zero tail, the next CPU-zero call gets 2 rounds instead of the intended cold 32. A nonzero stale tail can report false lost slabs. Passing the already tracked title-predication state into `execute_indirect` and setting `checked = bound.is_ok() && !predicated` made that same regression pass locally. This is a proposed narrow correction, not a committed change. `cargo build --offline --locked --workspace` passed. `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4` on this unrebased PR head: 1,292 passed, 1 failed, 46 ignored, 25 GPU skip notices. The sole failure was `a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier` (3 barriers versus 1); it also failed 3/3 isolated runs on this head and passed on clean current main `e1d84b7`. #2404's merge base is older `68a284a`, before the merged [#2420](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2420) test fix. The Windows CI merge check is green; the PR branch still needs the requested rebase. The PR description checks currently fail. The new 32-round cap and early background whole build reduce the cold-loss window, but the code still acknowledges that slabs beyond the cap are dropped before the whole PSO is ready. I did not run a retail title or the required paired smoke checks. AI-assisted: Codex (GPT-6, exact variant unavailable).
Author
Owner

@⁠kanade333 on GitHub · 2026-11-25 21:53 UTC · original

RTX 5080, main 6d12f58 + 5ca9c23: no whole-form stall; this run went further into the world than the reports above and reached the PR's fallback paths: 33 slabs lost, 69 whole-form runs, ~0.5 presents/s, then 0x887a0005 at 403 s. One run.

Tested

  • RTX 5080 16 GB (driver 621.40), Ryzen 9 9950X, 32 GB, Windows 11 Pro 26200, release build. Local merge of 5ca9c23 onto main 6d12f58, no conflicts.
  • Retail title 1.0.2.1. Before this run: --precompile --only cs --pipelines on 6d12f58 and three runs of plain 6d12f58 on the same cache.
  • Settings: XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_DRED=1 XCL_NETWORK=0 XCL_ACTIVITY=1, default XCL_PSO_WAIT_MS, 420 s.
  • Base (6d12f58, same cache, 3 runs): presents stop at 74 s, 94 s and 96 s. Just before that, the title's threads start whole-form compute builds of 650–950 KB of DXIL, all driver blob absent. Each takes 16–86 s, about 300–340 s in total per run.
  • With this PR:
    • The title presents until 402 s, and only one compute build is over 2 s. The whole-form stall is gone.
    • From about 90 s on, the PR's fallback paths are used:
      • ExecuteIndirect: 2576 chained (0 of them whole, 30 slabs lost) at 90 s;
      • … (2 of them whole, 33 slabs lost) at 100 s;
      • 67394 chained (69 of them whole, 33 slabs lost) at 400 s.
      • The whole-form count stops growing at 320 s.
    • Presents per minute, by minute of the run: 730, 745, then 31, 24, 31, 31, 31. At the same time, compute dispatches go from 630 in the first minute to about 170,000 a minute. compute split at 400 s: 295 programs split, 2494 pieces built, 126236 chained dispatches issued in 894035 slabs.
    • The device is removed at 403.5 s (0x887a0005). DRED: page fault at VA 0x0, no allocations, none recently freed. In the second before the removal there are 4 warnings: ExecuteIndirect of a split program skipped: no buffer for the commands of a chained ExecuteIndirect, the only ones in the run. Peak local video memory 19.9 GB, commit 44.4 GB.

Not tested

  • Only one run. No thread dump of the slow phase, so I cannot say whether the 0.5 presents/s comes from the chained slabs or from something else.
  • The test suite and scripts/smoke.ps1 on this merge.
  • With #2097 or #2519.
  • AMD.

AI use: Claude Code (Claude Opus 5.5) built the merge, ran the title, read the logs and wrote this report.

**@⁠kanade333** on GitHub · 2026-11-25 21:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7175667429) **RTX 5080, `main` `6d12f58` + `5ca9c23`: no whole-form stall; this run went further into the world than the reports above and reached the PR's fallback paths: 33 slabs lost, 69 whole-form runs, ~0.5 presents/s, then `0x887a0005` at 403 s.** One run. **Tested** - RTX 5080 16 GB (driver 621.40), Ryzen 9 9950X, 32 GB, Windows 11 Pro 26200, release build. Local merge of `5ca9c23` onto `main` `6d12f58`, no conflicts. - Retail title 1.0.2.1. Before this run: `--precompile --only cs --pipelines` on `6d12f58` and three runs of plain `6d12f58` on the same cache. - Settings: `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_DRED=1 XCL_NETWORK=0 XCL_ACTIVITY=1`, default `XCL_PSO_WAIT_MS`, 420 s. - **Base (`6d12f58`, same cache, 3 runs):** presents stop at 74 s, 94 s and 96 s. Just before that, the title's threads start whole-form compute builds of 650–950 KB of DXIL, all `driver blob absent`. Each takes 16–86 s, about 300–340 s in total per run. - **With this PR:** - The title presents until 402 s, and only one compute build is over 2 s. The whole-form stall is gone. - From about 90 s on, the PR's fallback paths are used: - `ExecuteIndirect: 2576 chained (0 of them whole, 30 slabs lost)` at 90 s; - `… (2 of them whole, 33 slabs lost)` at 100 s; - `67394 chained (69 of them whole, 33 slabs lost)` at 400 s. - The whole-form count stops growing at 320 s. - Presents per minute, by minute of the run: 730, 745, then 31, 24, 31, 31, 31. At the same time, compute dispatches go from 630 in the first minute to about 170,000 a minute. `compute split` at 400 s: `295 programs split, 2494 pieces built, 126236 chained dispatches issued in 894035 slabs`. - The device is removed at 403.5 s (`0x887a0005`). DRED: page fault at VA 0x0, no allocations, none recently freed. In the second before the removal there are 4 warnings: `ExecuteIndirect of a split program skipped: no buffer for the commands of a chained ExecuteIndirect`, the only ones in the run. Peak local video memory 19.9 GB, commit 44.4 GB. **Not tested** - Only one run. No thread dump of the slow phase, so I cannot say whether the 0.5 presents/s comes from the chained slabs or from something else. - The test suite and `scripts/smoke.ps1` on this merge. - With #2097 or #2519. - AMD. AI use: Claude Code (Claude Opus 5.5) built the merge, ran the title, read the logs and wrote this report.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-25 22:11 UTC · original · edited 2026-11-26 08:48 UTC

Current-head RTX 3080 Ti recheck: 5b9d4ff, based on main b49be18. Windows 11 build 26300, NVIDIA 621.35, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, DXC/DXIL 1.8.2502.11. Clean exact-head checkout; worktree-local Kache and DXIL caches; synthetic tests only.

  • cargo build --offline --locked --workspace: passed.
  • cargo test --offline --locked -p xcl --lib dispatch_chain_divergent_forward_edges_3d -- --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored, no skip. The fixture ran on the RTX 3080 Ti, covering its 32- and 64-thread cases.
  • cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --quiet: 1,447 passed, 0 failed, 47 ignored across 37 test targets; 25 GPU skip notices. Skips are not counted as GPU coverage.

The prior Ampere fixture failure no longer reproduces at this head. I did not run a retail title or paired smoke checks. This test result does not resolve the already documented case where more than 32 slabs can be dropped before the whole PSO is ready.

Earlier RTX 3080 Ti check on d76f773

Independent RTX 3080 Ti check of d76f773, Windows 11 build 26300, NVIDIA 621.35, Ryzen 7 9800X3D, rustc 1.99.1 MSVC, with XCL_D3D12_DEBUG=1:

  • Stock dispatch_chain_divergent_forward_edges_3d: passed 1/1, no skips (32- and 64-thread fit and overflow cases).
  • Stock a_chained_execute_indirect_keeps_its_commands_when_binding_fails: passed 1/1, no skips.
  • A local test-only regression for the reported readback bug passed in 4 separate processes, no skips. It sets a suppressing D3D12 predicate, records a chain through production dispatch_chain::execute_indirect, preloads a sentinel in the slicer's output, submits the command list and waits for the GPU fence. The sentinel remains unchanged, chain.measured stays false, and the next cold call retains 32 rounds. The same test failed on the prior head 77cfec2 before this guard.

This verifies the no-readback guard when execute_indirect is told the title predicate is active. It does not drive the title-facing SetPredicationBufferX hook end to end; the list_x tests separately check its predicate state. I did not run the full workspace suite or paired retail smoke on d76f773.

AI-assisted: Codex (GPT-6.2 Sol) ran the current-head tests and drafted this update. The earlier d76f773 check used Codex (GPT-6, exact variant unavailable).

**@⁠thehollowedone** on GitHub · 2026-11-25 22:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7176045715) · edited 2026-11-26 08:48 UTC **Current-head RTX 3080 Ti recheck:** [5b9d4ff](https://github.com/xcl-dev/xcl/commit/5b9d4ff6f5f4a2142c3c633bb1e0d700f6be5e22), based on `main` [b49be18](https://github.com/xcl-dev/xcl/commit/b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). Windows 11 build 26300, NVIDIA 621.35, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, DXC/DXIL 1.8.2502.11. Clean exact-head checkout; worktree-local Kache and DXIL caches; synthetic tests only. - `cargo build --offline --locked --workspace`: passed. - `cargo test --offline --locked -p xcl --lib dispatch_chain_divergent_forward_edges_3d -- --nocapture --test-threads=1`: 1 passed, 0 failed, 0 ignored, no skip. The fixture ran on the RTX 3080 Ti, covering its 32- and 64-thread cases. - `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --quiet`: **1,447 passed, 0 failed, 47 ignored** across 37 test targets; 25 GPU skip notices. Skips are not counted as GPU coverage. The prior Ampere fixture failure no longer reproduces at this head. I did not run a retail title or paired smoke checks. This test result does not resolve the already documented case where more than 32 slabs can be dropped before the whole PSO is ready. <details><summary>Earlier RTX 3080 Ti check on d76f773</summary> Independent RTX 3080 Ti check of [d76f773](https://github.com/xcl-dev/xcl/commit/d76f7734ddb73af92e36c02f8e3e5cc7d9dbb14e), Windows 11 build 26300, NVIDIA 621.35, Ryzen 7 9800X3D, rustc 1.99.1 MSVC, with `XCL_D3D12_DEBUG=1`: - Stock `dispatch_chain_divergent_forward_edges_3d`: passed 1/1, no skips (32- and 64-thread fit and overflow cases). - Stock `a_chained_execute_indirect_keeps_its_commands_when_binding_fails`: passed 1/1, no skips. - A local test-only regression for the reported readback bug passed in 4 separate processes, no skips. It sets a suppressing D3D12 predicate, records a chain through production `dispatch_chain::execute_indirect`, preloads a sentinel in the slicer's output, submits the command list and waits for the GPU fence. The sentinel remains unchanged, `chain.measured` stays false, and the next cold call retains 32 rounds. The same test failed on the prior head `77cfec2` before this guard. This verifies the no-readback guard when `execute_indirect` is told the title predicate is active. It does not drive the title-facing `SetPredicationBufferX` hook end to end; the `list_x` tests separately check its predicate state. I did not run the full workspace suite or paired retail smoke on `d76f773`. </details> AI-assisted: Codex (GPT-6.2 Sol) ran the current-head tests and drafted this update. The earlier d76f773 check used Codex (GPT-6, exact variant unavailable).
Author
Owner

@⁠b3IKK on GitHub · 2026-11-25 22:37 UTC · original

Data on the new head from an RTX 5080 (retail 1.0.2.1, XCL_DIRECT_DXIL=1, release, 400 s), stack 77cfec2 + #2519's list-keyed scratch + #2422/#2526 with a 200 MB code budget:

  • The EI whole builds are gone. On 5ca9c23 the title spent 101.0–101.2 s building 64 whole compute PSOs of 0.84–1.15 MB DXIL on its thread (no buffer for the commands of a chained ExecuteIndirect ×4, ExecuteIndirect whole compute PSO many). On 77cfec2 those lines are 0, and the whole count at 100 s is 19 instead of 64.
  • The wall is still #2403. The device is removed at 102–104 s (0x887a0005). The 19 remaining wholes are not the scratch budget: 388 MiB live against the 384 MB total, and 834 MiB with XCL_SPLIT_SCRATCH_TOTAL_MB=768, give the same 19 and removal at 102.2 s.
  • #2526 works: 132–186 compute pipelines released, compute code held at 213–238 MB.
  • #2519's scratch applies cleanly on 77cfec2 (local commit 8391434).
  • XCL_HEAP_WINDOWS=1 without a precompiled heap-window cache stalls at 98 s (0 presents for 500 s while translating); kanade333's 402 s run had --precompile --only cs --pipelines.

No action requested — this is the new head's behavior on my machine for the record.

AI use: OpenCode, Claude Fable 5.2 ran the stack, read the logs and wrote this.

**@⁠b3IKK** on GitHub · 2026-11-25 22:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7176591261) Data on the new head from an RTX 5080 (retail 1.0.2.1, `XCL_DIRECT_DXIL=1`, release, 400 s), stack `77cfec2` + #2519's list-keyed scratch + #2422/#2526 with a 200 MB code budget: - **The EI whole builds are gone.** On `5ca9c23` the title spent 101.0–101.2 s building 64 whole compute PSOs of 0.84–1.15 MB DXIL on its thread (`no buffer for the commands of a chained ExecuteIndirect` ×4, `ExecuteIndirect whole compute PSO` many). On `77cfec2` those lines are **0**, and the whole count at 100 s is 19 instead of 64. - **The wall is still #2403.** The device is removed at 102–104 s (`0x887a0005`). The 19 remaining wholes are not the scratch budget: 388 MiB live against the 384 MB total, and 834 MiB with `XCL_SPLIT_SCRATCH_TOTAL_MB=768`, give the same 19 and removal at 102.2 s. - **#2526 works**: 132–186 compute pipelines released, compute code held at 213–238 MB. - #2519's scratch applies cleanly on `77cfec2` (local commit `8391434`). - `XCL_HEAP_WINDOWS=1` without a precompiled heap-window cache stalls at 98 s (0 presents for 500 s while translating); kanade333's 402 s run had `--precompile --only cs --pipelines`. No action requested — this is the new head's behavior on my machine for the record. AI use: OpenCode, Claude Fable 5.2 ran the stack, read the logs and wrote this.
Author
Owner

@⁠treybertram06 on GitHub · 2026-11-25 22:44 UTC · original

@⁠Kalmarv RTX 3080 10 GB (Ampere, driver 621.40), Ryzen 9 5900X, Windows 11 26300, Rust 1.100.0, debug, DXC 1.9.2609.5, at 809da30:

  • cargo test -p xcl --lib dispatch_chain -- --test-threads=1, in 3 separate processes: 13 passed, 0 failed, 0 ignored each time. dispatch_chain_divergent_forward_edges_3d passes in all three.
  • dispatch_chain_divergent_forward_edges_3d alone with XCL_D3D12_DEBUG=1: 1 passed, 0 failed.
  • SKIPPED: dispatch_chain_native_wave64_builds_whole: no wave64 (32-lane waves only).

The same test failed on this card at 5ca9c23. These counts are for the lib tests only. I didn't run the title on 809da30; the removals in my earlier report fit #2403, as you say.

(Claude Code, Claude Opus 5.5.)

**@⁠treybertram06** on GitHub · 2026-11-25 22:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7176725432) @⁠Kalmarv RTX 3080 10 GB (Ampere, driver 621.40), Ryzen 9 5900X, Windows 11 26300, Rust 1.100.0, debug, DXC 1.9.2609.5, at `809da30`: - `cargo test -p xcl --lib dispatch_chain -- --test-threads=1`, in 3 separate processes: **13 passed, 0 failed, 0 ignored** each time. `dispatch_chain_divergent_forward_edges_3d` passes in all three. - `dispatch_chain_divergent_forward_edges_3d` alone with `XCL_D3D12_DEBUG=1`: 1 passed, 0 failed. - `SKIPPED`: `dispatch_chain_native_wave64_builds_whole: no wave64` (32-lane waves only). The same test failed on this card at `5ca9c23`. These counts are for the lib tests only. I didn't run the title on `809da30`; the removals in my earlier report fit #2403, as you say. (Claude Code, Claude Opus 5.5.)
Author
Owner

@⁠razormontana on GitHub · 2026-11-25 23:23 UTC · original

I reran the ExecuteIndirect overflow fixture on a native Windows RTX 3070. The earlier failure reproduced in all three runs of the old commit. All three runs of the newer commit passed, as did a separate run with the D3D12 debug layer loaded. Earlier RTX 3070 report

Tested

  • Windows 11 Pro 22631.5335, Core i7-10700K, GeForce RTX 3070 8 GB, driver 32.0.16.1742, Rust 1.100.0 MSVC, and DXC/DXIL 1.9.2602.17. Both clean revisions built with CARGO_BUILD_JOBS=1 CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 cargo test --offline --locked -p xcl --lib --no-run. Ran the resulting libtest executables with XCL_ADAPTER=3070.
  • --exact gpu::dxil::module::split::tests::dispatch_chain_divergent_forward_edges_3d --nocapture --test-threads=1 at old head 5ca9c23ffd858e487b7611211492afc456fadbad failed 3/3 at the first wave32 whole-form overflow case. It used 11 rounds for 12 slabs. The slicer-tail assertion passed, all 384 data words stayed at their initial values, and all 16 guard words stayed intact.
  • The same fixture at 809da308a6431254a6fc2f88780abebb473acbcd passed 3/3 with zero skips. The wave32 and split-wave64 fit and overflow readbacks matched the CPU reference, covering 384 and 768 data words respectively and 16 guard words. A fourth run with XCL_D3D12_DEBUG=1 passed and loaded D3D12SDKLayers.dll 10.0.22621.5262 in the test process.
  • At 809da30, the dispatch_chain --nocapture --test-threads=1 filter reported 13 passes, zero failures, zero ignored, and one explicit native-wave64 skip within the pass count. Neither revision reported device removal or hit a guard limit.

Not tested

Retail, performance, native wave64, and the full workspace suite. The debug-layer run did not collect D3D12 InfoQueue messages.

AI use

Yes, Codex GPT-6.2 Sol reviewed the exact source, ran the tests, checked the logs, and prepared this report.

**@⁠razormontana** on GitHub · 2026-11-25 23:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7177486333) I reran the ExecuteIndirect overflow fixture on a native Windows RTX 3070. The earlier failure reproduced in all three runs of the old commit. All three runs of the newer commit passed, as did a separate run with the D3D12 debug layer loaded. [Earlier RTX 3070 report](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404) **Tested** - Windows 11 Pro 22631.5335, Core i7-10700K, GeForce RTX 3070 8 GB, driver 32.0.16.1742, Rust 1.100.0 MSVC, and DXC/DXIL 1.9.2602.17. Both clean revisions built with `CARGO_BUILD_JOBS=1 CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 cargo test --offline --locked -p xcl --lib --no-run`. Ran the resulting libtest executables with `XCL_ADAPTER=3070`. - `--exact gpu::dxil::module::split::tests::dispatch_chain_divergent_forward_edges_3d --nocapture --test-threads=1` at old head `5ca9c23ffd858e487b7611211492afc456fadbad` failed 3/3 at the first wave32 whole-form overflow case. It used 11 rounds for 12 slabs. The slicer-tail assertion passed, all 384 data words stayed at their initial values, and all 16 guard words stayed intact. - The same fixture at `809da308a6431254a6fc2f88780abebb473acbcd` passed 3/3 with zero skips. The wave32 and split-wave64 fit and overflow readbacks matched the CPU reference, covering 384 and 768 data words respectively and 16 guard words. A fourth run with `XCL_D3D12_DEBUG=1` passed and loaded `D3D12SDKLayers.dll` 10.0.22621.5262 in the test process. - At `809da30`, the `dispatch_chain --nocapture --test-threads=1` filter reported 13 passes, zero failures, zero ignored, and one explicit native-wave64 skip within the pass count. Neither revision reported device removal or hit a guard limit. **Not tested** Retail, performance, native wave64, and the full workspace suite. The debug-layer run did not collect D3D12 InfoQueue messages. **AI use** Yes, Codex GPT-6.2 Sol reviewed the exact source, ran the tests, checked the logs, and prepared this report.
Author
Owner

@⁠Royalflamejlh on GitHub · 2026-11-25 23:50 UTC · original

On Linux + NVIDIA, 77cfec2 chained 2 split ExecuteIndirects and left 26 to 30 whole in 3 of 3 runs, and the title presented nothing after its burst, as without this PR (2 of 2). As you wrote, execute_indirect returns Ok(false) when alloc_pool gives the list no allocator (:351 at 809da30, :338 at 77cfec2); in a fourth run with a log line added, all 32 declines were that case. With #2333 merged under it, and execute_indirect given #2333's resolve_allocator in that merge, every call chained, and once the cache was warm the title presented from 2 s after its burst (2 runs).

Setup: RTX 4060 Ti 16 GB (NVIDIA 615.71.09), Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, VKD3D_CONFIG=ignore_shared_fence. main e0d93c8 + #684, #751, #2082, #1860, #1599, #1798 (local merge), + this PR at 77cfec2, then + #2333 a7b93a8, which also brings #2368. That merge was by hand: execute_indirect takes #2333's resolve_allocator, as dispatch does there; a plain merge keeps its unwrap_or(0). XCL_DIRECT_DXIL=1 XCL_HUGE_PSO_WANTED_CONCURRENCY=6 XCL_DXC_THREADS=4 XCL_PSO_DISK_CACHE=0, 300 s unless the table says otherwise; first-run screens completed once, no story progress. The first three rows each started from a copy of one cache; the #2333 runs share one copy, in the order shown.

tree runs ExecuteIndirect at the end presents after the burst
without this PR 2 – 0, 0
this PR 3 (one with XCL_PSO_WAIT_MS=50) 2 chained; 26, 28, 30 whole 0, 0, 0
+ #2333, first run on its copy 1 22 chained, 0 whole 0
+ #2333, the next runs on that cache (683, 157, 170 s) 3 15,883, 31,010, 70,341 chained, 0 whole 38 from 524 s; 72 and 134 from 2 s after it
  • On your "how many are alive at once": with #2333, a log line we added counted the entries in RECORDINGS (chained Dispatches, chained ExecuteIndirects and #2333's kept whole forms together): 672 at 70 s and 11,061 under 156 allocators at 170 s, while chained ExecuteIndirects went from 563 to 70,341. Non-local video memory went from about 4.5 GB at the burst to 13.0 GB at 157 s and 14.8 GB at 683 s in the two runs our memory guard stopped, and to 8.7 GB at 170 s in the third; how much of that is these buffers we did not measure.
  • On Windows (RTX 5070 Ti, this PR without #2333, XCL_DIRECT_DXIL=1 only, 300 s, 1 run) it chained 22, left 9 whole, and presented nothing after its burst.

Not tested: 809da30; #2333 without that change to execute_indirect; #2333 on Windows; #2519.

AI use: Claude Code (Claude Opus 5.5) made the runs, merged #2333 under this PR, added the two log lines, read the logs and wrote this.

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

**@⁠Royalflamejlh** on GitHub · 2026-11-25 23:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7178119858) On Linux + NVIDIA, `77cfec2` chained 2 split `ExecuteIndirect`s and left 26 to 30 whole in 3 of 3 runs, and the title presented nothing after its burst, as without this PR (2 of 2). As you wrote, `execute_indirect` returns `Ok(false)` when `alloc_pool` gives the list no allocator (`:351` at `809da30`, `:338` at `77cfec2`); in a fourth run with a log line added, all 32 declines were that case. With #2333 merged under it, and `execute_indirect` given #2333's `resolve_allocator` in that merge, every call chained, and once the cache was warm the title presented from 2 s after its burst (2 runs). **Setup:** RTX 4060 Ti 16 GB (NVIDIA 615.71.09), Wine 11.21 Staging, vkd3d-proton `v3.1-90-g30b0eb9b` with the relaxed-vtable patch from #175 and a local dxil-spirv patch, `VKD3D_CONFIG=ignore_shared_fence`. `main` `e0d93c8` + #684, #751, #2082, #1860, #1599, #1798 (local merge), + this PR at `77cfec2`, then + #2333 `a7b93a8`, which also brings #2368. That merge was by hand: `execute_indirect` takes #2333's `resolve_allocator`, as `dispatch` does there; a plain merge keeps its `unwrap_or(0)`. `XCL_DIRECT_DXIL=1 XCL_HUGE_PSO_WANTED_CONCURRENCY=6 XCL_DXC_THREADS=4 XCL_PSO_DISK_CACHE=0`, 300 s unless the table says otherwise; first-run screens completed once, no story progress. The first three rows each started from a copy of one cache; the #2333 runs share one copy, in the order shown. | tree | runs | `ExecuteIndirect` at the end | presents after the burst | |---|---|---|---| | without this PR | 2 | – | 0, 0 | | this PR | 3 (one with `XCL_PSO_WAIT_MS=50`) | 2 chained; 26, 28, 30 whole | 0, 0, 0 | | + #2333, first run on its copy | 1 | 22 chained, 0 whole | 0 | | + #2333, the next runs on that cache (683, 157, 170 s) | 3 | 15,883, 31,010, 70,341 chained, 0 whole | 38 from 524 s; 72 and 134 from 2 s after it | - On your "how many are alive at once": with #2333, a log line we added counted the entries in `RECORDINGS` (chained `Dispatch`es, chained `ExecuteIndirect`s and #2333's kept whole forms together): 672 at 70 s and 11,061 under 156 allocators at 170 s, while chained `ExecuteIndirect`s went from 563 to 70,341. Non-local video memory went from about 4.5 GB at the burst to 13.0 GB at 157 s and 14.8 GB at 683 s in the two runs our memory guard stopped, and to 8.7 GB at 170 s in the third; how much of that is these buffers we did not measure. - On Windows (RTX 5070 Ti, this PR without #2333, `XCL_DIRECT_DXIL=1` only, 300 s, 1 run) it chained 22, left 9 whole, and presented nothing after its burst. **Not tested:** `809da30`; #2333 without that change to `execute_indirect`; #2333 on Windows; #2519. **AI use:** Claude Code (Claude Opus 5.5) made the runs, merged #2333 under this PR, added the two log lines, read the logs and wrote this. Posted without review by a person: the account owner was away and reads replies later.
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 19:49 UTC · original · edited 2026-11-25 23:55 UTC

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

@⁠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.

**@⁠upipibi** on GitHub · 2026-11-25 19:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7172819735) · edited 2026-11-25 23:55 UTC **Update:** this report covers `5ca9c23` only. On `809da30` the same card passes: https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404 (13 passed, 0 failed, 3 processes); razormontana's RTX 3070 also passes there, including a run with the D3D12 debug layer: https://git.gtahub.st/github/xcl-dev--xcl/pulls/2404. @⁠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.
Author
Owner

@⁠dhillonjagdeep650-boop on GitHub · 2026-11-26 01:28 UTC · original

@⁠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.

**@⁠dhillonjagdeep650-boop** on GitHub · 2026-11-26 01:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7179803338) @⁠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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 02:22 UTC · original

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

**@⁠DavidM1911** on GitHub · 2026-11-26 02:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7180741850) 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
Author
Owner

@⁠Royalflamejlh on GitHub · 2026-11-26 02:55 UTC · original

@⁠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
  • The change in that run is 8 lines in title_reset_in (Royalflamejlh/xcl@f4608d7, branch arch/pool-aside-reset). We have not opened it: #2138 does the same for all but that case, and ours would go on top of it for that one.
  • Our memory guard still stopped that run at 204.5 s, for low system RAM. Something else grows too, as we read it: with the pool off (XCL_ALLOC_SWAP=0), a tree with #2229 added fell under 5 GB available in 2 of 5 runs of 300 s; the other 3 reached 300 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.

**@⁠Royalflamejlh** on GitHub · 2026-11-26 02:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7181244718) @⁠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 | - The change in that run is 8 lines in `title_reset_in` (Royalflamejlh/xcl@f4608d7, branch `arch/pool-aside-reset`). We have not opened it: #2138 does the same for all but that case, and ours would go on top of it for that one. - Our memory guard still stopped that run at 204.5 s, for low system RAM. Something else grows too, as we read it: with the pool off (`XCL_ALLOC_SWAP=0`), a tree with #2229 added fell under 5 GB available in 2 of 5 runs of 300 s; the other 3 reached 300 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.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-26 02:59 UTC · original

@⁠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):

  • Recordings filed with a title's allocator. A list XCL makes itself, such as a mid-list split's next list, was unknown to the allocator pool. #2333's resolve_allocator keeps such a list's chained recording with the title's allocator. Once that allocator has been put aside, the title's Reset resets the PC allocator standing in for it, not the title's own, so those recordings waited for the pool to reuse it. And when the pool took that allocator for free, it knew nothing of the list, so it could release them while the list still recorded or ran on the GPU. 50205bc makes the pool take such a list on, on the PC allocator it records on, and keeps the recording there. So this branch no longer needs #2333 for ExecuteIndirect, and should not be run with #2333's resolve_allocator in execute_indirect.
  • A PC allocator put aside released its recordings only on reuse ("119 made, 119 put aside"), as you found. 551a75e releases them at the next title Reset once nothing holds the allocator: no list records on it and its submits are done.

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:

  • f4608d7 also resets the allocator (its command memory), but only at the same title allocator's Reset.
  • 551a75e releases only the chain recordings, at any title Reset, and the allocator is still reset on reuse or by #2138.
  • Because 50205bc takes on the lists the pool had not seen, its "free" also covers them.

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.

**@⁠Kalmarv** on GitHub · 2026-11-26 02:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7181303913) @⁠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`): - **Recordings filed with a title's allocator.** A list XCL makes itself, such as a mid-list split's next list, was unknown to the allocator pool. #2333's `resolve_allocator` keeps such a list's chained recording with the title's allocator. Once that allocator has been put aside, the title's Reset resets the PC allocator standing in for it, not the title's own, so those recordings waited for the pool to reuse it. And when the pool took that allocator for free, it knew nothing of the list, so it could release them while the list still recorded or ran on the GPU. `50205bc` makes the pool take such a list on, on the PC allocator it records on, and keeps the recording there. So this branch no longer needs #2333 for `ExecuteIndirect`, and should not be run with #2333's `resolve_allocator` in `execute_indirect`. - **A PC allocator put aside released its recordings only on reuse** ("119 made, 119 put aside"), as you found. `551a75e` releases them at the next title Reset once nothing holds the allocator: no list records on it and its submits are done. Unit tests show both. Our machine can't show the growth: this title chains 2 to 6 `ExecuteIndirect`s 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: - f4608d7 also resets the allocator (its command memory), but only at the same title allocator's Reset. - `551a75e` releases only the chain recordings, at any title Reset, and the allocator is still reset on reuse or by #2138. - Because `50205bc` takes on the lists the pool had not seen, its "free" also covers them. 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.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 22:29 UTC · original · edited 2026-11-26 03:11 UTC

Edited: 551a75e is pushed, rebased onto main b49be18 (#2371 merged). The hashes further down are of the commits before the rebase. New since 809da30:

  • @⁠dhillonjagdeep650-boop, thank you for 7179803338: the recordings that piled up on your RTX 3080 Ti. There were two causes, and both are fixed here.
    • A list XCL makes itself, such as a mid-list split's next list, was unknown to the allocator pool. #2333's resolve_allocator keeps such a list's chained recording with the title's allocator. The title's Reset of a swapped allocator resets the PC allocator standing in for it, not the title's own, so those recordings waited for reuse. And when the pool took that allocator for free, it could release them while the list still recorded or ran on the GPU. 50205bc takes such a list on, on the PC allocator it records on, and keeps the recording there. This replaces #2333's fallback filing for chained ExecuteIndirects, so this PR will not switch to resolve_allocator there when #2333 lands; dispatch stays #2333's.
    • A PC allocator put aside released its recordings only when the same title allocator reused it ("119 made, 119 put aside"), as you found. 551a75e releases them at the next title Reset once nothing holds the allocator.
    • The unit tests show both. Our machine does not reproduce the growth (2 to 6 chained ExecuteIndirects in 120 s here, against your 2,846), so the proof on Windows is pending; I asked you for a rerun in a reply below.
  • @⁠Royalflamejlh, thank you for 7181244718: you traced the same leak, with the case #2138 leaves out (a title's own allocator once put aside; 2,258 of your 11,061 recordings) and a candidate fix (f4608d7). 551a75e covers that case. The body says how it differs from f4608d7, and cites your numbers as a run of your change. And thank you for 7178119858. You found why the put-off ExecuteIndirects ran whole: all 32 declines were a list the pool gave no allocator. Your RECORDINGS count (11,061 under 156 allocators at 170 s) was the first sign of the pile-up. The take-on above fixes that, and its commit credits you.
  • @⁠Raul-Paiva, thank you for #505 (7178168357): 217 ExecuteIndirect whole compute PSO warnings, and four no buffer … skipped about 3 s before each removal. That fits both halves.
  • @⁠upipibi (7177047159) and @⁠razormontana (7177486333), thank you: the RTX 3070 passes at 809da30 on both, where 5ca9c23 failed 3/3. upipibi: 13 passed in 3 processes. razormontana: the fixture 3/3, and a run with the debug layer loaded. Of the Ampere cards, only the RTX 3070 Laptop is still open.
  • 0755bd7, the device test's fix for its 4 errors under GPU-based validation (below), is now pushed.
  • 073f8ea: a list created or released at an address now drops the chain scratch the old list's address held (see #2588).
  • Tested on 551a75e:
    • cargo test --workspace --no-fail-fast -- --test-threads=4 (debug, RTX 5070 Ti): 1444 passed, 0 failed, 47 ignored, 25 SKIPPED.
    • The dispatch_chain, split, execute_indirect and slab filters: 47 passed, 0 failed, 1 ignored. dispatch_chain unit tests 6, list_x 41 and alloc_pool 8 passed. With GPU-based validation, the device test's 4 errors are gone; the 1 error left (884) is from main's test that feeds an invalid blob.
    • Smoke, 60 s, XCL_DIRECT_DXIL=1, a title run beside other jobs: 1303 frames (main 1376), peak commit 20,919 MB (main 19,157), no removal, no crash; no chained ExecuteIndirect in 60 s on either side. This head alone, 120 s: 1324 frames, peak commit 30,050 MB, 6 chained ExecuteIndirects (0 whole, 0 slabs lost), no removal, no crash. Blocks in the body.

Thanks, all, and @⁠bmjask for the review. I pushed 77cfec2, then d76f773 with the read-back fix @⁠thehollowedone found and 54a936a, a fix to its test, then 809da30 on the cost of empty rounds (all below). Edited: the GPU runs on 809da30 are in, under Tested. Point by point:

@⁠ivall

  1. Overflow fallback on Ampere: predication is gone. The pieces and the whole form did not see the predicate the same way. @⁠upipibi's RTX 3070 and @⁠thehollowedone's RTX 3080 Ti show it at the first overflow case (1 group per slab, 11 rounds, 12 slabs), and the slicer's words are right on both ([1, 0, 12, 0]). The only words that match the expected output are at indices that are multiples of 4: the mode-0 lanes, whose 100000 + i store happens in the first piece and is final there. Each group has 8 such words, so 8–56 matching words (thehollowedone) and 32–40 (upipibi) are 1–7 groups. @⁠thehollowedone also saw every other word keep its initial value, so no later piece ran in any round. With one group per slab, piece 0 ran in 1–7 of the 11 rounds under a predicate (partial = 1) that should have skipped all of them. Round 0 was not one of them (word 0 stays 17 on the 3070), and the whole form, which that predicate should have let run, ran in no run (if it had, every word would match). The set changes from run to run. So on these cards, predicated ExecuteIndirects did not follow the predicate's value, in both directions, and not the same way each run. I can't tell from the outside why piece 0 is the one that slips through; the fix does not depend on it.
    @⁠upipibi's and @⁠thehollowedone's second try (the two SetPredication calls around the whole form taken out: all 400 words 0 with the guards, 3 of 3 on both cards) points the same way. That patch left the rounds' predicate (NOT_EQUAL_ZERO on the slicer's 1, cleared after the rounds) in the list. An all-zero read-back with the 0xdeadbeef guards gone means the last copy, mem → read-back, never wrote. The read-back buffer is created zeroed, and the shaders only write words below the guards. It is not a device removal: the runner's fence wait returns an error when the device is removed, and the test got values instead. CopyBufferRegion is one of the operations predication skips. So the likeliest reading is that the rounds' predicate was still in force on those cards past its clear, and it skipped both the whole form and the copy. It does not explain everything: in the unmodified runs the whole form's own predicate came last and the copy ran, yet the whole form did not. So I only conclude that predication there does not do what it is set to. This is a reading of the code, not a run on Ampere. Either way, B differs from that patch: there is no SetPredication anywhere in the list (runtime or test). The rounds get empty commands, and the whole form reads its arguments from the slicer's buffer. That is the same buffer and the same kind of unpredicated ExecuteIndirect as the cases before the overflow ones, and those passed on the 3070 (the failure was the first overflow case).
    @⁠thehollowedone's controls narrow it further. On the 3080 Ti, the slicer and the predicated whole form with no piece ExecuteIndirects before it passed (both fixtures). The whole form unpredicated after the predicated pieces failed. So there, what broke was a dispatch after the pieces' ExecuteIndirects, predicated or not. From the code, the candidates in that sequence are:

    • each piece's command signature sets root constants, which D3D12 resets to 0 after the ExecuteIndirect;
    • a SetPipelineState per piece;
    • global UAV barriers.

    The whole form doesn't read those constants, and unpredicated pieces followed by more pieces work there (the non-overflow cases pass), so I can't say which of these it is.
    The reorder I had locally (whole form first, predication cleared between) assumed only the whole form was affected, so I withdrew it. Now nothing is predicated. The slicer first counts the slabs. If they are more than the rounds and the whole form is already built, it writes empty rounds and, after its words, the title's Dispatch arguments for the whole form. Otherwise those arguments are empty. The whole form runs through ExecuteIndirect with a one-Dispatch command signature on those arguments. So exactly one of the two has groups, decided by the same shader pass that counts them. Which one can't be known when recording, so both are recorded. The whole form goes first, right after the slicer and the binding, with nothing of the chain before it: that is @⁠thehollowedone's passing control without the predicate. The rounds follow after a UAV barrier. The whole form is bound only on such an overflow, and only when it is already built. The title's own predication now gets the same choice: it predicates the slicer too, and if that is skipped, its zeroed buffer leaves both empty. This is in the feature commit (pso.rs slicer, dispatch_chain.rs, bind.rs) and the runner.
    read_back is honest with this. It counts an ExecuteIndirect as run whole only when the slicer gave the whole form the arguments and left the rounds empty. Those are the dispatches the GPU was given, not the outcome of a predicate.
    What is lost before the whole form is built (@⁠bmjask's point, and yours). An overflow before the program's whole form is built drops the slabs past the rounds. They are counted (slabs lost on the compute split line) and warned about once per program. That is a deliberate trade. The CPU can't see the slab count, since the GPU writes the arguments. So guaranteeing coverage means having the whole form when the ExecuteIndirect is recorded, which means waiting for it there. The precompile does not build whole forms of split programs, so that wait is a cold 16–40 s compile on the title's thread: the stall this PR removes. The rate before this push: in ten of our title runs of 5ca9c23, six lost slabs, 158 in total over 73,714 chained ExecuteIndirects. Every loss came from one program with 17 slabs per run: 15 at its first ExecuteIndirect, whose arguments read 0 when recorded so it got 2 rounds, then 1 at each later one (the cap was 16) until its whole form was built. The third commit changes three things:

    • An ExecuteIndirect of a program with none read back yet gets the most rounds.
    • XCL_SPLIT_INDIRECT_ROUNDS defaults to 32.
    • The whole form is asked for at the program's first chained ExecuteIndirect, built in the background, and bound only on an overflow.

    With these, all of those runs would have lost 0. More than 32 slabs before the whole form is built are still dropped, counted and warned about. The cost is the empty rounds of a program's first ExecuteIndirects (one empty ExecuteIndirect and one UAV barrier per piece and round, which I have now timed: see the reply to @⁠kanade333 below) and 44 bytes of commands per piece and round; the scratch does not grow with the rounds. A follow-up makes it exact: record in used-pipelines which programs a title ran as chained ExecuteIndirects, build their whole forms in the precompile, then wait for the whole form instead of dropping. If you'd rather have correctness now and the stall until then, I can make waiting the default in this PR; that is your call.
    The fixture's overflow cases still check this: with a whole form the output must match (and it would not if the rounds also ran, since the whole form would then read words the pieces had already changed); without one, only the rounds' groups may change.

  2. The command buffer on the error paths. Done as you describe. The first compute piece lookup, the whole form and its command signature are all taken before record_slicer. After the slicer is recorded nothing returns early: bind()'s result is kept, the rounds and the whole form are recorded only if it succeeded, and the recording that holds buffer is pushed to RECORDINGS before the error is returned. That recording is not read back, since nothing after the slicer was recorded. a_chained_execute_indirect_keeps_its_commands_when_binding_fails makes bind fail and checks that RECORDINGS holds the buffer.

  3. Rebase. Done, onto main b49be18 (above). #2333 is still open; with 50205bc this PR does not need its resolve_allocator.

@⁠pvfreis: both points were real. 2 is the fix above. 1: the whole form is now built on an xcl-pso-chain-whole thread, so a huge one waits for its turn under the huge-build gate as the workers' builds do. There is a test with every slot taken. Since the whole form is now asked for at a program's first chained ExecuteIndirect (above), it is built for every program a title runs that way. It is still bound only on an overflow, and in our runs for #2403, pipelines that were created but never bound did not seem to count toward the code in use.

@⁠KDenKC, thank you for the RTX 5090 runs of 5ca9c23 after one precompile: 0 cold compute builds of 256 KB or more against 33 on the base (30 of them whole forms of split programs), 382 and 362 chained ExecuteIndirects with 0 slabs lost, and no removal or crash.
@⁠imnicho, thank you for the RTX 5080 runs with 16 GB of RAM (#505): 141 chained ExecuteIndirects and no whole form built in any run, where the older tree spent about 50 minutes on them.

@⁠b3IKK, thank you for the RTX 5080 runs. With #2097, this PR at 5ca9c23 and #2519 (7175037954), the ExecuteIndirect line read 0 whole and 0 slabs lost, and no whole form was built at all. Thank you too for the 77cfec2 run with #2519's scratch and #2422/#2526 (7176591261): no whole forms built on the title's thread and no no buffer line, 19 wholes at 100 s instead of 64, and the removal at 102–104 s unchanged with twice the scratch total, so it is #2403's and not the scratch budget's. On the root-signature lead (7175127486), I checked our side (lines at 809da30):

  • In this PR the pieces run only on a list that has the title's allocator and is not a bundle. dispatch takes scratch only when allocator != 0 and the list is not a bundle (dispatch_chain.rs:292); otherwise it binds the whole form (:296). execute_indirect returns at :351 for the same lists, and they keep the whole form. So the owned path (no allocator, bundles) that records pieces is #2519's, not this PR's.
  • Where this PR records pieces, they run under the chain's root signature. A split program is registered with it (real.rs:4341, note_pso_rs). bind_abi looks it up (bind.rs:1081) and sets it (bind.rs:1091) before the pieces. execute_indirect calls bind_abi (dispatch_chain.rs:374) before any piece is recorded.
  • The GPU test sets the same root signature after the slicer (runner.rs:1699).
  • Our push rewrote both commits under #2519's base: 2b19fec is now 8dbeab2 and 5ca9c23 is c331369, with 77cfec2, d76f773, 54a936a and 809da30 on top. So #2519 needs a rebase onto 809da30. Your commit 50af98e applies to it without conflicts (git merge-tree); I have not built that.
  • Your DRED pass (7175305193) agrees with what we saw for #2403. With an NVIDIA profile on xcl.exe that sets 0x001ABC0F (the shader heap's VA reservation) to 1 GiB, our RTX 5070 Ti run was not removed in 300 s, with more than 392 MiB of code in use (#2403 comment). That is one run.

@⁠thehollowedone, thank you for both reports. 7175627837 answers the Ampere question for this head. At 77cfec2 the fixture passed in 4 processes on your RTX 3080 Ti with the debug layer on, and so did the binding test. Your count-buffer form (7175359633) is the same idea: the slicer chooses on the GPU and nothing is predicated. Yours writes two counts, and 77cfec2 leaves either the rounds' commands or the whole form's arguments at zero groups. On an overflow yours skips the pieces' commands, where 77cfec2 still issues the empty rounds; without one the work is the same. Since 77cfec2 passes on your card, I kept it. What that skip saves is timed below, in the reply to @⁠kanade333. Your gaps:

  • (a) An overflow before the whole form is built still drops slabs, but now only past 32 (above).
  • (b) This was fixed in 8dbeab2 (pvfreis's point 2 above). After record_slicer (dispatch_chain.rs:371), the result of bind() (:374) is kept. The recording that holds the commands buffer goes into RECORDINGS whatever bind() returned (:387), and only then is the error returned (:388). The read-back skips that recording, since its checked is false (:386, :182).
  • The read-back error you found is real. At 77cfec2, checked is bound.is_ok() alone (dispatch_chain.rs:373). Under the title's predication the slicer may not run, and its words then stay at 0 (the buffer is created zeroed, pso.rs:1377). read_back still sets measured (:186), so the program's next ExecuteIndirect whose arguments read 0 gets 2 rounds rather than 32. The buffer is new for each ExecuteIndirect, so the stale nonzero tail of your test can't happen in the runtime; the zero one can. d76f773 fixes it as you proposed. bind.rs passes the title's predication state (list_x::predicated) to execute_indirect, and checked is bound.is_ok() && !predicated. The device test now also records one predicated and one plain ExecuteIndirect and checks that only the plain one is read back. The list_x predication test checks the state through set, clear and Reset. The commit credits you.

@⁠kanade333, thank you for the RTX 5080 run (7175667429) of 5ca9c23 on main 6d12f58. On what you found:

  • no buffer for the commands of a chained ExecuteIndirect is still in 809da30 (dispatch_chain.rs:364). Each chained ExecuteIndirect creates a committed buffer for its commands, in system memory (pso.rs:1368). The buffer is kept until the allocator is reset, so the message means CreateCommittedResource failed. Your four came in the last second before the removal, at 44.4 GB of commit and 19.9 GB of video memory on a 16 GB card, so I read them as memory running out, not as the cause. These buffers take about 64 KiB each at most (one committed resource) per chained ExecuteIndirect in flight; I have not measured how many are alive at once. When this fails, bind.rs:334 skips the ExecuteIndirect, so nothing of it runs. Pooling these buffers per allocator is a follow-up.

  • The dispatch growth is not from these ExecuteIndirects. chained dispatches issued in N slabs counts the title's Dispatches run as chains (dispatch_chain.rs:305), which main already splits; 126,236 of them in 894,035 slabs is 7 slabs each. XCL_ACTIVITY counts the title's own calls, not the commands we record for them, so the rise to ~170,000 a minute is the title dispatching more.

  • The empty rounds are a real cost, and now measured. Each chained ExecuteIndirect records, per round and piece, one UAV barrier, one SetPipelineState and one ExecuteIndirect, empty or not (pso.rs:1417-1422). On the RTX 5070 Ti (NVIDIA 610.74) I timed that with GPU timestamps: one chained ExecuteIndirect, 10 pieces of an empty shader, 20 repeats, 3 processes. A round takes 144 µs, used or empty, so 2 rounds take 289 µs, 16 take 2.3 ms and 32 take 4.6 ms. Breaking a piece's step down (16 rounds × 10 pieces, median µs per step):

    step µs
    barrier, SetPipelineState, ExecuteIndirect with the chain's signature (8 root constants + Dispatch): this PR 14.4
    the same with a count buffer of 0 (@⁠thehollowedone's count form) 11.5
    the same without the barrier 0.17
    barrier, SetPipelineState, ExecuteIndirect with a Dispatch-only signature 0.41
    barrier, SetPipelineState, direct Dispatch(0, 0, 0) 0.25

    So the cost is the barrier right before an ExecuteIndirect whose signature sets root constants; why the driver is that slow there I can only guess. At your run's 168 chained ExecuteIndirects a second, 2 rounds of 8.5 pieces would already be about 40 ms of GPU each second. I can't tell from your logs how much of the 0.5 presents a second that explains, but it is enough to matter at 30 FPS. What changes:

    • In this PR (809da30): once a program's whole form is built, its rounds follow the last ExecuteIndirect read back, not the most any had. An overflow then runs the whole form, so nothing is lost. Before the whole form is built, the most is still used, since slabs past the rounds would be lost.
    • Next PR, right after this one: the pieces' ExecuteIndirects use a Dispatch-only signature. The pieces read only their slab's size and origin, the same for every piece of a round, so they get them from a root CBV that the CPU points at the round's command; the pieces' code does not change. By the table that is about 0.4 µs a step instead of 14.4; I am timing the CBV's own part before I open it. @⁠thehollowedone's count form measured 20 % less here, so it doesn't remove the cost on this card. Thank you for it all the same: it is what made me time the parts.
  • The removal at 403.5 s (DRED page fault at VA 0, no allocations) looks like the others above and in #2403.

@⁠thehollowedone, @⁠upipibi, @⁠Raul-Paiva, @⁠treybertram06: thank you. Your numbers found this: dispatch_chain_divergent_forward_edges_3d failed on all four Ampere cards (RTX 3080 Ti, 3070, 3070 Laptop, 3080) with the old, predicated head 5ca9c23. With 77cfec2 it passes on @⁠thehollowedone's RTX 3080 Ti, and with 809da30 on @⁠treybertram06's RTX 3080 (7176725432: the dispatch_chain tests 13 passed in three processes, and the test alone with XCL_D3D12_DEBUG=1). Thank you, that is the first pass on the current head. We have no Ampere card, so could the others rerun it on 809da30 and post the counts? The 3070 and 3070 Laptop are still open. The case I most need is new: no overflow, with the whole form built. The whole form's ExecuteIndirect gets empty arguments and the rounds run after it. With this push every program a title runs through a chained ExecuteIndirect has its whole form built after its first one, so this is now the common path. If that case fails, its assertion message ends in whole form true (the overflow cases say whole form for N groups); please paste it in full.

cargo test -p xcl --lib dispatch_chain -- --test-threads=1

The title removals you saw with 5ca9c23 (@⁠treybertram06: 0x887a0005 at 90, 90 and 122 s, and with #2372 too; @⁠Raul-Paiva: within seconds of the world's GPU work) fit the limit in #2403. On an RTX 5070 Ti, the device was removed when the pipelines in use reached 380–392 MiB of GetCachedBlob code, in three runs, and with the NVIDIA profile above it was not (one run). That is consistent with the limit, not proof of it. @⁠treybertram06's base run removed at 89.8 s points the same way. Split pieces are part of that code: 244 of the 380 MiB in that count. This PR binds pieces where the title's ExecuteIndirects bound whole forms before, so it can move how much code is in use either way. That was not measured.

Tested (RTX 5070 Ti, NVIDIA 610.74, Ryzen 9 9950X, Windows 11 26200, debug unless said):

  • On d76f773, on the GPU:
    • dispatch_chain_divergent_forward_edges_3d --test-threads=1, three runs: passed.
    • The dispatch_chain unit tests: 4 passed.
    • The dispatch_chain, split, execute_indirect and slab filters with XCL_D3D12_DEBUG=1: 42 passed, 0 failed, 1 ignored.
    • cargo test --workspace --no-fail-fast -- --test-threads=4: 1292 passed, 1 failed, 46 ignored, 25 SKIPPED. The failure is a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, as on main 68a284a (the same count as @⁠thehollowedone's).
    • The filters with the debug layer and GPU-based validation, on a local build of the test runner that switches GPU-based validation on and prints the layer's messages (neither is an XCL option), with --nocapture: 42 passed. The messages had 258 errors (953, 744, 712), all from the device test added in d76f773, which bound no root signature; 54a936a fixes the test. The runner registers no message callback, so plain XCL_D3D12_DEBUG=1 runs never show the layer's messages. The "debug layer on" counts in the description showed nothing for that reason, and they are out of it now.
    • Smoke, 120 s, XCL_DIRECT_DXIL=1: 1284 frames (main 1295), peak commit 28,950 MB (main 28,407), no removal, no crash.
  • On 809da30: the release build, the chain's and the predication's CPU tests (6) and clippy pass. On the GPU:
    • dispatch_chain_divergent_forward_edges_3d --test-threads=1, three runs: passed.
    • The dispatch_chain unit tests: 5 passed.
    • The dispatch_chain, split, execute_indirect and slab filters with XCL_D3D12_DEBUG=1: 43 passed, 0 failed, 1 ignored; SKIPPED dispatch_chain_native_wave64_builds_whole (no wave64).
    • The same filters with the debug layer, GPU-based validation and --nocapture, on the same local build (GPU-based validation and the messages are switched on there, not by an XCL option): 43 passed. Of the 277 messages before the exit-time live-object report, 273 are warnings (1328: a buffer's initial state is taken as COMMON; 926: a root view's address range is in a heap) and 4 are errors, all 1419 and all from the device test: its bind sets the chain's root signature on a list without descriptor heaps, which a title's list has. No other test gave an error. The test fix is now pushed (0755bd7).
    • Smoke, 120 s, XCL_DIRECT_DXIL=1: 1273 frames (main 1295), peak commit 29,533 MB (main 28,407), no removal, no crash; 2 chained ExecuteIndirects (0 whole, 0 slabs lost).
  • The empty-round timings above: RTX 5070 Ti, one local-only test with GPU timestamps, not in the PR.

Not tested: whether 551a75e stops the growth on Windows (not reproduced here, rerun asked for); NVIDIA Ampere other than the RTX 3080 Ti, 3080 and 3070; other NVIDIA generations than Blackwell and Ampere; AMD; a title run of these changes past the smoke run; the empty-round cost on any card but the RTX 5070 Ti.

AI use: Claude Code with Claude Opus 5.5 worked through the testers' numbers and the code, wrote the changes, the tests and this reply, and ran the tests.

**@⁠Kalmarv** on GitHub · 2026-11-25 22:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7176425763) · edited 2026-11-26 03:11 UTC **Edited: `551a75e` is pushed, rebased onto `main` `b49be18`** (#2371 merged). The hashes further down are of the commits before the rebase. New since `809da30`: - @⁠dhillonjagdeep650-boop, thank you for 7179803338: the recordings that piled up on your RTX 3080 Ti. There were two causes, and both are fixed here. - A list XCL makes itself, such as a mid-list split's next list, was unknown to the allocator pool. #2333's `resolve_allocator` keeps such a list's chained recording with the title's allocator. The title's Reset of a swapped allocator resets the PC allocator standing in for it, not the title's own, so those recordings waited for reuse. And when the pool took that allocator for free, it could release them while the list still recorded or ran on the GPU. `50205bc` takes such a list on, on the PC allocator it records on, and keeps the recording there. This replaces #2333's fallback filing for chained `ExecuteIndirect`s, so this PR will not switch to `resolve_allocator` there when #2333 lands; `dispatch` stays #2333's. - A PC allocator put aside released its recordings only when the same title allocator reused it ("119 made, 119 put aside"), as you found. `551a75e` releases them at the next title Reset once nothing holds the allocator. - The unit tests show both. Our machine does not reproduce the growth (2 to 6 chained `ExecuteIndirect`s in 120 s here, against your 2,846), so the proof on Windows is pending; I asked you for a rerun in a reply below. - @⁠Royalflamejlh, thank you for 7181244718: you traced the same leak, with the case #2138 leaves out (a title's own allocator once put aside; 2,258 of your 11,061 recordings) and a candidate fix (f4608d7). `551a75e` covers that case. The body says how it differs from f4608d7, and cites your numbers as a run of your change. And thank you for 7178119858. You found why the put-off `ExecuteIndirect`s ran whole: all 32 declines were a list the pool gave no allocator. Your `RECORDINGS` count (11,061 under 156 allocators at 170 s) was the first sign of the pile-up. The take-on above fixes that, and its commit credits you. - @⁠Raul-Paiva, thank you for #505 (7178168357): 217 `ExecuteIndirect whole compute PSO` warnings, and four `no buffer … skipped` about 3 s before each removal. That fits both halves. - @⁠upipibi (7177047159) and @⁠razormontana (7177486333), thank you: the RTX 3070 passes at `809da30` on both, where `5ca9c23` failed 3/3. upipibi: 13 passed in 3 processes. razormontana: the fixture 3/3, and a run with the debug layer loaded. Of the Ampere cards, only the RTX 3070 Laptop is still open. - `0755bd7`, the device test's fix for its 4 errors under GPU-based validation (below), is now pushed. - `073f8ea`: a list created or released at an address now drops the chain scratch the old list's address held (see #2588). - Tested on `551a75e`: - `cargo test --workspace --no-fail-fast -- --test-threads=4` (debug, RTX 5070 Ti): 1444 passed, 0 failed, 47 ignored, 25 SKIPPED. - The `dispatch_chain`, `split`, `execute_indirect` and `slab` filters: 47 passed, 0 failed, 1 ignored. `dispatch_chain` unit tests 6, `list_x` 41 and `alloc_pool` 8 passed. With GPU-based validation, the device test's 4 errors are gone; the 1 error left (884) is from `main`'s test that feeds an invalid blob. - Smoke, 60 s, `XCL_DIRECT_DXIL=1`, a title run beside other jobs: 1303 frames (`main` 1376), peak commit 20,919 MB (`main` 19,157), no removal, no crash; no chained `ExecuteIndirect` in 60 s on either side. This head alone, 120 s: 1324 frames, peak commit 30,050 MB, 6 chained `ExecuteIndirect`s (0 whole, 0 slabs lost), no removal, no crash. Blocks in the body. Thanks, all, and @⁠bmjask for the review. I pushed `77cfec2`, then `d76f773` with the read-back fix @⁠thehollowedone found and `54a936a`, a fix to its test, then `809da30` on the cost of empty rounds (all below). Edited: the GPU runs on `809da30` are in, under Tested. Point by point: @⁠ivall 1. **Overflow fallback on Ampere: predication is gone.** The pieces and the whole form did *not* see the predicate the same way. @⁠upipibi's RTX 3070 and @⁠thehollowedone's RTX 3080 Ti show it at the first overflow case (1 group per slab, 11 rounds, 12 slabs), and the slicer's words are right on both (`[1, 0, 12, 0]`). The only words that match the expected output are at indices that are multiples of 4: the mode-0 lanes, whose `100000 + i` store happens in the **first piece** and is final there. Each group has 8 such words, so 8–56 matching words (thehollowedone) and 32–40 (upipibi) are 1–7 groups. @⁠thehollowedone also saw every other word keep its initial value, so no later piece ran in any round. With one group per slab, piece 0 ran in 1–7 of the 11 rounds under a predicate (`partial` = 1) that should have skipped all of them. Round 0 was not one of them (word 0 stays 17 on the 3070), and the whole form, which that predicate should have let run, ran in no run (if it had, every word would match). The set changes from run to run. So on these cards, predicated `ExecuteIndirect`s did not follow the predicate's value, in both directions, and not the same way each run. I can't tell from the outside why piece 0 is the one that slips through; the fix does not depend on it. @⁠upipibi's and @⁠thehollowedone's second try (the two `SetPredication` calls around the whole form taken out: all 400 words 0 with the guards, 3 of 3 on both cards) points the same way. That patch left the rounds' predicate (`NOT_EQUAL_ZERO` on the slicer's 1, cleared after the rounds) in the list. An all-zero read-back with the `0xdeadbeef` guards gone means the last copy, `mem` → read-back, never wrote. The read-back buffer is created zeroed, and the shaders only write words below the guards. It is not a device removal: the runner's fence wait returns an error when the device is removed, and the test got values instead. `CopyBufferRegion` is one of the operations predication skips. So the likeliest reading is that the rounds' predicate was still in force on those cards past its clear, and it skipped both the whole form and the copy. It does not explain everything: in the unmodified runs the whole form's own predicate came last and the copy ran, yet the whole form did not. So I only conclude that predication there does not do what it is set to. This is a reading of the code, not a run on Ampere. Either way, B differs from that patch: there is no `SetPredication` anywhere in the list (runtime or test). The rounds get empty commands, and the whole form reads its arguments from the slicer's buffer. That is the same buffer and the same kind of unpredicated `ExecuteIndirect` as the cases before the overflow ones, and those passed on the 3070 (the failure was the first overflow case). @⁠thehollowedone's controls narrow it further. On the 3080 Ti, the slicer and the predicated whole form with no piece `ExecuteIndirect`s before it passed (both fixtures). The whole form unpredicated after the predicated pieces failed. So there, what broke was a dispatch after the pieces' `ExecuteIndirect`s, predicated or not. From the code, the candidates in that sequence are: - each piece's command signature sets root constants, which D3D12 resets to 0 after the `ExecuteIndirect`; - a `SetPipelineState` per piece; - global UAV barriers. The whole form doesn't read those constants, and unpredicated pieces followed by more pieces work there (the non-overflow cases pass), so I can't say which of these it is. The reorder I had locally (whole form first, predication cleared between) assumed only the whole form was affected, so I withdrew it. Now nothing is predicated. The slicer first counts the slabs. If they are more than the rounds and the whole form is already built, it writes empty rounds and, after its words, the title's Dispatch arguments for the whole form. Otherwise those arguments are empty. The whole form runs through `ExecuteIndirect` with a one-Dispatch command signature on those arguments. So exactly one of the two has groups, decided by the same shader pass that counts them. Which one can't be known when recording, so both are recorded. The whole form goes first, right after the slicer and the binding, with nothing of the chain before it: that is @⁠thehollowedone's passing control without the predicate. The rounds follow after a UAV barrier. The whole form is bound only on such an overflow, and only when it is already built. The title's own predication now gets the same choice: it predicates the slicer too, and if that is skipped, its zeroed buffer leaves both empty. This is in the feature commit (`pso.rs` slicer, `dispatch_chain.rs`, `bind.rs`) and the runner. `read_back` is honest with this. It counts an ExecuteIndirect as run whole only when the slicer gave the whole form the arguments and left the rounds empty. Those are the dispatches the GPU was given, not the outcome of a predicate. **What is lost before the whole form is built (@⁠bmjask's point, and yours).** An overflow before the program's whole form is built drops the slabs past the rounds. They are counted (`slabs lost` on the `compute split` line) and warned about once per program. That is a deliberate trade. The CPU can't see the slab count, since the GPU writes the arguments. So guaranteeing coverage means having the whole form when the ExecuteIndirect is recorded, which means waiting for it there. The precompile does not build whole forms of split programs, so that wait is a cold 16–40 s compile on the title's thread: the stall this PR removes. The rate before this push: in ten of our title runs of `5ca9c23`, six lost slabs, 158 in total over 73,714 chained ExecuteIndirects. Every loss came from one program with 17 slabs per run: 15 at its first ExecuteIndirect, whose arguments read 0 when recorded so it got 2 rounds, then 1 at each later one (the cap was 16) until its whole form was built. The third commit changes three things: - An ExecuteIndirect of a program with none read back yet gets the most rounds. - `XCL_SPLIT_INDIRECT_ROUNDS` defaults to 32. - The whole form is asked for at the program's first chained ExecuteIndirect, built in the background, and bound only on an overflow. With these, all of those runs would have lost 0. More than 32 slabs before the whole form is built are still dropped, counted and warned about. The cost is the empty rounds of a program's first ExecuteIndirects (one empty ExecuteIndirect and one UAV barrier per piece and round, which I have now timed: see the reply to @⁠kanade333 below) and 44 bytes of commands per piece and round; the scratch does not grow with the rounds. A follow-up makes it exact: record in `used-pipelines` which programs a title ran as chained ExecuteIndirects, build their whole forms in the precompile, then wait for the whole form instead of dropping. If you'd rather have correctness now and the stall until then, I can make waiting the default in this PR; that is your call. The fixture's overflow cases still check this: with a whole form the output must match (and it would not if the rounds also ran, since the whole form would then read words the pieces had already changed); without one, only the rounds' groups may change. 2. **The command buffer on the error paths.** Done as you describe. The `first compute piece` lookup, the whole form and its command signature are all taken before `record_slicer`. After the slicer is recorded nothing returns early: `bind()`'s result is kept, the rounds and the whole form are recorded only if it succeeded, and the recording that holds `buffer` is pushed to `RECORDINGS` before the error is returned. That recording is not read back, since nothing after the slicer was recorded. `a_chained_execute_indirect_keeps_its_commands_when_binding_fails` makes `bind` fail and checks that `RECORDINGS` holds the buffer. 3. **Rebase.** Done, onto `main` `b49be18` (above). #2333 is still open; with `50205bc` this PR does not need its `resolve_allocator`. @⁠pvfreis: both points were real. **2** is the fix above. **1**: the whole form is now built on an `xcl-pso-chain-whole` thread, so a huge one waits for its turn under the huge-build gate as the workers' builds do. There is a test with every slot taken. Since the whole form is now asked for at a program's first chained ExecuteIndirect (above), it is built for every program a title runs that way. It is still bound only on an overflow, and in our runs for #2403, pipelines that were created but never bound did not seem to count toward the code in use. @⁠KDenKC, thank you for the RTX 5090 runs of `5ca9c23` after one precompile: 0 cold compute builds of 256 KB or more against 33 on the base (30 of them whole forms of split programs), 382 and 362 chained `ExecuteIndirect`s with 0 slabs lost, and no removal or crash. @⁠imnicho, thank you for the RTX 5080 runs with 16 GB of RAM (#505): 141 chained `ExecuteIndirect`s and no whole form built in any run, where the older tree spent about 50 minutes on them. @⁠b3IKK, thank you for the RTX 5080 runs. With #2097, this PR at `5ca9c23` and #2519 (7175037954), the `ExecuteIndirect` line read 0 whole and 0 slabs lost, and no whole form was built at all. Thank you too for the `77cfec2` run with #2519's scratch and #2422/#2526 (7176591261): no whole forms built on the title's thread and no `no buffer` line, 19 wholes at 100 s instead of 64, and the removal at 102–104 s unchanged with twice the scratch total, so it is #2403's and not the scratch budget's. On the root-signature lead (7175127486), I checked our side (lines at `809da30`): - In this PR the pieces run only on a list that has the title's allocator and is not a bundle. `dispatch` takes scratch only when `allocator != 0` and the list is not a bundle (`dispatch_chain.rs:292`); otherwise it binds the whole form (`:296`). `execute_indirect` returns at `:351` for the same lists, and they keep the whole form. So the owned path (no allocator, bundles) that records pieces is #2519's, not this PR's. - Where this PR records pieces, they run under the chain's root signature. A split program is registered with it (`real.rs:4341`, `note_pso_rs`). `bind_abi` looks it up (`bind.rs:1081`) and sets it (`bind.rs:1091`) before the pieces. `execute_indirect` calls `bind_abi` (`dispatch_chain.rs:374`) before any piece is recorded. - The GPU test sets the same root signature after the slicer (`runner.rs:1699`). - Our push rewrote both commits under #2519's base: `2b19fec` is now `8dbeab2` and `5ca9c23` is `c331369`, with `77cfec2`, `d76f773`, `54a936a` and `809da30` on top. So #2519 needs a rebase onto `809da30`. Your commit `50af98e` applies to it without conflicts (`git merge-tree`); I have not built that. - Your DRED pass (7175305193) agrees with what we saw for #2403. With an NVIDIA profile on `xcl.exe` that sets `0x001ABC0F` (the shader heap's VA reservation) to 1 GiB, our RTX 5070 Ti run was not removed in 300 s, with more than 392 MiB of code in use ([#2403 comment](https://git.gtahub.st/github/xcl-dev--xcl/issues/2403)). That is one run. @⁠thehollowedone, thank you for both reports. 7175627837 answers the Ampere question for this head. At `77cfec2` the fixture passed in 4 processes on your RTX 3080 Ti with the debug layer on, and so did the binding test. Your count-buffer form (7175359633) is the same idea: the slicer chooses on the GPU and nothing is predicated. Yours writes two counts, and `77cfec2` leaves either the rounds' commands or the whole form's arguments at zero groups. On an overflow yours skips the pieces' commands, where `77cfec2` still issues the empty rounds; without one the work is the same. Since `77cfec2` passes on your card, I kept it. What that skip saves is timed below, in the reply to @⁠kanade333. Your gaps: - (a) An overflow before the whole form is built still drops slabs, but now only past 32 (above). - (b) This was fixed in `8dbeab2` (pvfreis's point 2 above). After `record_slicer` (`dispatch_chain.rs:371`), the result of `bind()` (`:374`) is kept. The recording that holds the commands buffer goes into `RECORDINGS` whatever `bind()` returned (`:387`), and only then is the error returned (`:388`). The read-back skips that recording, since its `checked` is false (`:386`, `:182`). - The read-back error you found is real. At `77cfec2`, `checked` is `bound.is_ok()` alone (`dispatch_chain.rs:373`). Under the title's predication the slicer may not run, and its words then stay at 0 (the buffer is created zeroed, `pso.rs:1377`). `read_back` still sets `measured` (`:186`), so the program's next `ExecuteIndirect` whose arguments read 0 gets 2 rounds rather than 32. The buffer is new for each `ExecuteIndirect`, so the stale nonzero tail of your test can't happen in the runtime; the zero one can. `d76f773` fixes it as you proposed. `bind.rs` passes the title's predication state (`list_x::predicated`) to `execute_indirect`, and `checked` is `bound.is_ok() && !predicated`. The device test now also records one predicated and one plain `ExecuteIndirect` and checks that only the plain one is read back. The `list_x` predication test checks the state through set, clear and `Reset`. The commit credits you. @⁠kanade333, thank you for the RTX 5080 run (7175667429) of `5ca9c23` on `main` `6d12f58`. On what you found: - **`no buffer for the commands of a chained ExecuteIndirect`** is still in `809da30` (`dispatch_chain.rs:364`). Each chained `ExecuteIndirect` creates a committed buffer for its commands, in system memory (`pso.rs:1368`). The buffer is kept until the allocator is reset, so the message means `CreateCommittedResource` failed. Your four came in the last second before the removal, at 44.4 GB of commit and 19.9 GB of video memory on a 16 GB card, so I read them as memory running out, not as the cause. These buffers take about 64 KiB each at most (one committed resource) per chained `ExecuteIndirect` in flight; I have not measured how many are alive at once. When this fails, `bind.rs:334` skips the `ExecuteIndirect`, so nothing of it runs. Pooling these buffers per allocator is a follow-up. - **The dispatch growth is not from these `ExecuteIndirect`s.** `chained dispatches issued in N slabs` counts the title's `Dispatch`es run as chains (`dispatch_chain.rs:305`), which `main` already splits; 126,236 of them in 894,035 slabs is 7 slabs each. `XCL_ACTIVITY` counts the title's own calls, not the commands we record for them, so the rise to ~170,000 a minute is the title dispatching more. - **The empty rounds are a real cost, and now measured.** Each chained `ExecuteIndirect` records, per round and piece, one UAV barrier, one `SetPipelineState` and one `ExecuteIndirect`, empty or not (`pso.rs:1417-1422`). On the RTX 5070 Ti (NVIDIA 610.74) I timed that with GPU timestamps: one chained `ExecuteIndirect`, 10 pieces of an empty shader, 20 repeats, 3 processes. A round takes 144 µs, used or empty, so 2 rounds take 289 µs, 16 take 2.3 ms and 32 take 4.6 ms. Breaking a piece's step down (16 rounds × 10 pieces, median µs per step): | step | µs | |---|---| | barrier, `SetPipelineState`, `ExecuteIndirect` with the chain's signature (8 root constants + Dispatch): this PR | 14.4 | | the same with a count buffer of 0 (@⁠thehollowedone's count form) | 11.5 | | the same without the barrier | 0.17 | | barrier, `SetPipelineState`, `ExecuteIndirect` with a Dispatch-only signature | 0.41 | | barrier, `SetPipelineState`, direct `Dispatch(0, 0, 0)` | 0.25 | So the cost is the barrier right before an `ExecuteIndirect` whose signature sets root constants; why the driver is that slow there I can only guess. At your run's 168 chained `ExecuteIndirect`s a second, 2 rounds of 8.5 pieces would already be about 40 ms of GPU each second. I can't tell from your logs how much of the 0.5 presents a second that explains, but it is enough to matter at 30 FPS. What changes: - In this PR (`809da30`): once a program's whole form is built, its rounds follow the last `ExecuteIndirect` read back, not the most any had. An overflow then runs the whole form, so nothing is lost. Before the whole form is built, the most is still used, since slabs past the rounds would be lost. - Next PR, right after this one: the pieces' `ExecuteIndirect`s use a Dispatch-only signature. The pieces read only their slab's size and origin, the same for every piece of a round, so they get them from a root CBV that the CPU points at the round's command; the pieces' code does not change. By the table that is about 0.4 µs a step instead of 14.4; I am timing the CBV's own part before I open it. @⁠thehollowedone's count form measured 20 % less here, so it doesn't remove the cost on this card. Thank you for it all the same: it is what made me time the parts. - The removal at 403.5 s (DRED page fault at VA 0, no allocations) looks like the others above and in #2403. @⁠thehollowedone, @⁠upipibi, @⁠Raul-Paiva, @⁠treybertram06: thank you. Your numbers found this: `dispatch_chain_divergent_forward_edges_3d` failed on all four Ampere cards (RTX 3080 Ti, 3070, 3070 Laptop, 3080) with the old, predicated head `5ca9c23`. With `77cfec2` it passes on @⁠thehollowedone's RTX 3080 Ti, and with `809da30` on @⁠treybertram06's RTX 3080 (7176725432: the `dispatch_chain` tests 13 passed in three processes, and the test alone with `XCL_D3D12_DEBUG=1`). Thank you, that is the first pass on the current head. We have no Ampere card, so could the others rerun it on `809da30` and post the counts? The 3070 and 3070 Laptop are still open. The case I most need is new: no overflow, with the whole form built. The whole form's `ExecuteIndirect` gets empty arguments and the rounds run after it. With this push every program a title runs through a chained `ExecuteIndirect` has its whole form built after its first one, so this is now the common path. If that case fails, its assertion message ends in `whole form true` (the overflow cases say `whole form for N groups`); please paste it in full. ``` cargo test -p xcl --lib dispatch_chain -- --test-threads=1 ``` The title removals you saw with `5ca9c23` (@⁠treybertram06: `0x887a0005` at 90, 90 and 122 s, and with #2372 too; @⁠Raul-Paiva: within seconds of the world's GPU work) fit the limit in #2403. On an RTX 5070 Ti, the device was removed when the pipelines in use reached 380–392 MiB of `GetCachedBlob` code, in three runs, and with the NVIDIA profile above it was not (one run). That is consistent with the limit, not proof of it. @⁠treybertram06's base run removed at 89.8 s points the same way. Split pieces are part of that code: 244 of the 380 MiB in that count. This PR binds pieces where the title's ExecuteIndirects bound whole forms before, so it can move how much code is in use either way. That was not measured. **Tested** (RTX 5070 Ti, NVIDIA 610.74, Ryzen 9 9950X, Windows 11 26200, debug unless said): - On `d76f773`, on the GPU: - `dispatch_chain_divergent_forward_edges_3d --test-threads=1`, three runs: passed. - The `dispatch_chain` unit tests: 4 passed. - The `dispatch_chain`, `split`, `execute_indirect` and `slab` filters with `XCL_D3D12_DEBUG=1`: 42 passed, 0 failed, 1 ignored. - `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1292 passed, 1 failed, 46 ignored, 25 SKIPPED. The failure is `a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier`, as on `main` `68a284a` (the same count as @⁠thehollowedone's). - The filters with the debug layer and GPU-based validation, on a local build of the test runner that switches GPU-based validation on and prints the layer's messages (neither is an XCL option), with `--nocapture`: 42 passed. The messages had 258 errors (953, 744, 712), all from the device test added in `d76f773`, which bound no root signature; `54a936a` fixes the test. The runner registers no message callback, so plain `XCL_D3D12_DEBUG=1` runs never show the layer's messages. The "debug layer on" counts in the description showed nothing for that reason, and they are out of it now. - Smoke, 120 s, `XCL_DIRECT_DXIL=1`: 1284 frames (`main` 1295), peak commit 28,950 MB (`main` 28,407), no removal, no crash. - On `809da30`: the release build, the chain's and the predication's CPU tests (6) and clippy pass. On the GPU: - `dispatch_chain_divergent_forward_edges_3d --test-threads=1`, three runs: passed. - The `dispatch_chain` unit tests: 5 passed. - The `dispatch_chain`, `split`, `execute_indirect` and `slab` filters with `XCL_D3D12_DEBUG=1`: 43 passed, 0 failed, 1 ignored; SKIPPED `dispatch_chain_native_wave64_builds_whole` (no wave64). - The same filters with the debug layer, GPU-based validation and `--nocapture`, on the same local build (GPU-based validation and the messages are switched on there, not by an XCL option): 43 passed. Of the 277 messages before the exit-time live-object report, 273 are warnings (1328: a buffer's initial state is taken as `COMMON`; 926: a root view's address range is in a heap) and 4 are errors, all 1419 and all from the device test: its `bind` sets the chain's root signature on a list without descriptor heaps, which a title's list has. No other test gave an error. The test fix is now pushed (`0755bd7`). - Smoke, 120 s, `XCL_DIRECT_DXIL=1`: 1273 frames (`main` 1295), peak commit 29,533 MB (`main` 28,407), no removal, no crash; 2 chained `ExecuteIndirect`s (0 whole, 0 slabs lost). - The empty-round timings above: RTX 5070 Ti, one local-only test with GPU timestamps, not in the PR. **Not tested:** whether `551a75e` stops the growth on Windows (not reproduced here, rerun asked for); NVIDIA Ampere other than the RTX 3080 Ti, 3080 and 3070; other NVIDIA generations than Blackwell and Ampere; AMD; a title run of these changes past the smoke run; the empty-round cost on any card but the RTX 5070 Ti. AI use: Claude Code with Claude Opus 5.5 worked through the testers' numbers and the code, wrote the changes, the tests and this reply, and ran the tests.
Author
Owner

@⁠pvfreis on GitHub · 2026-11-26 03:35 UTC · original

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.

**@⁠pvfreis** on GitHub · 2026-11-26 03:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7181852695) 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.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-26 03:52 UTC · original

@⁠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** on GitHub · 2026-11-26 03:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7182104337) @⁠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.
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 23:00 UTC · original · edited 2026-11-26 04:04 UTC

Update, at the current head 97a70a7: same card and setup, cargo test -p xcl --lib dispatch_chain -- --test-threads=1 --nocapture in 3 separate processes: 15 passed, 0 failed, 0 ignored each time (the 13 below plus a_list_recorded_after_another_goes_on_in_its_scratch and a_title_thread_does_not_wait_behind_a_background_whole_build_waiting_for_its_turn). dispatch_chain_divergent_forward_edges_3d passes in all three (32- and 64-thread cases); the only SKIPPED line is still dispatch_chain_native_wave64_builds_whole: no wave64, once per run. The report below is from 809da30.


@⁠Kalmarv RTX 3070 8 GB (Ampere, driver 616.56), Windows 11 26100, debug, no D3D12 debug layer, at 809da30:

cargo test -p xcl --lib dispatch_chain -- --test-threads=1, in 3 separate processes: 13 passed, 0 failed, 0 ignored each time.

  • dispatch_chain_divergent_forward_edges_3d passes in all three (both its 32- and 64-thread cases); it failed 3 of 3 on this card at 5ca9c23.
  • The new case you asked about, no overflow with the whole form built, is inside dispatch_chain_divergent_forward_edges_3d (split.rs: each (most, rounds) pair is dispatched with whole: None and with the whole form, "whole form true" in its assertion message), so it passed 3 of 3 here, on both the 32- and 64-thread fixtures. once_the_whole_form_is_built_the_last_execute_indirect_sizes_the_rounds passes in all three too.
  • SKIPPED: dispatch_chain_native_wave64_builds_whole: no wave64 (32-lane waves only), once per run.

Lib tests only; no title run.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠upipibi** on GitHub · 2026-11-25 23:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7177047159) · edited 2026-11-26 04:04 UTC **Update, at the current head `97a70a7`:** same card and setup, `cargo test -p xcl --lib dispatch_chain -- --test-threads=1 --nocapture` in 3 separate processes: **15 passed, 0 failed, 0 ignored** each time (the 13 below plus `a_list_recorded_after_another_goes_on_in_its_scratch` and `a_title_thread_does_not_wait_behind_a_background_whole_build_waiting_for_its_turn`). `dispatch_chain_divergent_forward_edges_3d` passes in all three (32- and 64-thread cases); the only `SKIPPED` line is still `dispatch_chain_native_wave64_builds_whole: no wave64`, once per run. The report below is from `809da30`. --- @⁠Kalmarv RTX 3070 8 GB (Ampere, driver 616.56), Windows 11 26100, debug, no D3D12 debug layer, at `809da30`: `cargo test -p xcl --lib dispatch_chain -- --test-threads=1`, in 3 separate processes: **13 passed, 0 failed, 0 ignored** each time. - `dispatch_chain_divergent_forward_edges_3d` passes in all three (both its 32- and 64-thread cases); it failed 3 of 3 on this card at `5ca9c23`. - The new case you asked about, no overflow with the whole form built, is inside `dispatch_chain_divergent_forward_edges_3d` (`split.rs`: each `(most, rounds)` pair is dispatched with `whole: None` and with the whole form, "whole form true" in its assertion message), so it passed 3 of 3 here, on both the 32- and 64-thread fixtures. `once_the_whole_form_is_built_the_last_execute_indirect_sizes_the_rounds` passes in all three too. - `SKIPPED`: `dispatch_chain_native_wave64_builds_whole: no wave64` (32-lane waves only), once per run. Lib tests only; no title run. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠LocranKing on GitHub · 2026-11-26 04:48 UTC · original

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.
**@⁠LocranKing** on GitHub · 2026-11-26 04:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7182924347) 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.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-26 04:55 UTC · original

@⁠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.

**@⁠Kalmarv** on GitHub · 2026-11-26 04:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7183020689) @⁠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.
Author
Owner

@⁠pvfreis on GitHub · 2026-11-25 19:07 UTC · original · edited 2026-11-26 05:11 UTC

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 + #1405 + #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.

**@⁠pvfreis** on GitHub · 2026-11-25 19:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7171860351) · edited 2026-11-26 05:11 UTC **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` + #1405 + #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.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-26 05:39 UTC · original

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 #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #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 #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 #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 #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 #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 (#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.
**@⁠futurepro62** on GitHub · 2026-11-26 05:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7183685769) 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 #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #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 #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 #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 #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 #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` (#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](https://git.gtahub.st/github/xcl-dev--xcl/issues/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.
Author
Owner

@⁠Royalflamejlh on GitHub · 2026-11-26 05:54 UTC · original

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.

**@⁠Royalflamejlh** on GitHub · 2026-11-26 05:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7183911248) 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.
Author
Owner

@⁠KDenKC on GitHub · 2026-11-26 06:16 UTC · original · edited 2026-11-26 07:43 UTC

Windows + NVIDIA data on 97a70a7: PC allocators kept being made through the run. (Edited: corrected per @⁠Kalmarv's 7185688556. The aside-vs-made ratio is ~1:1 by construction; reuse shows in resets against 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:

  • base: 97a70a73 + #2551 (3567b2e) + a local code-size log counter.
  • base + tail release: the same, plus our not-yet-opened change that releases a split program's pieces once its whole form is built (more below).

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. Wrong reading: aside ≈ made holds by construction. Reuse shows in resets against made. Run 3 had 2,048 resets for 549 made, so about 1,500 resets took an allocator again. What the numbers do show is that made kept growing (381 → 549 between 164 and 183 s in run 3; 570 → 710 by 440 s in run 4), i.e. more and more resets found none of their own free.
  • 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.

**@⁠KDenKC** on GitHub · 2026-11-26 06:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7184267294) · edited 2026-11-26 07:43 UTC **Windows + NVIDIA data on `97a70a7`: PC allocators kept being made through the run.** (Edited: corrected per @⁠Kalmarv's 7185688556. The aside-vs-made ratio is ~1:1 by construction; reuse shows in resets against 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: - **base:** `97a70a73` + #2551 (`3567b2e`) + a local code-size log counter. - **base + tail release:** the same, plus our not-yet-opened change that releases a split program's pieces once its whole form is built (more below). 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.~~ Wrong reading: aside ≈ made holds by construction. Reuse shows in resets against made. Run 3 had 2,048 resets for 549 made, so about 1,500 resets took an allocator again. What the numbers do show is that `made` kept growing (381 → 549 between 164 and 183 s in run 3; 570 → 710 by 440 s in run 4), i.e. more and more resets found none of their own free. - 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.
Author
Owner

@⁠bmjask on GitHub · 2026-11-25 20:23 UTC · original · reviewed

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.

**@⁠bmjask** on GitHub · 2026-11-25 20:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#pullrequestreview-6064422403) · **reviewed** 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.
A chained dispatch or ExecuteIndirect keeps its scratch and commands until
the PC allocator it recorded on is reset or, put aside, is free. Two runs on
other machines held thousands of them (7,410 under 115 allocators at 270 s,
2,297 of them under ones put aside) while memory grew, and neither log says
why the rest were not let go.

Every 10 s, with the counter line, a second line gives the recordings held
and made, and splits the held ones by their allocator: put aside with a list
still recording on it, with submits on the GPU, or free; in use for a
title's allocator, busy or free; or one the pool does not know.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`want_whole` started a thread for each split program whose whole form it
asked for. A huge whole form on it waits for its turn (`driver_compile`),
so the threads piled up: a run on Linux + NVIDIA had 200 of them at 280 s,
199 waiting.

The whole forms now queue on one thread for each slot set of
`driver_compile` (small, huge, giant), which builds them one after another
and ends when its queue is empty. Small ones are never gated, and at the
default of one huge compile at a time (`XCL_HUGE_PSO_CONCURRENCY`) huge or
giant ones took their turns one by one already. A title thread that needs a
whole form still builds it itself. A program released before its turn is
not built.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Until a split program's whole form is built, slabs past a chained
ExecuteIndirect's rounds are lost. The rounds were sized by the most slabs
one of its ExecuteIndirects had read back, so the 32 of 9125edb held only
until the first read-back: a program whose first ones had a slab got 2
rounds, and a later one with 22 slabs lost 20 (two runs on Linux + NVIDIA).

Before the whole form is built a chained ExecuteIndirect now records the most
rounds (`XCL_SPLIT_INDIRECT_ROUNDS`, 32) whatever was read back; once it is
built, the last one read back sizes them as before. The whole form is asked
for at the program's first chained ExecuteIndirect, so the empty rounds
last until it is built.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-26 07:39 UTC · original

@⁠Royalflamejlh @⁠pvfreis thank you both for the long runs and the numbers. They show what #2404 is for (it presents where main stops on whole-form builds) and the hold it still has.

  • @⁠pvfreis (7171860351, RTX 3060 12 GB, 97a70a7): 177 chained ExecuteIndirects, 0 whole, 0 slabs lost, no whole forms compiled, presenting again after the 135–168 s stall; but recordings held rose from 54 to 583 between 140 and 190 s, and the 37 GiB guard stopped the run at 192 s, with commit +322 MB/s and non-local video memory +214 MB/s over 170–190 s.
  • @⁠Royalflamejlh (7183911248, Linux + NVIDIA, 97a70a7): 7,410 recordings held under 115 allocators at 270 s, only 2,297 of them under ones the pool had put aside; 370 MiB of chained command buffers and 937 MiB of chain scratch.

5b9d4ff adds three commits:

  1. What holds the recordings (99ca688): every 10 s, with the counter line, a compute split: N of M recordings held, under K PC allocators: … line splits the held ones by their allocator: put aside with a list still recording on it, with submits still on the GPU, or free; in use for a title's allocator, busy or free; or one the pool does not know. On an RTX 5070 Ti I could not reach that part of the title: two 240 s runs of 97a70a7 with this line (one from an empty cache, one from our seeded one, both with pvfreis's switches) issued 0 chained dispatches and held 0 recordings. Could each of you rerun 5b9d4ff once from the same caches as before and post that line from the end of the run and from where memory starts to grow? Royalflamejlh's ~5,100 held under allocators that were not put aside are the part this line splits up.

    One cause it may show, found by reading the code: on main, a title allocator's last Release (alloc_pool::forget) drops the PC allocators made for it that a list still records on or the GPU still runs, without releasing them, so their recordings stay for the rest of the run and new PC allocators are made. Those would show as "not the pool's" on this line. #2138 fixes that case (orphaned_spares); a run with it on top would show whether that row goes away.

  2. One thread per whole form (c9904d7): not meant. The whole forms now queue on one thread for each slot set of driver_compile (small, huge, giant), which builds them one after another and ends when its queue is empty. A title thread that needs a whole form still builds it itself. Test: whole_forms_wanted_together_are_built_one_after_another_on_one_thread.

  3. 20 of 22 slabs lost with 2 rounds (5b9d4ff): right, as you read it. The rounds were sized by the most slabs read back, so 9125edb's 32 held only until the first read-back. Until the whole form is built, a chained ExecuteIndirect now records the 32 rounds whatever was read back; once it is built, the last one read back sizes them, as before. Test: once_the_whole_form_is_built_the_last_execute_indirect_sizes_the_rounds (a read-back of 1 slab before the whole form now gives 32 rounds, not 2).

The results are in the description.

AI use: Claude Code with Claude Opus 5.5 read your reports and the code, wrote the three commits and their tests, ran the tests and the runs, and wrote this reply.

**@⁠Kalmarv** on GitHub · 2026-11-26 07:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7185687777) @⁠Royalflamejlh @⁠pvfreis thank you both for the long runs and the numbers. They show what #2404 is for (it presents where `main` stops on whole-form builds) and the hold it still has. - @⁠pvfreis (7171860351, RTX 3060 12 GB, `97a70a7`): 177 chained ExecuteIndirects, 0 whole, 0 slabs lost, no whole forms compiled, presenting again after the 135–168 s stall; but recordings held rose from 54 to 583 between 140 and 190 s, and the 37 GiB guard stopped the run at 192 s, with commit +322 MB/s and non-local video memory +214 MB/s over 170–190 s. - @⁠Royalflamejlh (7183911248, Linux + NVIDIA, `97a70a7`): 7,410 recordings held under 115 allocators at 270 s, only 2,297 of them under ones the pool had put aside; 370 MiB of chained command buffers and 937 MiB of chain scratch. `5b9d4ff` adds three commits: 1. **What holds the recordings** (`99ca688`): every 10 s, with the counter line, a `compute split: N of M recordings held, under K PC allocators: …` line splits the held ones by their allocator: put aside with a list still recording on it, with submits still on the GPU, or free; in use for a title's allocator, busy or free; or one the pool does not know. On an RTX 5070 Ti I could not reach that part of the title: two 240 s runs of `97a70a7` with this line (one from an empty cache, one from our seeded one, both with pvfreis's switches) issued 0 chained dispatches and held 0 recordings. **Could each of you rerun `5b9d4ff` once from the same caches as before and post that line from the end of the run and from where memory starts to grow?** Royalflamejlh's ~5,100 held under allocators that were not put aside are the part this line splits up. One cause it may show, found by reading the code: on `main`, a title allocator's last Release (`alloc_pool::forget`) drops the PC allocators made for it that a list still records on or the GPU still runs, without releasing them, so their recordings stay for the rest of the run and new PC allocators are made. Those would show as "not the pool's" on this line. #2138 fixes that case (`orphaned_spares`); a run with it on top would show whether that row goes away. 2. **One thread per whole form** (`c9904d7`): not meant. The whole forms now queue on one thread for each slot set of `driver_compile` (small, huge, giant), which builds them one after another and ends when its queue is empty. A title thread that needs a whole form still builds it itself. Test: `whole_forms_wanted_together_are_built_one_after_another_on_one_thread`. 3. **20 of 22 slabs lost with 2 rounds** (`5b9d4ff`): right, as you read it. The rounds were sized by the most slabs read back, so `9125edb`'s 32 held only until the first read-back. Until the whole form is built, a chained ExecuteIndirect now records the 32 rounds whatever was read back; once it is built, the last one read back sizes them, as before. Test: `once_the_whole_form_is_built_the_last_execute_indirect_sizes_the_rounds` (a read-back of 1 slab before the whole form now gives 32 rounds, not 2). The results are in the description. AI use: Claude Code with Claude Opus 5.5 read your reports and the code, wrote the three commits and their tests, ran the tests and the runs, and wrote this reply.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-26 07:39 UTC · original

@⁠KDenKC thank you for the 5090 numbers (7184267294), and for stacking the tail release on #2404.

One correction to the reading, which matters for the hold: N made, M put aside now is about 1:1 by construction, so it does not show whether allocators are taken again. At a title Reset whose allocator is still busy, the one in use goes aside and the title's allocator goes on with a free one put aside earlier (aside loses one and gains one) or a new one (made and aside both grow by one). Each title allocator that was ever swapped so has all its PC allocators but one aside, whether or not they are reused. Reuse shows in resets against made: run 3 had 2,048 resets for 549 made, so about 1,500 resets took an allocator again. What your numbers do show is that made kept growing (381 to 549 between 164 and 183 s, 570 to 710 by 440 s in run 4), i.e. more resets found none of their own free.

5b9d4ff prints, with the counter line every 10 s, the recordings held and made and what holds the allocators they are under (put aside with a list on it / with submits on the GPU / free; in use busy / free; not the pool's). If you rerun, that line would say whether yours are held by lists, by the GPU, or elsewhere. One source of new PC allocators, found by reading main: a title allocator's last Release (alloc_pool::forget) drops the PC allocators made for it that are still busy, without releasing them, and the next title allocator makes new ones; #2138 fixes that case, and those would show as "not the pool's" on the line.

AI use: Claude Code with Claude Opus 5.5 read your report and alloc_pool, and wrote this reply.

**@⁠Kalmarv** on GitHub · 2026-11-26 07:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7185688556) @⁠KDenKC thank you for the 5090 numbers (7184267294), and for stacking the tail release on #2404. One correction to the reading, which matters for the hold: `N made, M put aside now` is about 1:1 by construction, so it does not show whether allocators are taken again. At a title Reset whose allocator is still busy, the one in use goes aside and the title's allocator goes on with a free one put aside earlier (`aside` loses one and gains one) or a new one (`made` and `aside` both grow by one). Each title allocator that was ever swapped so has all its PC allocators but one aside, whether or not they are reused. Reuse shows in resets against made: run 3 had 2,048 resets for 549 made, so about 1,500 resets took an allocator again. What your numbers do show is that `made` kept growing (381 to 549 between 164 and 183 s, 570 to 710 by 440 s in run 4), i.e. more resets found none of their own free. `5b9d4ff` prints, with the counter line every 10 s, the recordings held and made and what holds the allocators they are under (put aside with a list on it / with submits on the GPU / free; in use busy / free; not the pool's). If you rerun, that line would say whether yours are held by lists, by the GPU, or elsewhere. One source of new PC allocators, found by reading `main`: a title allocator's last Release (`alloc_pool::forget`) drops the PC allocators made for it that are still busy, without releasing them, and the next title allocator makes new ones; #2138 fixes that case, and those would show as "not the pool's" on the line. AI use: Claude Code with Claude Opus 5.5 read your report and `alloc_pool`, and wrote this reply.
Author
Owner

@⁠KDenKC on GitHub · 2026-11-26 07:43 UTC · original

@⁠Kalmarv thanks, you're right. I read the aside count as "not reused", and it can't say that. I've corrected 7184267294 to the resets-against-made reading. We'll rerun on 5b9d4ff with the new counter line, so it can say whether the allocators are held by lists, by the GPU or by something outside the pool, and post the line's values over time here.

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

**@⁠KDenKC** on GitHub · 2026-11-26 07:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7185772972) @⁠Kalmarv thanks, you're right. I read the aside count as "not reused", and it can't say that. I've corrected 7184267294 to the resets-against-made reading. We'll rerun on `5b9d4ff` with the new counter line, so it can say whether the allocators are held by lists, by the GPU or by something outside the pool, and post the line's values over time here. AI use: Claude Code (Claude Opus 5.5) wrote this.
Author
Owner

@⁠jennydeth on GitHub · 2026-11-26 08:24 UTC · original

RTX 3060 12 GB, head 97a70a7 against its base main b49be18: suite clean, and no regression in the default-settings pair. With XCL_DIRECT_DXIL=1 the chained path is taken: one run logged 397 ExecuteIndirects chained, 0 whole, 0 slabs lost. Every direct run, with or without this PR, then ends in a silent 0x887a0005 (DRED: page fault at VA 0x0, nothing else), within 3 s of the last 2 s window with a present.

Tested

  • NVIDIA GeForce RTX 3060 12 GB, driver 32.0.16.2101 (32-lane waves only); Ryzen 5 5600X; 32 GB RAM; Windows 11 Pro 10.0.26300.9974; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); release; DXC 1.9.2609.5 (XCL_DXC_DIR)
  • cargo test --workspace --release --no-fail-fast -- --test-threads=4 on 97a70a7: 1445 passed, 0 failed, 47 ignored (37 test targets incl. doc-tests). SKIPPED (29): 21 × no wave64; 3 × per-lane form refused (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32); 3 × no D3D12 debug layer / d3d12SDKLayers.dll; 1 × no heap windows; 1 × pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache). On the previous head 551a75e: 1444 passed, 0 failed, 47 ignored.
  • Retail title 1.0.2.1, scripts/smoke.ps1 -Game <folder> (XCL_NETWORK=0), the same scripted pad presses into the story load in every run, XCL_FRAME_DUMP=300.

Regression run (default settings, 600 s)

main b49be18:

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

This PR, 97a70a7:

xcl-smoke v1
commit: 97a70a73c96ee39cadffe1baafbc6725091277f6
gpu: NVIDIA GeForce RTX 3060
title: 9cc6a39e
seconds: 600
exit: 0x0
frames shown: 2211 (PresentX 2211)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 36162 MB
  • Neither run reaches the world: presents stop at 106 s on the base and 108 s with this PR.
  • With default settings no program is split, so this pair does not reach the PR's code. The head logs compute split: 0 programs split … ExecuteIndirect: 0 chained (0 of them whole, 0 slabs lost), 0 whole; the base's line has no ExecuteIndirect part.
  • The main run was made after the PR run and after the game folder was renamed, so both blocks share the title hash (earlier runs on this machine show 4a4b54dc).

Direct DXIL (XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_DRED=1, 900 s):

  • The driver cache was warmed by a precompile of every compute pipeline on main 08db802 and by earlier runs: 319–326 driver blobs supplied, 2–4 absent in each run.
main b49be18 551a75e 97a70a7 run 1 97a70a7 run 2
last 2 s window with a present 114 s 110 s 102 s 96 s
device removed (0x887a0005) 114.8 s 112.3 s 104.4 s 99.0 s
ExecuteIndirect in the last compute split line – 86 chained, 0 whole, 0 lost (110.0 s) 0 chained (100.0 s) 397 chained, 0 whole, 0 lost (100.2 s, logged after the removal; 0 at 90 s)
DRED VA 0x0, nothing the same the same the same
  • At the removal in two of the PR runs, a cold whole form was compiling on xcl-pso-chain-whole: the same record, 980,948 B of DXIL, driver blob absent. It started at 111.0 s in the 551a75e run (#4168) and at 103.5 s in 97a70a7 run 1 (#4183). The crash's thread dumps show that thread inside nvgpucomp64.dll, as were the four D3D Background Threads.
  • In these runs the head ends the same way as the base, the way #2403 describes.

Not tested

  • Pictures of the chained work (no frame was dumped after 100 s); the predicated whole-form case (0 whole in every run); a cold cache with direct DXIL on this head; AMD / wave64; Wine

AI use: Claude Code (Claude Opus 5.5) built the commits, ran the suites and the runs on my machine, read the logs and wrote this.

**@⁠jennydeth** on GitHub · 2026-11-26 08:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7186546943) **RTX 3060 12 GB, head `97a70a7` against its base `main` `b49be18`: suite clean, and no regression in the default-settings pair. With `XCL_DIRECT_DXIL=1` the chained path is taken: one run logged 397 `ExecuteIndirect`s chained, 0 whole, 0 slabs lost. Every direct run, with or without this PR, then ends in a silent `0x887a0005` (DRED: page fault at VA 0x0, nothing else), within 3 s of the last 2 s window with a present.** **Tested** - NVIDIA GeForce RTX 3060 12 GB, driver 32.0.16.2101 (32-lane waves only); Ryzen 5 5600X; 32 GB RAM; Windows 11 Pro 10.0.26300.9974; Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`); release; DXC 1.9.2609.5 (`XCL_DXC_DIR`) - `cargo test --workspace --release --no-fail-fast -- --test-threads=4` on `97a70a7`: **1445 passed, 0 failed, 47 ignored** (37 test targets incl. doc-tests). SKIPPED (29): 21 × no wave64; 3 × per-lane form refused (`V_MUL_F16`, `V_PK_MUL_F16`, `V_CVT_F16_F32`); 3 × no D3D12 debug layer / `d3d12SDKLayers.dll`; 1 × no heap windows; 1 × `pso_measurement_compiles_an_exact_synthetic_record` (cannot disable the driver cache). On the previous head `551a75e`: 1444 passed, 0 failed, 47 ignored. - Retail title 1.0.2.1, `scripts/smoke.ps1 -Game <folder>` (`XCL_NETWORK=0`), the same scripted pad presses into the story load in every run, `XCL_FRAME_DUMP=300`. **Regression run** (default settings, 600 s) `main` `b49be18`: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 3060 title: 9cc6a39e seconds: 600 exit: 0x0 frames shown: 2171 (PresentX 2171) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 35030 MB ``` This PR, `97a70a7`: ``` xcl-smoke v1 commit: 97a70a73c96ee39cadffe1baafbc6725091277f6 gpu: NVIDIA GeForce RTX 3060 title: 9cc6a39e seconds: 600 exit: 0x0 frames shown: 2211 (PresentX 2211) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 36162 MB ``` - Neither run reaches the world: presents stop at 106 s on the base and 108 s with this PR. - With default settings no program is split, so this pair does not reach the PR's code. The head logs `compute split: 0 programs split … ExecuteIndirect: 0 chained (0 of them whole, 0 slabs lost), 0 whole`; the base's line has no `ExecuteIndirect` part. - The `main` run was made after the PR run and after the game folder was renamed, so both blocks share the title hash (earlier runs on this machine show `4a4b54dc`). **Direct DXIL** (`XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_DRED=1`, 900 s): - The driver cache was warmed by a precompile of every compute pipeline on `main` `08db802` and by earlier runs: 319–326 driver blobs supplied, 2–4 absent in each run. | | `main` `b49be18` | `551a75e` | `97a70a7` run 1 | `97a70a7` run 2 | |---|---:|---:|---:|---:| | last 2 s window with a present | 114 s | 110 s | 102 s | 96 s | | device removed (`0x887a0005`) | 114.8 s | 112.3 s | 104.4 s | 99.0 s | | `ExecuteIndirect` in the last `compute split` line | – | 86 chained, 0 whole, 0 lost (110.0 s) | 0 chained (100.0 s) | 397 chained, 0 whole, 0 lost (100.2 s, logged after the removal; 0 at 90 s) | | DRED | VA 0x0, nothing | the same | the same | the same | - At the removal in two of the PR runs, a cold whole form was compiling on `xcl-pso-chain-whole`: the same record, 980,948 B of DXIL, driver blob absent. It started at 111.0 s in the `551a75e` run (#4168) and at 103.5 s in `97a70a7` run 1 (#4183). The crash's thread dumps show that thread inside `nvgpucomp64.dll`, as were the four `D3D Background Thread`s. - In these runs the head ends the same way as the base, the way #2403 describes. **Not tested** - Pictures of the chained work (no frame was dumped after 100 s); the predicated whole-form case (0 whole in every run); a cold cache with direct DXIL on this head; AMD / wave64; Wine AI use: Claude Code (Claude Opus 5.5) built the commits, ran the suites and the runs on my machine, read the logs and wrote this.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-26 08:26 UTC · original

Thanks @⁠jennydeth for the RTX 3060 run of 97a70a7 against main. It is now under Tested in the description, as a run of 97a70a7; the head is now 5b9d4ff.

With XCL_DIRECT_DXIL=1, the 0x887a0005 removal (page fault at VA 0x0) also ends your main b49be18 run, at about the same time (114.8 s, against 99.0–104.4 s with this PR). So it is not from this PR; it looks like the removals in #2403.

If you are willing, one more direct-DXIL run on 5b9d4ff would help, with no main side needed. 5b9d4ff adds a second compute split line every 10 s: compute split: N of M recordings held, under K PC allocators: …. It says what holds the chain's recordings: put aside or in use, busy or free, or not the pool's. The last few of those lines before the removal are what I would look at.

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

**@⁠Kalmarv** on GitHub · 2026-11-26 08:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7186587632) Thanks @⁠jennydeth for the RTX 3060 run of `97a70a7` against `main`. It is now under **Tested** in the description, as a run of `97a70a7`; the head is now `5b9d4ff`. With `XCL_DIRECT_DXIL=1`, the `0x887a0005` removal (page fault at VA 0x0) also ends your `main` `b49be18` run, at about the same time (114.8 s, against 99.0–104.4 s with this PR). So it is not from this PR; it looks like the removals in #2403. If you are willing, one more direct-DXIL run on `5b9d4ff` would help, with no `main` side needed. `5b9d4ff` adds a second `compute split` line every 10 s: `compute split: N of M recordings held, under K PC allocators: …`. It says what holds the chain's recordings: put aside or in use, busy or free, or not the pool's. The last few of those lines before the removal are what I would look at. AI use: Claude Code with Claude Opus 5.5 read your report and wrote this reply.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-26 08:51 UTC · original

Thanks @⁠thehollowedone for rechecking the current head 5b9d4ff on the RTX 3080 Ti: 1447 passed, 0 failed, 47 ignored, and dispatch_chain_divergent_forward_edges_3d passed with no skip. It is now under Tested in the description, and the Ampere line under Not tested names this head.

As you say, it doesn't cover more than 32 slabs being lost before the whole form is built. That case is still open: those slabs are counted and warned about, and the description says so under the slab-loss commit.

AI use: Claude Code with Claude Opus 5.5 wrote this reply.

**@⁠Kalmarv** on GitHub · 2026-11-26 08:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/2404#issuecomment-7187101951) Thanks @⁠thehollowedone for rechecking the current head `5b9d4ff` on the RTX 3080 Ti: 1447 passed, 0 failed, 47 ignored, and `dispatch_chain_divergent_forward_edges_3d` passed with no skip. It is now under **Tested** in the description, and the Ampere line under **Not tested** names this head. As you say, it doesn't cover more than 32 slabs being lost before the whole form is built. That case is still open: those slabs are counted and warned about, and the description says so under the slab-loss commit. AI use: Claude Code with Claude Opus 5.5 wrote this reply.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2404/head:github-bot/gh-2404'
git switch 'github-bot/gh-2404'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2404'
git switch 'github-bot/gh-2404'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2404'
git switch 'github-bot/gh-2404'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2404'
git switch 'main'
git merge --squash 'github-bot/gh-2404'
git switch 'main'
git merge --ff-only 'github-bot/gh-2404'
git switch 'main'
git merge 'github-bot/gh-2404'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.