Repository navigation
Conversation
d857e8a to
50af98e
Compare
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
50af98e to
400c095
Compare
|
Thanks for the 3060 Ti run. That is the known parallel-run flake (#1978): the same single test passes when the suite is rerun single-threaded, and our 5080 shows the same pattern. The head is now AI use: OpenCode, Claude Fable 5.2 wrote this. |
400c095 to
50af98e
Compare
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
|
Tested: current PR head merged onto current
Not tested: retail titles (no title data on this lane, counts only). AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting. |
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>
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
…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>
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>
luckyteagirl
left a comment
There was a problem hiding this comment.
Could the bundle path keep using the whole pipeline until split dispatches can be recorded without a bundle-forbidden command? The new branch sends bundles to record_dispatch_chain, which emits a UAV ResourceBarrier before the second piece, before a second slab, or when it reuses scratch. D3D12 does not allow ResourceBarrier in bundles. The new test records one piece in one slab with fresh scratch and does not call native Close or ExecuteBundle, so it misses that path.
A test that records an actual two-piece chain, executes the bundle, and checks output with the D3D12 debug layer enabled would catch the dropped barrier. Exact-head source review of 50af98ed1f5e95d4e9af2195e93d395d2ae187d7. Microsoft's command-list and bundle API table says the runtime drops forbidden bundle calls and the debug layer reports them. No GPU run. AI-assisted review with Codex.
luckyteagirl
left a comment
There was a problem hiding this comment.
Could allocatorless direct-list scratch stay alive until the submitted recording completes? list_reset removes the recording from LIST_RECORDINGS. Its scratch is otherwise held only by that recording, with a weak reference in SHARED. D3D12 permits resetting a command list while a queued recording of it is in flight, using another eligible allocator. A title can submit the old list behind a queue wait, reset the command list, then release the wait. The old dispatch still refers to the scratch GPU address after the owning reference can be dropped.
Keep the recording alive through its submission fence or allocator, or retain the whole-pipeline fallback where completion cannot be tracked. A gated queue test can assert that a successful command-list Reset leaves scratch alive until the old fence completes. Exact-head source review of 50af98ed1f5e95d4e9af2195e93d395d2ae187d7. Microsoft Reset contract. No GPU run. AI-assisted review with Codex.
…slab (port upstream xcl-dev#2519 + xcl-dev#2633) (cherry picked from commit 6bab0c8b5b95432a48c1979cc8a4e6e1fa1672aa)
50af98e to
bad9c5d
Compare
Stacked on #2404 (
5b9d4ff).dispatch_chain::dispatchonly used a chain's scratch when the list had a title allocator and was not a bundle. Every other dispatch — a bundle, or a list whose allocator XCL cannot see (a console list, a Wait64 segment) — fell back toChain::whole, a 0.7–1.1 MB unsplit compute pipeline that the driver takes 20–35 s to compile. On the retail 1.0.2.1 title (RTX 5080,XCL_DIRECT_DXIL=1, default wait) 46 such whole forms were still asked on the #2404+#2097 stack, and the first one stalled presentation at 92–94 s.This gives those dispatches an XCL-owned scratch keyed by the list. The recording is held in
LIST_RECORDINGSuntil the title resets that list or bundle, and the already-compiled chain pieces run instead of the whole form.What is in it
crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs:LIST_RECORDINGS;dispatchtreatsallocator == 0or a bundle as XCL-owned (scratch_for(..., 0)), stores the recording under the list, andlist_resetdrops it; testa_bundle_dispatch_runs_the_pieces_with_an_xcl_scratch_not_the_whole_form.Retail A/B (RTX 5080, retail 1.0.2.1,
XCL_DIRECT_DXIL=1, default wait, one run each, on the earlier #2404 head5ca9c23):400c095, 400 s)50af98e, 300 s)The bundle half removes the 37 whole forms; the wall in both is the driver's shader-code heap (#2403), which the 2 GiB profile later removed. On the new head (
5b9d4ff) this scratch is part of the stack that ran 600 s with no device removal (1,954 frames, world reached, 0 whole forms) together with #2590's 2 GiB profile, KDenKC'sfree_asidepatch and a precompiled heap-window cache.Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 1448 passed, 0 failed, 47 ignoredownedforced tofalse: 0 passed, 1 failed (the dispatch falls back to the whole form).no heap windows, andcannot disable the driver cache (Windows Developer Mode is required).Regression run
main (
426a5a7, clean tree, no local changes):PR (
bad9c5d, clean tree, no local changes):(The main block is
426a5a7, an ancestor of the currentmain, from the same machine and data folder.)Not tested
ExecuteBundle.AI use
5b9d4ff, ran the full suite and thescripts/smoke.ps1pair, and ran the retail A/B and the 600 s stack on this machine.