Repository navigation
Conversation
|
Test report on AMD / Linux (RDNA3, RADV): with #2404 + #2097 no title thread builds a whole form any more, and with 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,
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. |
|
Added for On an RTX 3060 12 GB, the PR run recorded 177 chained Tested
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 Not tested Rendered picture, the suite at 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
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, Tested
By reading (neither exercised here)
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. |
|
Independent test and smoke report for head Tested
Regression run (
PR 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. |
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
|
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.
Adjacent controls on the same head: Not tested: full workspace, retail title, other GPUs. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the checks and drafted this report. |
|
Independent retail check on an RTX 5080 (retail 1.0.2.1, 600 s,
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 AI use: OpenCode, Claude Fable 5.2 built the stack, ran the retail title on this machine and wrote this. |
|
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. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Follow-up after a second (warm) run of the same stack: the ExecuteIndirect whole forms are still 0 of them whole, 0 slabs lost ( AI use: OpenCode, Claude Fable 5.2 ran the second stack run on this machine and wrote this. |
…#2404, xcl-dev#2405 Integrates VRAM top-mip pressure shedding (xcl-dev#2385), DXC wanted-compile prioritization & worker headroom (xcl-dev#2423), inline split pipeline foreground path (xcl-dev#2424), ExecuteIndirect split program dispatch (xcl-dev#2404), and hosted view heap exhaustion null-pair fallback (xcl-dev#2405). Assisted-by: Antigravity (Gemini 4 Neon)
, xcl-dev#2333, and UnadoptGuard test submits Assisted-by: Antigravity (Gemini 4 Neon)
|
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:
@pvfreis's first point (the Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug, 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. |
|
Update: this report covers @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. How many words differ, from the assertion's Added 20:13Z, corrected 20:50Z. Run alone (
(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. |
Test report: #2372 and #2404 on an RTX 3080, retail title 7952987ASummary: both PRs remove the world-load freeze on this card. With either one applied, every run then hits the silent Setup
Conflicts with current
Base, 6 runs
#2404, 3 runs
#2372, 3 runs
What this says Not tested: AMD, other titles, and runs without (Runs and report by Claude Code with Claude Opus 5.5. The commands and counts above come from these runs.) |
|
For the requested RTX 3080 Ti overflow check on #2404 head I then removed only the two Windows 11 build 26300, NVIDIA RTX 3080 Ti / 621.35, Rust 1.99.1; Update after predicate-isolation controls (same head and GPU): The two-call deletion above left the chain's earlier
These controls narrow the failing path to the piece indirect-command sequence before the fallback. They do not establish whether the cause is command recording, synchronization, or a driver interaction. All edits stayed in the scratch test worktree; no retail run or PR patch was made. |
bmjask
left a comment
There was a problem hiding this comment.
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.
…#2404, xcl-dev#2405 Integrates VRAM top-mip pressure shedding (xcl-dev#2385), DXC wanted-compile prioritization & worker headroom (xcl-dev#2423), inline split pipeline foreground path (xcl-dev#2424), ExecuteIndirect split program dispatch (xcl-dev#2404), and hosted view heap exhaustion null-pair fallback (xcl-dev#2405). Assisted-by: Antigravity (Gemini 4 Neon)
|
On Linux + NVIDIA, with KDenKC's patch for the Setup: RTX 4060 Ti 16 GB, NVIDIA 615.71.09, Wine 11.21 Staging; vkd3d-proton
Not tested: Windows; the patch on AI use: Claude Code (Claude Opus 5.5) merged the trees, adapted the patch, made and read the runs, and wrote this. Posted without review by a person: the account owner was away and reads replies later. |
…'s reuse title_reset decided which put-aside PC allocators were free under the pool lock, released the lock, and only then dropped each allocator's chain recordings. Another title Reset could reuse such an allocator in between and record a chained ExecuteIndirect on it; the sweep then removed that new recording, and its commands buffer was released while the slicer was still to write it. That is the GPU page fault and device removal reported on this PR (the slicer writing a chain_commands_buffer released 3 ms - 1.1 s after it was recorded). The recordings are now detached while the lock still protects the free decision and dropped after it is released, so destructors that map a buffer still run outside the lock. The lock order stays STATE, then RECORDINGS. Found and fixed in review: the interleaving and this change with its test by thehollowedone (a_free_spare_reused_after_a_sweep_keeps_its_new_chain_recording, which fails without the change), an equivalent patch by KDenKC; in-title runs without the fault by Raul-Paiva, b3IKK and Royalflamejlh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks all: the Tested on 9620331, RTX 5070 Ti, Windows 11, Rust stable MSVC:
Not tested: a title run of mine that reaches a chained AI use: Claude Code, Claude Opus 5.5 applied the posted patch, ran the tests and wrote this reply. |
|
Independent NVIDIA recheck of #2404 at Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti 12 GiB / driver 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11:
I checked that the new sweep detaches the old recordings while holding the allocator-pool lock, then drops them after unlocking; the regression covers reuse in that interval. This is a synthetic regression and GPU-output check on the current head. I did not run a retail title, paired smoke, AMD/Intel, or a title case that reaches chained AI use: Codex (GPT-6.2 Sol) inspected the current change, ran the tests, and drafted this report; I checked the source and outputs before posting. |
|
The stack with KDenKC's AI use: OpenCode, Claude Fable 5.2 ran the 600 s stack and wrote this. |
|
On Linux + NVIDIA, your Setup: as in 7200335602 (RTX 4060 Ti 16 GB, NVIDIA 615.71.09, Wine 11.21 Staging, the same vkd3d-proton build and switches):
Not tested: Windows; this PR without #2633 on this build, or with #2633's head now ( AI use: Claude Code (Claude Opus 5.5) merged the trees, made and read the runs, and wrote this. Posted without review by a person: the account owner was away and reads replies later. |
…eused title_reset() free_aside()s a PC allocator under STATE, unlocks, and only then drops its RECORDINGS entries. A backing reused in that window could have its new recording swept away, or keep the old recording's readbacks/COM releases alive (xcl-dev#2404). The free backings' recordings are taken out while STATE is held and dropped after the unlock; a backing reused in between keeps the recordings made after its reuse. Patch from KDenKC's tested diff in xcl-dev#2404. Test: aside_sweep_keeps_recordings_made_after_backing_reuse fails on 5b9d4ff, passes here.
|
NVIDIA and AMD full-suite run, to go with the reports above by thehollowedone, since none of them covers AMD. Tested exact head Tested
Not tested
AI use
|
|
On Linux + NVIDIA at Setup: the machine, vkd3d-proton build and switches of our 7178119858, with
Not tested: any change to the lane or gate; AI use: Claude Code (Claude Fable 5.2) wrote the log line, read the runs and the code, and wrote this. Posted without review by a person: the account owner was away and reads replies later. |
main gained 345 commits since 753e8b1, most of them bmjask's stack (xcl-dev#2959), plus xcl-dev#2872, xcl-dev#3085 and xcl-dev#3086 from this branch. Conflicts, per PR: - xcl-dev#2404 + xcl-dev#2633 (split chained ExecuteIndirect): main's xcl-dev#2959 took both over (ed98461, a05fbc4, 8626d5b: IndirectBuild/IndirectChain on a CBV root, one-command slicer, separate cache namespace). Main's side kept in dispatch_chain.rs, pso.rs (slicer, command signature, chain root), bind.rs (ExecuteIndirect path), device_x.rs (signature traits), pso_async.rs (no background whole build, so no build_waited_on), real.rs (ComputeBuild, driver_cache names) and shaders.rs (blob names). Dropped with them: slab_count, record_slicer, abi_signature_id names, the direct root-CBV constant blocks, list_x::predicated, the split.rs/runner.rs ExecuteIndirect test and the list_x chain-scratch test. Not in main: xcl-dev#2404 ran the pieces before any whole form was built; main runs the whole form (built on the title's thread) until the indirect set is ready. - xcl-dev#2707 (allocator reclaim): main has it (31930d8, 057f463, 8e7b566). alloc_pool.rs is main's, with xcl-dev#867's changes on top; bind.rs takes main's native_backing; xcl-dev#2707's tests and bind::push_uma_for_test go. - xcl-dev#867 + xcl-dev#2477 (Wine vtables and fences), adapted to main's new code: real.rs keeps the in-place patching, UnadoptGuard and FenceProxy beside main's native_queue_* helpers; guards in cl_reset, bind_pipeline_exact, clear_pipeline_exact, reset_pc_allocator, the title ExecuteCommandLists closure and native_queue_execute; Signal/Wait unwrap the title's fence (also in native_queue_signal/wait); list_x guards in reset_reserved_segment and KickoffX's submit closures; create_raw_fence for main's new internal fences in alloc_pool.rs (SubmissionGate), title_textures.rs, present.rs, vram.rs, sparse.rs, cpu_writes.rs; tests as xcl-dev#2477 had them; runner.rs is main's plus submit_list. - xcl-dev#1803 (heap addresses): kept, carried into main's PreparedSplit and PreparedAbiState (prepared_abi_io takes the heaps). - xcl-dev#1368 (NodeMask 0): kept in compute_container, before main's per-node blob names, so names and pipeline use node 0. - xcl-dev#1860, xcl-dev#2082 (cfg.rs, module/opt.rs): cfg.rs is 1567f72's version (xcl-dev#1860 on main's Succs); opt.rs is that plus xcl-dev#2082's arm and test. - xcl-dev#2229 (rodata): kept through main's kernel.rs entry points; translate_entry_rodata loses wave32_only as main dropped per-GPU tables (3cde0cc); pso.rs and coverage.rs call it with main's options (no_remap, split for graphics); recomp Options keeps rodata and no_remap. - xcl-dev#1975: kept in emit.rs and lower_valu.rs; its mesh barrier guard and its test dropped, main's wider guard (2ca9127) covers it; the now-unused lower::has_non_uniform_barrier goes. - xcl-dev#2070 (64 MB stacks): pso_async::WORKER_STACK on main's worker, helper and preload threads; shaders.rs's piece threads on worker_thread. - xcl-dev#2551 (whole forms prebuilt): split_whole_roots(false) is DirectChain, so the precompile builds every split program's whole form; main built it only for programs an earlier run used through ExecuteIndirect. - xcl-dev#688 (dxc.rs imports), xcl-dev#2762 (host.rs log line), xcl-dev#3090 (list_x tests), arch/window-title-commit (present.rs with_commit on main's compiling_text), README.md: both sides. - list_x.rs: main dropped title_textures::list_reset; main's side. - sparse.rs, vram.rs: main's quarantine_tiles_for and per-device retire state, with create_raw_fence. - xcl-dev#3090, xcl-dev#3092 tests: runner::device and Uma::block_len added from nvidia-dev (5 and 12 lines) so the lib tests compile. - xcl-dev#751: its commit is already in main (b84e037, via xcl-dev#2844); it leaves the README table with xcl-dev#2404, xcl-dev#2633, xcl-dev#2707, xcl-dev#2872, xcl-dev#3085 and xcl-dev#3086. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review (head 9620331, diff read, not a merge-check; it conflicts with main, so not built or run):
Recommendation: close as superseded by #3499. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
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 throughExecuteIndirect, andbind.rsfalls back to the program's whole form (690–950 KB of DXIL), compiled synchronously on the title's thread. In a 600 s run onmain0829441(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
ExecuteIndirectrun 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 ofdispatch_slabs, one command per piece: the root constantsrecord_dispatch_chainsets, then the slab's group counts. Each piece then runs oneExecuteIndirectper 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,MaxCommandCount1, no count buffer. Their group counts were 0 when recorded during load.What is in it
Rebased onto
mainb49be18. The hashes in this list are the rebased commits. Under Tested,77cfec2,d76f773and809da30are the same commits before the rebase (now9125edb,f0cef78and3ca9071).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_indirectandslab_count, with a test thatslab_countmatchesdispatch_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 earlierExecuteIndirectof the program needed, plus a quarter (2 toXCL_SPLIT_INDIRECT_ROUNDS).ExecuteIndirect. Otherwise it leaves those arguments empty, so exactly one of the two has groups. The whole form'sExecuteIndirectis 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).ExecuteIndirects of the program get more rounds.compute splitline counts chained, whole and lostExecuteIndirects.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_indirectrecords it the way the runtime does.dispatch_chain_divergent_forward_edges_3dcompares the memory with the whole program's output and checks the slicer's slab count for: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), indispatch_chain.rs, after review:ExecuteIndirectof 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_ROUNDSdefaults to 32, not 16.ExecuteIndirect. It is built on anxcl-psothread, so a huge one waits for the huge-build gate. It is bound only on an overflow.ExecuteIndirect's rounds and for the gate.In ten title runs of the earlier head
5ca9c23, six lost slabs: 158 over 73,714 chainedExecuteIndirects. All of them came from one program with 17 slabs per run: 15 at its firstExecuteIndirect(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 chainedExecuteIndirects, 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), indispatch_chain.rs,bind.rsandlist_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 nextExecuteIndirectwhose arguments read 0 got 2 rounds instead of 32. Such anExecuteIndirectis no longer read back. Tests: the device test also records one predicated and one plainExecuteIndirect, and thelist_xpredication 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 off0cef78bound no root signature for the twoExecuteIndirects 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), indispatch_chain.rs, with a unit test. Each round of a chainedExecuteIndirectis one barrier and oneExecuteIndirectper 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 anyExecuteIndirectof 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 anExecuteIndirectwhose 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) at809da30. Itsbindset 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), inalloc_pool.rsanddispatch_chain.rs, with a unit test.ExecuteIndirectran 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.ExecuteIndirects. D3D12.X: keep caller allocator for untracked lists and retain whole PSOs in dispatch_chain #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 D3D12.X: keep caller allocator for untracked lists and retain whole PSOs in dispatch_chain #2333'sresolve_allocatorforExecuteIndirect;dispatchstays D3D12.X: keep caller allocator for untracked lists and retain whole PSOs in dispatch_chain #2333's.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), indispatch_chain.rsandlist_x.rs, with a unit test. The chains of one recording share one scratch, found by the list's address. Addresses are reused (D3D12.X: a direct list at a released compute list's heap vtable address gets the compute list's methods #2588): a list created where a released one was could share the old list's scratch with work the GPU may still be running.list_xnow 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), inalloc_pool.rs, with three unit tests.reclaim_idle_inresets 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: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 D3D12.X: reclaim idle put-aside allocators and retire orphaned batches #2138).50205bc, that covers the lists the pool had not seen, which f4608d7 (on D3D12.X: keep caller allocator for untracked lists and retain whole PSOs in dispatch_chain #2333's filing) does not, so the release cannot free a recording under a live list.D3D12.X: a title thread does not wait behind a background whole build's turn(97a70a7), inpso_async.rsanddispatch_chain.rs, with a unit test, after review (@pvfreis, review).want_wholebuilds the whole form on anxcl-pso*thread, so a huge one waits inbig_compile_turnfor a background slot and 3 GB of free commit, holdingChain::build_whole, and nothing told it a title thread waited. A title thread that needed the same form (bind.rs, ordispatchwithout scratch) waited behind that turn, without the wanted cap or the commit skip. Now such a thread counts itself inChain::waitingwhile it waits, and the background build runs inpso_async::build_waited_on, sobuild_is_wantedis 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), inalloc_pool.rsanddispatch_chain.rs, with a unit test. Logging only. Every 10 s, with thecompute splitline, 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 of97a70a7the 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), indispatch_chain.rs, with a unit test, after review (@Royalflamejlh).want_wholestarted an OS thread for each whole form, and each waited for its turn inbig_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 ofdriver_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), indispatch_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 earlierExecuteIndirects 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 chainedExecuteIndirectnow recordsXCL_SPLIT_INDIRECT_ROUNDS(32) rounds whatever was read back. Once it is built, the last one read back sizes them, as with3ca9071. The cost is the empty rounds until the whole form is built (14.4 µs per piece step on the RTX 5070 Ti, as under3ca9071; D3D12.X: the pieces of a split program read their slab from a root CBV #2633 makes that step 0.41 µs).D3D12.X: a free_aside sweep keeps recordings made after the allocator's reuse(9620331), inalloc_pool.rsanddispatch_chain.rs, with a unit test, after review.title_resetdecided which put-aside PC allocators were free under the pool lock, released it, and only then dropped their chain recordings; another title Reset could reuse such an allocator in between and record on it, and the sweep then released the new recording's commands buffer while the slicer was still to write it (the page fault in @Raul-Paiva's report). The recordings are now detached under the lock and dropped after it. The interleaving, this change and its testa_free_spare_reused_after_a_sweep_keeps_its_new_chain_recordingare @thehollowedone's (review), applied as posted; @KDenKC posted an equivalent patch and found the same race (7196846147, 7197560233); in-title runs without the fault by @Raul-Paiva, @b3IKK and @Royalflamejlh (below).1211 changed lines (1194 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
ExecuteIndirectpath 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
9620331(this head), on the GPU (debug):cargo test --workspace --no-fail-fast -- --test-threads=4: 1446 passed, 2 failed, 47 ignored (the new test among them). The two failed arelink_tests::gpu_linked_memory_accessorsandlink_tests::linked_programs_keep_their_declarations(DXC: "attribute WaveSize only valid on entry point function"); they fail the same way onmainb49be18(cargo test -p xcl --lib link_tests: 0 passed, 2 failed). This machine's tests now take a different DXC than in the runs below: 144 SKIPPED (119 validator 1.7 < 1.8, validation step only; 21 no wave64; 3 refused f16 forms; 1 no heap windows).cargo test -p xcl --lib -- alloc_pool dispatch_chain: 26 passed, 0 failed, 0 ignored.5b9d4ffwith this fix applied by hand (the same change, or @KDenKC's equivalent): @Raul-Paiva, RTX 3070 Laptop 8 GB, 0 page-fault dumps in 3 runs of 900 s against 8 of 10 without it (7199386758); @b3IKK, RTX 5080, 0 device removals in two 600 s runs (7198145884, 7199036830); @Royalflamejlh, RTX 4060 Ti on Linux, 0 of 2 runs lost the device against 2 of 2 without it (7200335602).5b9d4ff(the previous 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 on551a75ebelow.dispatch_chainandalloc_poolunit tests,--test-threads=1: 21 passed.dispatch_chain,split,execute_indirectandslabfilters 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, frommain'ssplit_compute_program_prebuilds_and_caches_chain_pieces(a deliberately invalid blob); 275 warnings, 195 of 1328 and 80 of 926, as on551a75e.--test-threads=1):the_recordings_held_are_split_by_what_holds_their_allocator,whole_forms_wanted_together_are_built_one_after_another_on_one_threadandonce_the_whole_form_is_built_the_last_execute_indirect_sizes_the_rounds: 1 passed each. WithInTurn::pushstarting a thread for each item, aswant_wholedid: failed, 5 threads for 5 whole forms. With97a70a7's rounds: failed, 2 rounds, not 32, after a read-back of 1 slab.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 on551a75ebelow.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::waitingnot raised, as on551a75e): failed, "the title thread waited for the background build's turn" (still waiting after 5 s).dispatch_chainunit tests,--test-threads=1: 7 passed. Thedispatch_chain,split,execute_indirectandslabfilters,--test-threads=1: 48 passed, 0 failed, 1 ignored, 1 SKIPPED (dispatch_chain_native_wave64_builds_whole, no wave64).pso_asyncandbig_compile: 25 passed.551a75e(rebased ontomainb49be18), 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 on68a284aandd76f773, passes on this base.dispatch_chainunit tests,--test-threads=1: 6 passed, 0 failed.dispatch_chain,split,execute_indirectandslabfilters,--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).--nocapture, on the local build described below: 47 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, 1328 and 926 as below. The device test's 4 errors (1419) at809da30are gone.cargo check -p xcl --lib --testsbuilds each of50205bc,073f8eaand551a75e. The first of551a75e'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.551a75e, 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 6 passed; thedispatch_chain,split,execute_indirectandslabfilters 47 passed, 0 failed, 1 ignored, SKIPPEDdispatch_chain_native_wave64_builds_whole(no wave64);list_x41 passed;alloc_pool8 passed.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 two0x887A002D(texture_states'suploads_start_from_each_subresources_state, no D3D12 debug layer;shaders'spso_measurement_compiles_an_exact_synthetic_record, no Developer Mode). Those two aremain's tests of files this PR does not change. A 60 s smoke on their own title, from release builds:mainb49be181409 frames, peak commit 14,032 MB;97a70a71567 frames, 14,026 MB; no device removal or crash. It covers boot, intro and menus, not the world.97a70a7: @pvfreis, RTX 3060 12 GB, 31.9 GB RAM, one release run each of97a70a7andmainb49be18from an empty cache, both with one local logging line (review). With this PR: 177 chainedExecuteIndirects, 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. Onmain, 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.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 chainedExecuteIndirects, 0 whole; 20 slabs lost in 2 runs (5b9d4ffabove); 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.97a70a7+ Shaders: --precompile --pipelines also builds a split program's whole form #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 NVIDIA: the device is removed when the pipelines in use need more than 512 MB of shader code (0x887a0005) #2403's removals and one device hang they are still looking into.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.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, andpso_measurement_compiles_an_exact_synthetic_record). A 600 s smoke pair with default settings:mainb49be182171 frames, peak commit 35,030 MB;97a70a72211 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. WithXCL_DIRECT_DXIL=1(900 s, warm driver cache), one run of97a70a7logged 397 chainedExecuteIndirects, 0 whole, 0 slabs lost. Every direct run ended in a0x887a0005removal (DRED: page fault at VA 0x0) between 99 and 115 s,main's run too, as in NVIDIA: the device is removed when the pipelines in use need more than 512 MB of shader code (0x887a0005) #2403, so the removal is not from this PR.5b9d4ff: @jennydeth, RTX 3060 12 GB (NVIDIA 32.0.16.2101),XCL_DIRECT_DXIL=1, 900 s, warm caches, one run at the default shader heap and one with xcl run:xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590's 1 GiB profile (review). Both: 2,474 pieces built, 0 whole, 0 slabs lost; 3,020 and 4,582 chainedExecuteIndirects by 160 s. Both lost the device (0x887a0005, DRED: page fault at VA 0x0), at 166.0 s and 163.6 s. At the default heap that is the removalmainb49be18has with these switches (114.8–216.0 s in their three runs). With the 1 GiB profile, two runs ofb49be18kept the device and this one run lost it; why is open.5b9d4ff+ D3D12.X: detach retired segments and reclaim idle aside allocators #2707 (dff6edc7, D3D12.X: detach retired segments and reclaim idle aside allocators #2707's side of thealloc_pool.rsconflict) + Shaders: --precompile --pipelines also builds a split program's whole form #2551: @KDenKC, RTX 5090, one run to NVIDIA: the device is removed when the pipelines in use need more than 512 MB of shader code (0x887a0005) #2403's removal at 161.4 s (review). At 160 s, against5b9d4ffalone: 32 PC allocators (47), 848 recordings under busy allocators in use (1,719), 530 put aside with a list on it (559). So D3D12.X: detach retired segments and reclaim idle aside allocators #2707 lowers the allocators but not those held by lists: a list stays on its allocator until the title resets it elsewhere or releases it.mainb49be18+ Direct DXIL: compute programs over 1.5 MB of plain DXIL are retried in the compact form #2301 with this PR's5b9d4ffmerged on top: @Natakout, RTX 3060 12 GB (NVIDIA 621.14), i9-13900K, Windows 11 build 26200, release,XCL_DIRECT_DXIL=1, 480 s runs from warm caches (review). Without this PR, presents stopped 3 to 31 s after the title's#101in 5 of 5 runs; a symbolized dump showed one title thread compiling a whole form inChain::wholeand another waiting onbuild_whole. With it, no stall there in 2 of 2, and both lost the device 2 and 11 s after#101(NVIDIA: the device is removed when the pipelines in use need more than 512 MB of shader code (0x887a0005) #2403's code heap). With xcl run:xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590's 1 GiB profile, 5 runs: the world rendered at about one present every 2 s for 70 to 240 s, then the GPU hung (0x887a0006) in all 5. WithTdrDelay/TdrDdiDelayat 60 s, no removal in 4 runs of 480 s, with world frames of about 0.5–2 s of GPU each (report); so these read as timeouts of long frames, not shown to come from the split. They list this PR among the five things their 3060 needs to get past#101. With splitting off (XCL_DIRECT_SPLIT_INSTRUCTIONS=0) their world ran about 4× faster.5b9d4ff: @ClosetPie107, RX 9070 16 GB (RADV, Mesa 26.3.1), Ryzen 5 9600X, Linux, Proton Experimental with a patched vkd3d-proton (ec207194), releasewindows-gnu(review).dispatch_chain: 16 passed;module::split: 8 passed; 0 failed, 0 SKIPPED. A 300 s run of the retail title withXCL_DIRECT_DXIL=1: exit 0, 1,800 presents, no crash or device removal; at 290 s 221 programs split, 2,355 pieces built, 24,395 chainedExecuteIndirects, 0 whole, 0 slabs lost, scratch 1,648 MiB (most 1,655). Not the full suite, Windows or NVIDIA.77cfec2with D3D12.X: keep caller allocator for untracked lists and retain whole PSOs in dispatch_chain #2333 (RTX 4060 Ti 16 GB, Linux, Wine + vkd3d-proton, 1 run each; review). Recordings held went from 11,061 under 156 allocators at 170 s to 3,316–5,563 under 59–82 allocators between 120 and 200 s, and non-local video memory from 8.7 GB at 169 s to 7.1 GB at 166 s. Their memory guard still stopped that run at 204.5 s for low system RAM.77cfec2,d76f773and809da30, 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 3approx_constanterrors (6.283_185_3forTAU) inlower_valu.rs,lower_wide.rsandrecomp/lower.rs, which this PR does not touch.cargo test -p xcl --libon the unit tests of the chain that need no GPU: 4 passed, 0 failed on each (slab_countagainstdispatch_slabs, the bounded scratch, the firstExecuteIndirect's rounds, the gate). Ond76f773and809da30alsoset_predication_buffer_state_transitions_and_lifecycle, and on809da30once_the_whole_form_is_built_the_last_execute_indirect_sizes_the_rounds: 1 passed each.cargo fmt: the tree is notrustfmt-clean. The changed lines follow the code around them.d76f773, on the GPU (debug):dispatch_chain_divergent_forward_edges_3d --test-threads=1, three runs: 1 passed, 0 failed each.dispatch_chainunit tests,--test-threads=1: 4 passed, 0 failed (the device test included).dispatch_chain,split,execute_indirectandslabfilters withXCL_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 on5ca9c23andmain68a284a(below). 25 SKIPPED notices, as below.--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 ind76f773;54a936afixes that test. Also 266 warnings: 1328 (a buffer's initial state ignored) and 926 (a root view's address in a heap).809da30, on the GPU (debug):dispatch_chain_divergent_forward_edges_3d --test-threads=1, three runs: 1 passed, 0 failed each.dispatch_chainunit tests,--test-threads=1: 5 passed, 0 failed.dispatch_chain,split,execute_indirectandslabfilters withXCL_D3D12_DEBUG=1,--test-threads=4: 43 passed, 0 failed, 1 ignored. 1 SKIPPED:dispatch_chain_native_wave64_builds_whole(no wave64).--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: itsbindsets the chain's root signature on a list without descriptor heaps (a title's list has them). No other test gave an error.5ca9c23(onmain68a284a):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 onmain68a284atoo, with the same assertion and output (lower_dxil.rs:1155); main's CI fails since Recompiler: a bridged mask write in the split form meets no barrier #2074. 25 SKIPPED notices: no native wave64 on this card, three per-lane FP16 forms the per-lane lowering refuses, and no heap windows. An earlier version of this description gave the filters withXCL_D3D12_DEBUG=1as a debug-layer pass. The runner registers no message callback, so such a run shows no layer messages; it showed nothing.5ca9c23. In them noExecuteIndirectneeded more slabs than its rounds.XCL_DIRECT_DXIL=all: this branch, against a 300 s run ofmain68a284awith the same environment.mainrun (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.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.ExecuteIndirects (from 499 s on) took one of the paths that keep the whole form; which one is not logged.main68a284awith this PR and Recompiler: split wave64 compute groups of several waves across dispatches #2097: past the loading screen into the intro cutscene, the first such run here on NVIDIA. The device was removed at 154 s (0x887a0005, local video memory full); the cause is open (#505 comment).GetCachedBlob).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. 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).mainb49be18(this PR's base):this PR,
9620331, the same recipe, in a title-lane job of its own after the push (themainside above is unchanged, the same base):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)9620331):compute split: 6 programs split, 41 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. This run split 6 programs where both sides of the earlier pair split 171; I have not looked into why.Neither run reaches a chained
ExecuteIndirect.551a75ealone, 120 s, same setup, in an earlier title-lane job beside other jobs (nomainside: our harness failed it), reaches 6: 1324 frames, peak commit 30,050 MB, 0 device removals, 0 crashes, and the countercompute 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
ExecuteIndirecttakes 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
9620331's fix in a title run of mine: the 60 s run reaches no chainedExecuteIndirect. The in-title evidence is the runs by others listed under Tested.97a70a7changes 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.97a70a7(above), and whether551a75estopped the growth @dhillonjagdeep650-boop saw (review). Two 240 s runs of97a70a7here, 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.5b9d4ff's empty rounds before a whole form is built, in a title.Dispatchon a list the pool does not track still runs whole; that is D3D12.X: keep caller allocator for untracked lists and retain whole PSOs in dispatch_chain #2333's.XCL_PSO_WAIT_MS), the path of D3D12.X: the GPU hangs after thousands of dispatches put off to the submit (#2118) when the waits are bounded #2617. This PR does not change whether a call is put off, or skipped there. It changes what a put-offExecuteIndirectof 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. D3D12.X: the GPU hangs after thousands of dispatches put off to the submit (#2118) when the waits are bounded #2617's hang is onmainwithout this PR (RDNA2); none of our runs of this PR setXCL_PSO_WAIT_MS.77cfec2and at this head5b9d4ffit passed on an RTX 3080 Ti (review, review). At809da30it 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.ExecuteIndirects took (no scratch left, bundles or another signature).AI use
9620331, @thehollowedone's change and test applied as posted; their AI use is in their review), and ran the tests, the title runs and the regression run on the hardware above.🤖 Generated with Claude Code