Repository navigation
Conversation
An ExecuteIndirect of a compute program that the recompiler split into pieces fell back to the program's whole form, and that form was compiled on the recording thread when first needed. On an RTX 5070 Ti with XCL_DIRECT_DXIL=1 a retail title stalls its world load on it: 11 per-material programs, 9-14 pieces each, each dispatched through ExecuteIndirect, each whole form 690-950 KB of DXIL taking 16-40 s to compile, one after another from 326 s to past 600 s. The title's ExecuteIndirects of split programs all have one command signature: one Dispatch, stride 12, MaxCommandCount 1, no count buffer (150 of them in 360 s). Their group counts are written on the GPU, so the CPU cannot slice them when recording. The ExecuteIndirect now runs the chain on the GPU. A small compute pass (pso::record_slicer) reads the title's arguments (and count) and writes, for a fixed number of rounds, one command per piece of each slab of dispatch_slabs (the root constants of record_dispatch_chain, then the slab's group counts); unused rounds get empty dispatches. Each piece then runs one ExecuteIndirect per round with the chain's command signature, with UAV barriers between them, in the bounded scratch. The rounds come from the arguments the CPU sees now and the most slabs an earlier ExecuteIndirect of the program had, plus a quarter (2 to XCL_SPLIT_INDIRECT_ROUNDS, 16). When the arguments need more slabs 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 (xcl-dev#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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
…s whole form 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, xcl-dev#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 <noreply@anthropic.com>
…ot read back 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 (xcl-dev#2404). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nature 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 <noreply@anthropic.com>
…Indirect sizes the rounds 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
…track With the allocator pool on, `execute_indirect` kept the recording with the PC allocator the list records on (`alloc_pool::recording_backing`). For a list the pool does not track it got 0, so it returned Ok(false) and the ExecuteIndirect ran its whole form. XCL makes such lists itself: a mid-list split's next list is created on `alloc_pool::current(alloc)` with no `created_on`. Under Wine + vkd3d-proton on an RTX 4060 Ti, this branch chained 2 ExecuteIndirects and ran 26-30 whole in three runs of a title, and the title presented nothing after its loading burst. In a fourth run with a log line, all 32 that declined did so for this reason. Such a list is now taken on by the pool, on the PC allocator the title's allocator stands for, which is the one the list was made on (`alloc_pool::recording_backing_or_take_on`), and the recording is kept there. xcl-dev#2333 keeps these recordings with the title's allocator instead (its `resolve_allocator`). The pool then knows nothing of the list, so it can take that allocator for free and release the recordings (scratch and commands buffer) while the list still records or runs on the GPU. Taken on, the list keeps its backing busy until it is reset elsewhere or released, and its submits mark the backing like any other list's. The title's allocator also gets the list's type, so that a Reset while the list holds its backing swaps it like the title's own lists. Reported by @Royalflamejlh (xcl-dev#2404). With xcl-dev#2333 merged under this branch and its fallback in `execute_indirect`, every ExecuteIndirect chained in four runs (22 to 70,341 of them, 0 whole). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The chains of one recording share one scratch, which `dispatch_chain` finds by the list's address (`SHARED`). Only a list's Reset forgot it. Addresses are reused (xcl-dev#2588). A list created at the address of a released one, on the same allocator while the old recordings were still held, found the old list's scratch and shared it with work the GPU may still be running. A chained ExecuteIndirect takes its scratch the same way. `list_x` now forgets the entry when a list is created and when it is released, with a unit test that fails without the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e free A chained ExecuteIndirect keeps its slicer scratch and commands buffer with the recording of its PC allocator until that allocator is reset (dispatch_chain::allocator_reset, from reset_pc_allocator) or released. When the title resets an allocator whose recording is still held or on the GPU, alloc_pool puts the PC allocator aside and gives the title another. The one put aside is reset only when the same title allocator is reset again and reuses it, which may never happen. Until then its recordings, and the memory they keep, stay. dhillonjagdeep650-boop found it on an RTX 3080 Ti (xcl-dev#2404): 1,887 recordings under 48 allocators at 110 s, local and non-local memory growing about 150 MB/s, then a device removal at 110.8 s. The allocator log said 119 made and 119 put aside. Every title Reset now also releases the recordings of each PC allocator put aside that nothing holds any more: no list records on it and its submits are done. This happens outside the pool's lock. allocator_reset of an allocator without recordings does nothing, and the allocator is reset as before when it is reused. This relies on every chained recording being filed with the PC allocator its list records on, and on that list being known to the pool (an earlier commit here takes on the lists it had not seen). A recording filed with a title's allocator, as xcl-dev#2333's lines file one, would go when that allocator is free, while its list still records or runs on the GPU elsewhere. The first test fails without the sweep: the free allocator put aside still holds its recordings after another title allocator's Reset. Two more show that a taken-on list's recording stays while the list records on its allocator put aside and while its submit runs, and goes after both; and that a free title allocator put aside does not take a live list's recording with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s turn `want_whole` builds a split program's whole form on `xcl-pso-chain-whole`, an `xcl-pso*` thread, so a huge one waits in `big_compile_turn` for a background slot and 3 GB of free commit, with no timeout. It waits holding `Chain::build_whole`, and nothing on that thread says a title thread waits for it (`pso_async::build_is_wanted` reads only a worker's build). So a title thread that needs the same whole form meanwhile (`bind.rs` for an ExecuteIndirect it cannot chain, `dispatch` without scratch) blocked on the mutex until the background turn came. It got neither the wanted cap nor the commit skip of a build the title waits for, where before `want_whole` it compiled at once (found by @pvfreis in the review of xcl-dev#2404). A title thread now counts itself in `Chain::waiting` while it waits for the whole form, and `want_whole`'s build runs in `pso_async::build_waited_on`, so `build_is_wanted` is true on that thread while one does. The background build then goes as one the title waits for, and the title thread gets the form when it is built. The test fills the background slots, starts the build and asks for the form on another thread: without the count it waited until the slots were freed ("the title thread waited for the background build's turn"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1202ac1 to
acba153
Compare
|
Focused RX 6800M check on clean PR head $env:XCL_ADAPTER = '6800M'
$env:XCL_REQUIRE_GPU = 'wave64'
cargo test --locked -p xcl --lib dispatch_chain_divergent_forward_edges_3d -- --test-threads=1 --show-outputResult: 1 passed, 0 failed, 0 ignored, 1,346 filtered, 0
This is the focused synthetic split AI use: OpenAI Codex (GPT-6; exact serving variant unavailable) and a Luna subagent selected and ran the test, verified the live head and adapter, and prepared this report. |
|
Wine/NVIDIA cross-check of the new test — passes on the real adapter. Head
Scope: correctness fixture only — the 15.3 µs → 0.41 µs |
|
@pickles976 thank you for the Wine cross-check on AI use: Claude Code with Claude Opus 5.5 read the report and wrote this reply. |
With the CPU-scaled default, huge_pso_concurrency is 4 on a 16-thread machine while huge_pso_wanted_concurrency stayed base.max(2), also 4: with four background huge compiles running, a build a title thread waits for had no slot of its own and queued behind them. The wanted default is now one more than the background concurrency, as it was when that was 1. Found by xcl-dev#2633's a_title_thread_does_not_wait_behind_a_background_whole_ build_waiting_for_its_turn, which fails with this branch merged and passes with XCL_HUGE_PSO_CONCURRENCY=1 or XCL_HUGE_PSO_WANTED_CONCURRENCY=5. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
luckyteagirl
left a comment
There was a problem hiding this comment.
Could the free constants pool have a byte budget, or release oversized blocks on allocator reset? Every block removed from CONSTANTS is retained in process-global FREE_CONSTANTS; reuse requires the same device and sufficient capacity, and I could not find a trim or device-cleanup path. A temporary burst of large slab constants can therefore leave its committed upload resources mapped for the rest of the process, even after the recording allocators retire. The reuse fixture could also assert that excess blocks are released. Exact-head source review at acba153caf086ef0e0ebe4cda4e76b7216217fc3; no measured memory footprint or title run. AI-assisted review with Codex.
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 <noreply@anthropic.com>
…d each `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 <noreply@anthropic.com>
…ole form is built 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 <noreply@anthropic.com>
|
Source review of The pieces' DXIL doesn't change here, only their root signature does (parameter 7 goes from 8 root constants to a root CBV in When we run it, we'll give each side its own cache. My 5090 and I await the root-CBV era. AI use: Gemini (Antigravity) noticed the shared file name in a review; Claude Code (Claude Opus 5.5) checked |
acba153 to
db34184
Compare
|
@luckyteagirl thank you for the review (6069221831): right, nothing ever released a block once it was in @KDenKC thank you (7184414003), that was a real gap: the pieces' DXIL is the same under this PR, so a AI use: Claude Code with Claude Opus 5.5 wrote both changes, their assertions and this reply, and ran the tests. |
|
RX 9070 / RADV paired check of #2633 Tested Ryzen 7 7700, RX 9070, CachyOS Linux 7.3.0-5-cachyos, RADV Mesa 26.3.1-arch3.5, GE-Proton11-12 / Wine 11.0, vkd3d-proton Built both exact revisions with The counts below were identical in both thread modes. Filters are under
Zero ignored tests and zero
Local GPU-timestamp diagnostic Separate local copies add test-only repetition/timestamp instrumentation to Indirect samples cover the command-buffer transition back to UAV, the slicer and all 32 rounds of 10 pieces, with at most one group per slab. The direct control has 12 slabs of 10 pieces. PSO creation, allocation, initial uploads, final readback and CPU recording time are outside the timestamps. Five paired trials alternate A/B and B/A. Each case runs eight batches of 17 repetitions; discard two warmup batches and the first repetition of each remaining batch, keeping 96 samples per trial per case. GPU microseconds per complete operation, median of the five trial medians; brackets give their min/max:
All ten diagnostic invocations passed: one test each, zero failed, ignored or skipped. Indirect operations take less GPU time in every paired trial. The 32-thread direct control takes 19.8% more at the reported medians, and more in every pair. The 64-thread direct result has larger variation. These are synthetic command-path results, not the author's per-step benchmark or a title-speed measurement; the direct-control difference has no established root cause. Not tested Native Windows, the full workspace suite, retail workloads or AI use OpenAI Codex (GPT-6; exact serving variant unavailable) audited the diffs, prepared and ran the comparisons and local diagnostic, checked the logs and drafted this report for user review. |
A chained ExecuteIndirect records, per round and piece, a UAV barrier, the piece's pipeline and an ExecuteIndirect whose command signature sets the eight root constants of the slab. On an RTX 5070 Ti (NVIDIA 610.74) such an ExecuteIndirect after the barrier takes 15.3 us of GPU time, empty or not: 32 rounds of 10 pieces are 4.9 ms, every time (xcl-dev#2404). With a Dispatch-only signature it takes 0.41 us; a barrier only to the scratch does not help (15.3 us). The pieces read only the slab's size and origin (`split.rs`, `Slab::new`), the same for every piece of a round. So the chain's root signature takes them as a root CBV (b0 space2, the register the pieces already read) instead of root constants, and the pieces do not change: - ExecuteIndirect: the slicer writes one 256-byte command a round (the slab's constants, its Dispatch 32 bytes in) instead of one 44-byte command per piece; the CPU points the CBV at the round's command, and the pieces' ExecuteIndirects take the Dispatch-only signature. The buffer for 32 rounds is 8 KiB, whatever the pieces. - Dispatch: the CPU writes the slabs' constants into 64 KiB upload-heap blocks of the list's allocator, used again once it is reset; without one the whole form runs, as without scratch. Only blocks of 64 KiB are kept for use again, up to 8 MiB of them; bigger ones and those past it are released at the reset. The pieces' DXIL is the same as before, so a piece's driver blob kept on disk now also names the chain's root signature (a hash of it serialized, with the program's static samplers): one built for the root constants or for other samplers is not read and refused, and the pieces are not compiled again for that in every first run. Measured on the RTX 5070 Ti, GPU timestamps, 16 rounds x 10 pieces, median per piece step: ExecuteIndirect, root constants (before) 15.3 us empty, 15.6 us with one group ExecuteIndirect, root CBV, Dispatch-only 0.41 us empty, 1.01 us with one group Dispatch, root constants (before) 0.25 us empty, 0.61 us with one group Dispatch, root CBV in the upload heap 0.25 us empty, 0.61 us with one group Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…slab (port upstream xcl-dev#2519 + xcl-dev#2633) (cherry picked from commit 6bab0c8b5b95432a48c1979cc8a4e6e1fa1672aa)
db34184 to
19be659
Compare
|
Thanks @SzczepanGrela for the paired RX 9070 / RADV run of Direct, 12 groups, slower with this PR. This PR does change the direct path. With #2404, every piece got the slab's eight words as root constants ( On the RTX 5070 Ti, in a local test that times this PR's
Both take 73.66 µs, about 0.61 µs per dispatch after its barrier, so on this card the root CBV costs nothing measurable. I have not found the cause on RADV. One possibility is that a root CBV is read from memory where root constants are not: under vkd3d-proton, root constants become push constants, and the upload heap is host-visible memory. I can't measure RADV here.
AI use: Claude Code with Claude Opus 5.5 read the code, ran the local timing test on the hardware above and wrote this reply. |
|
Each side had its own
Not tested: more runs; DRED breadcrumbs from a run that hangs; the 1 GiB heap profile (every run here ends at the #2403 removal by ~135 s). Your minion's 5090 survived its first root-CBV adventure, mostly. AI use: Claude Code (Claude Opus 5.5) built and ran the arms. Gemini (Antigravity) compared the logs. Claude Code checked the table and the compile timeline against the logs and wrote this. |
PR xcl-dev#2633 changed every split pipeline to a root CBV, including direct dispatches that regressed on RADV. Prepare an indirect-only variant instead: retain the existing direct root constants and legacy driver-cache identity while defining a distinct CBV root layout and cache namespace for indirect pipeline states. This is deliberately wiring-only. The indirect pipeline must be built as a separate PSO because D3D12 pipeline states are tied to their root signatures. Assisted-by: Codex (GPT-5.6-sol)
|
Thanks @KDenKC for the paired runs, and for checking the cache: only Why about 3.4× the chained The hang. It is one in two runs, and as you say it doesn't separate this PR from more GPU work reaching the card. One chained The current head AI use: Claude Code with Claude Opus 5.5 read the report against XCL's code and wrote this reply. |
|
@Kalmarv it's more calls per frame, not more frames. Presents summed from the 2 s activity lines:
So in about the same number of frames, this head issues 3.4-3.9× the chained calls. We are running two more runs of each side with DRED on to get a hang rate, and will add them here. AI use: Claude Code (Claude Opus 5.5) summed the log lines and wrote this. |
|
Thanks @KDenKC for the presents. They show my reading was wrong: it is not more frames, since both sides presented about as many. So this head issues 3.4–3.9× the chained calls in the same frames, and I don't have the cause yet. Both heads use the same rule for whether a title's
AI use: Claude Code with Claude Opus 5.5 read the code and wrote this comment. |
|
Hang rate, as promised in 7191725182: four more runs with
AI use: Claude Code (Claude Opus 5.5) ran them, checked the end lines in the logs and wrote this. |
|
@Kalmarv from the logs: the base did not drop calls before 130 s. The full
There are no AI use: Claude Code (Claude Opus 5.5) pulled the lines and wrote this. |
|
On your 7191771397, from Linux + NVIDIA, 3 runs a side: in the same 20 s after each run's first world frame, this PR issued 2.6–4.2× the chained Setup: 3 of each side's runs from our #2404 report (7188240609): RTX 4060 Ti 16 GB, NVIDIA 615.71.09, Wine 11.21 Staging, vkd3d-proton
Not tested: Windows; your new head AI use: Claude Code (Claude Opus 5.5) made and read the runs and wrote this. Posted without review by a person: the account owner was away and reads replies later. |
|
Thanks @KDenKC and @Royalflamejlh. @KDenKC (7192378903 and the four DRED runs in 7191832423): neither side skipped a call or ran one whole before 130 s, so the difference is not calls the base dropped. It is not how they are counted either. On both heads, "chained @Royalflamejlh (7192638615): in the 20 s after the first world frame, this PR had 2.6–4.2× the chained calls and 2.6–3.7× the presents. That is about the same per present (408–476 against 372–407), with no dropped calls. It fits the count above: the extra calls come with extra world frames, which on your setup would make this PR faster in the world. What these runs don't separate:
Both are now under Tested by others in the description. AI use: Claude Code with Claude Opus 5.5 read the code and the two reports and wrote this reply. |
|
@Kalmarv the
On this rig, then, it is about 4-5× the calls per world frame, not more frames. That differs from @Royalflamejlh's Linux runs, where calls per present matched. Caveats:
AI use: Claude Code (Claude Opus 5.5) pulled the lines and wrote this. |
|
Thanks @KDenKC. I don't think the 120–130 s window can give calls per world frame. At 13–65 calls per present, most of those presents look like loading-screen frames (@Royalflamejlh's world frames had about 400 each). And with the counter every 10 s, a world that starts a few seconds earlier in the window gets more calls against about the same presents. Optional, only if it's quick from the lines you have: each run's first world frame (the first present after the pause that follows the load burst, from the 2 s activity lines) and the presents from there to 130 s. AI use: Claude Code with Claude Opus 5.5 wrote this reply. |
|
@Kalmarv fair point. From the 2 s activity lines I can't place a first world frame in these runs: there is no clear pause. Presents per 2 s, 96-130 s: The rate just falls off from ~55 to ~0 over 100-126 s, and the chained calls all come in 120-130 s, when the title shows 0-28 frames per 2 s. So I agree the per-present numbers I gave say little about world frames. These runs end at the #2403 removal before the world settles. The frame dumps could show where the world starts if that's worth it. AI use: Claude Code (Claude Opus 5.5) pulled the lines and wrote this. |
Prime1997
left a comment
There was a problem hiding this comment.
Hold this draft pending an attributable chain run. I reviewed the root-CBV change in the top commit separately from the #2404 stack, which remains open. The top commit still conflicts with NVIDIA af2cecc4 in pso.rs, runner.rs, and dispatch_chain.rs. The posted RTX 5070 Ti suite is useful, but the title smoke at this revision reached zero chained dispatches.
The earlier db34184 comparisons also showed different numbers of chained calls at similar presentation counts. Please compare the rebased parent and top commit on the same shader workload and cache state. Capture direct and indirect timings, plus the chained, whole-form, and skipped counts, so the comparison can distinguish per-call overhead from a change in which calls actually ran. Current main at review time was 8b957bec.
AI use: Codex (GPT-6) reviewed the pinned changes and verified the reported evidence. Optional temporary Discord for coordinating contributor work, testing, and comparing results.
PR xcl-dev#2633 changed every split pipeline to a root CBV, including direct dispatches that regressed on RADV. Prepare an indirect-only variant instead: retain the existing direct root constants and legacy driver-cache identity while defining a distinct CBV root layout and cache namespace for indirect pipeline states. This is deliberately wiring-only. The indirect pipeline must be built as a separate PSO because D3D12 pipeline states are tied to their root signatures. Assisted-by: Codex (GPT-5.6-sol)
|
Independent native-Windows NVIDIA check of Tests, 3 runs per side:
Premise. Standalone timestamp bench. One step is a UAV barrier,
So Ampere shows the same gap as the 5070 Ti numbers in the description (15.3 µs against 0.41 µs). The three runs agree to within 0.01 µs at the median. Limits: the bench's root signature has two parameters, not the chain's full one; its arguments live in an upload heap; and GPU clocks were not locked. No Raw medians per run, µs per step over 160 steps (runs 1 / 2 / 3), empty group then 1 group:
AI-assisted (Claude Code, Claude Opus 5.5). |
Stacked on #2404; only the top commit (
19be659) belongs here.A chained
ExecuteIndirect(#2404) records, for each round and piece, a UAV barrier, the piece's pipeline and anExecuteIndirectwhose command signature sets the slab's eight root constants. On the RTX 5070 Ti such anExecuteIndirectafter the barrier takes 15.3 µs of GPU time, empty or not, so 32 rounds of 10 pieces cost 4.9 ms every time. With a Dispatch-only signature it takes 0.41 µs. The pieces read only the slab's size and origin, the same for every piece of a round, so the chain's root signature now gives them as a root CBV (b0, space2, the register the pieces already read) instead of root constants. The pieces' code does not change.What is in it
D3D12.X: the pieces of a split program read their slab from a root CBV(19be659), inpso.rs,runner.rs,dispatch_chain.rs,real.rsandshaders.rs, with unit tests:ExecuteIndirect: the slicer writes one 256-byte command a round (the slab's constants, its Dispatch 32 bytes in) instead of one 44-byte command per piece. The CPU points the CBV at the round's command, and the pieces'ExecuteIndirects use the Dispatch-only signature. The commands buffer for 32 rounds is 8 KiB, whatever the number of pieces.Dispatch: the CPU writes the slabs' constants into 64 KiB upload-heap blocks of the list's allocator, used again once it is reset. A list with no allocator runs the whole form, as without scratch. Only blocks of 64 KiB are kept for use again, up to 8 MiB of them; bigger blocks and those past it are released at the reset (keep_free_constants; review by @luckyteagirl).pso::abi_signature_id, indriver_cache::name_for; the precompile names it the same way). A blob built for D3D12.X: an ExecuteIndirect of a split program runs its pieces #2404's root constants, or for other static samplers, is then not read and refused, and D3D12.X: an ExecuteIndirect of a split program runs its pieces #2404's and this PR's files sit side by side in one cache (review by @KDenKC; the samplers after D3D12.X: share dispatch-chain root signatures per device and key compute blobs on NodeMask #2723).Tested
Ryzen 9 9950X, RTX 5070 Ti (NVIDIA 610.74), Windows 11 build 26200, rustc 1.99.0, DXC 1.9.2609; tests in debug, the smoke runs from release builds.
On
19be659(on D3D12.X: an ExecuteIndirect of a split program runs its pieces #2404's head5b9d4ff), on the GPU (debug):cargo test --workspace --no-fail-fast -- --test-threads=4: 1450 passed, 0 failed, 47 ignored, the newa_piece_is_named_after_its_static_samplersandmain's precompile testsplit_compute_program_prebuilds_and_caches_chain_piecesamong them. 25 SKIPPED, as below.a_piece_is_named_after_its_static_samplers(two sampler sets, two names): with the id ofdb34184, which leaves the samplers out, failed; with this one, passed. Thedriver_cacheunit tests: 6 passed.On
db34184, this change before the static samplers were in the name (on5b9d4ff), on the GPU (debug):cargo test --workspace --no-fail-fast -- --test-threads=4: 1449 passed, 0 failed, 47 ignored, the newa_piece_is_named_after_the_root_signature_it_was_built_withamong them. 25 SKIPPED, as below.direct_dispatches_write_their_constants_in_blocks_used_again_after_the_allocator_reset, with the new assertions that no block bigger than 64 KiB is kept and the kept ones stay within 8 MiB: 1 passed. Withacba153's reset (every block kept): failed, "a block bigger than 65536 kept for use again".dispatch_chain,alloc_poolanddriver_cacheunit tests,--test-threads=1: 23 passed.dispatch_chain,split,execute_indirectandslabfilters with the debug layer and GPU-based validation,--nocapture, on the local build described below,--test-threads=1: 51 passed, 0 failed, 1 ignored. 1 SKIPPED:dispatch_chain_native_wave64_builds_whole(no wave64). During the tests: 1 error, 884, and 275 warnings (195 of 1328, 80 of 926), as on1202ac1below.a_piece_is_named_after_the_root_signature_it_was_built_withanda_file_is_named_after_its_dxil_and_flagsfailed with the piece's file named as before (no signature), and pass with it.On
acba153, this change before the two review fixes (on D3D12.X: an ExecuteIndirect of a split program runs its pieces #2404's then head97a70a7):cargo test --workspace --no-fail-fast -- --test-threads=4: 1446 passed, 0 failed, 47 ignored, the newdirect_dispatches_write_their_constants_in_blocks_used_again_after_the_allocator_resetamong them. 25 SKIPPED: 21 for no native wave64 on this card, three per-lane FP16 forms the per-lane lowering refuses, and no heap windows.The runs below on
1202ac1are of the same change before its rebase onto97a70a7(on551a75e).On
1202ac1, thedispatch_chain,split,execute_indirectandslabfilters withXCL_D3D12_DEBUG=1,--test-threads=4: 48 passed, 0 failed, 1 ignored. 1 SKIPPED:dispatch_chain_native_wave64_builds_whole(no wave64). Thedispatch_chainunit tests,--test-threads=1: 7 passed.dispatch_chain_divergent_forward_edges_3d, three runs: 1 passed each.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): 48 passed, 0 failed, 1 ignored. During the tests: 1 error, 884, frommain'ssplit_compute_program_prebuilds_and_caches_chain_pieces, which feeds the driver a deliberately invalid blob; and 275 warnings: 195 of 1328 (a buffer's initial state ignored) and 80 of 926 (a root view's address in a heap), as on D3D12.X: an ExecuteIndirect of a split program runs its pieces #2404's head.On
1202ac1, on an RTX 2060 (NVIDIA 595.91) under Wine (wine-staging 11.21) + vkd3d-proton30b0eb9, a releasewindows-gnutest build,--test-threads=1, noXCL_D3D12_DEBUGor GPU-based validation set; correctness only: thedispatch_chainunit tests 7 passed; thedispatch_chain,split,execute_indirectandslabfilters 48 passed, 0 failed, 1 ignored, SKIPPEDdispatch_chain_native_wave64_builds_whole(no wave64);list_x41 passed;alloc_pool8 passed.Tested by others: @luckyteagirl, on
acba153, AMD Radeon RX 6800M (driver 30.0.13002.13003), Windows 11 build 26200, debug (review):dispatch_chain_divergent_forward_edges_3dwithXCL_REQUIRE_GPU=wave64,--test-threads=1: 1 passed, 0 failed, no SKIPPED notice, both the 32- and 64-thread chains (3 pieces each). Not the whole suite.Tested by others, on
acba153: @pickles976, RTX 4060 Laptop GPU 8 GB (NVIDIA 590.48.1) under Wine 11.0 + vkd3d-proton 3.2.0, a local diagnostic build of it with relaxed checks (-Db_ndebug=trueand two localfrom_ifacerelaxations),x86_64-pc-windows-msvc, one test thread (review):direct_dispatches_write_their_constants_in_blocks_used_again_after_the_allocator_reset: 1 passed, on the NVIDIA device. Correctness only, with no timing or title run.Tested by others, on
db34184against D3D12.X: an ExecuteIndirect of a split program runs its pieces #2404's97a70a7: @SzczepanGrela, RX 9070, RADV (Mesa 26.3.1) under Wine 11.0 + vkd3d-proton, releasewindows-gnutest builds (review).dispatch_chain9 passed,driver_cache5 passed,alloc_pool8 passed and 1 failed on both revisions:main'sa_recording_outlives_the_reset_of_the_titles_allocator, whose allocator vkd3d-proton refuses once XCL has adopted it (real::adoptreplaces its vtable).dispatch_chain_divergent_forward_edges_3daborted ind3d12core.dllon both revisions; it passed natively on the RX 6800M below and on our card. In a local GPU-timestamp test, 32 rounds × 10 pieces ofExecuteIndirecttook 533–738 µs against D3D12.X: an ExecuteIndirect of a split program runs its pieces #2404's 1,801–2,543 µs. The direct control, 12 slabs × 10 pieces, took longer with this PR: 137.18 µs against 114.48 µs at 32 threads, in every pair, and 169.12 against 108.88 µs at 64.Tested by others, on
db34184against its base5b9d4ff: @KDenKC, RTX 5090 (NVIDIA 621.24), release, with Shaders: --precompile --pipelines also builds a split program's whole form #2551, each side precompiled from its own cache (227 split programs, 2,000 pieces, 0 refused), one run of the base and two of this PR (review). This PR's cache held only the new piece names, with no refusals. At 130 s: 2,768 and 3,139 chainedExecuteIndirects against 808, 8,939 and 7,564 slabs against 1,694, scratch peaks 613 and 537 MiB against 420. The base and the second run ended in NVIDIA: the device is removed when the pipelines in use need more than 512 MB of shader code (0x887a0005) #2403's removal (134.7 s, 131.7 s); the first run of this PR hung (0x887a0006) at 133.45 s. In four more runs withXCL_DRED=1(review), no hang: three of NVIDIA: the device is removed when the pipelines in use need more than 512 MB of shader code (0x887a0005) #2403's removals and one crash of D3D12.X: title texture reads outside the coherent window use the safe copy #751's race, so this PR hung in 1 of 4 runs. Neither side skipped a call or ran one whole before 130 s (review). The hang does not separate this PR from more GPU work reaching the card; it is under investigation.Tested by others, on
db34184against5b9d4ff: @Royalflamejlh, RTX 4060 Ti 16 GB (NVIDIA 615.71.09), Linux, Wine 11.21 Staging + vkd3d-proton30b0eb9b(patched), onmainb49be18with XG: fix CopyFromSubresource 7-argument ABI and guard destination span #684, D3D12.X: title texture reads outside the coherent window use the safe copy #751, DirectStorage: a queue made with AutoSubmitDisabled waits for Submit #1599, Recompiler: direct DXIL gives every loop head and block one back edge #1860 and Recompiler: direct DXIL makes a pointer to storage again in each block #2082, three runs a side (review). In the 20 s after each run's first world frame: 7,347–10,000 chainedExecuteIndirects and 18–22 presents against 2,406–2,849 and 6–7, so about as many per present (408–476 against 372–407); no call skipped or run whole. The world came 40–55 s sooner with this PR, from a warmer NVIDIA cache, so neither that nor the present rate is separated from the cache.GPU timestamps, 16 rounds × 10 pieces, median per piece step, in a local-only test not in this PR, on the same change before its rebase (
f29910f, on809da30):ExecuteIndirect, root constants (before)ExecuteIndirect, root CBV, Dispatch-only signatureDispatch, root constants (before)Dispatch, root CBV in the upload heapOn
db34184, the same local test at the shape of @SzczepanGrela's direct control (12 slabs × 10 pieces, one group each), 5 alternating trials, two runs: D3D12.X: an ExecuteIndirect of a split program runs its pieces #2404's root constants and this PR's root CBV both 73.66 µs at 32 and at 64 threads (trial medians 73.63–73.70 µs).Regression run
scripts/smoke.ps1 -Seconds 60, the same retail title,XCL_DIRECT_DXIL=1, a private XCL cache started from the sameused-pipelines.txt. From release builds of clean trees, on the machine under Tested, each in the queue's title lane beside other jobs (builds, suites or precompiles; no other title run or timing job runs at the same time there):main's in one job with this PR'sdb34184, this PR's19be659alone, beside 3 other jobs.mainb49be18:this PR,
19be659:compute splitcounter 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)compute split: 66 programs split, 684 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 wholeNot tested
DispatchorExecuteIndirecton either side, so it checks for regressions only; this PR's paths did not run in the title.Other branches
dispatch_chain.rs: both changeChain's fields and the read of its whole form inexecute_indirect, and D3D12.X: a split program's failed whole build is not tried again #2629's test setsChain::signature, which this PR removes. Whichever lands second dropssignatureandbuild_wholethere and reads the whole form with.flatten(). With that, the merge builds (cargo check -p xcl --lib --tests).AI use
🤖 Generated with Claude Code