Repository navigation
Conversation
With XCL_PSO_WAIT_MS unset (the default) a bind of a pipeline not built yet took its build from the queue, ran DXC and the driver's compile on the title's own thread, and waited until it was done. On a retail title that kept one title thread in the AMD driver's compile of a 2.4 MB compute program from 124 s to the end of a 600 s run (it never finished) with no frame shown after 126 s and every xcl-pso worker idle. A title thread's build also passed the big-compile gate ungated. A bind with no budget now gets the stand-in at once - its dispatches are skipped and its draws draw nothing, as for a pipeline that is late after XCL_PSO_WAIT_MS today - and the build goes to the workers, wanted (it goes before the builds made ahead, within big_compile_turn's wanted cap). XCL_PSO_WAIT_MS=<ms> still waits up to that long. Since xcl-dev#2118 a Dispatch or a dispatching ExecuteIndirect whose pipeline is still being built is put off to the submit, in a segment of its own, and the submit waited for it the same way: with no budget it built the pipeline itself when no worker had started it, and waited without end (main 08db802 stops presenting at 144-150 s on the same title). With no bind or submit waiting until a pipeline is built, a put-off would only move a wait that no longer happens, at a segment per call, so list_x::defer now returns false (pso_async::waits_until_built) and the call is recorded at once and skipped as a stand-in's, as before xcl-dev#2118. Measured on an RX 6650 XT, 360 s walks: with the put-off kept, 3 of 3 walks went past 8 000 put-off calls and the GPU hung (0x887a0007, DRED page fault at VA 0); so did main with XCL_PSO_WAIT_MS=1 (1 walk, no change of ours). Without it, 3 of 3 walks (one with XCL_PSO_WAIT_MS=200) ran to 355-361 s with no device removal; one of them ended at 357 s when the system ran out of physical memory. The test that xcl-dev#2118 added for the submit's wait now checks that the dispatch is recorded at once and skipped. wait_built waits for a stand-in's build for tests that used a no-budget bind to do so. AI-assisted. Assisted-by: Claude Code (Claude Opus 5.5)
Docs of lazy(), the used module, resolve_for_bind and a bind_abi comment still described the inline build and unbounded wait removed in the previous commit. wait_built says it returns at once for a pipeline that is no stand-in (also with XCL_ASYNC_PSO=0). Assisted-by: Claude Code (Claude Opus 5.5)
|
NVIDIA and RDNA4 run (both listed as untested): the new and changed tests pass on an RTX 3060 and an RX 9070 XT. One flaky Head
On the RTX 3060, Not tested: a world run on RDNA4 or NVIDIA (no title here), wave32-only performance, Intel. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! — Devin |
|
Linux (Wine + vkd3d-proton) + NVIDIA, the title, 3 runs with #2615 and 3 without: without it the title stopped presenting 1.1 to 3.1 s after its first call of Setup:
Not tested: today's AI use: Claude Code (Claude Opus 5.5) ran the title and wrote this comment. Posted without review by a person: the account owner was away and reads replies later. |
|
Independent dual-PC NVIDIA full-workspace test report on clean head Tested
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. |
|
Linux (Wine + vkd3d-proton) + AMD RDNA3, the retail title, 2 runs with #2615 + #2598 + #751 and 2 without, alternated: without them the title stopped presenting at 120.2 / 122.2 s; with them it presented to 349.6 / 358.4 s of 360 s, 0 crashes, 0 device removals. Tested
Not tested
AI use: Claude Code (Claude Opus 5.5) built the trees, ran the runs and wrote this report. |
|
Edited (07:47 UTC): a fourth run of the tree without this PR (with a logging-only count line) lost the device at 199.7 s, Xid 13 then Xid 32, the same form as with it. So these runs do not tie the loss to this PR; with it the title reached the same point sooner (106–234 s, against 199.7 s in 1 run). On Linux + NVIDIA (RTX 4060 Ti 16 GB), Setup:
Not tested: Windows; AMD; this PR without #2404 past the burst (1 run on this card drew nothing after it). 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. |
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
…+ xcl-dev#2548 + xcl-dev#2579 + xcl-dev#2581 + xcl-dev#2598 + xcl-dev#2611 + xcl-dev#2615 + xcl-dev#2622) (cherry picked from commit 57e5c216e924452b59cd64862d2941006e24c28c)
Integrated XCL already keeps cold title-visible builds on workers, superseding xcl-dev#2615's title-thread compile fix without adopting its correctness-losing default skip policy. Worker failure still had terminal holes: a panicking job was caught only outside the Build and never woke its waiters, a panicking parallel piece omitted a result, and zero workers or a refused queue left accepted work with no executor. Catch pipeline and piece panics as failed results, restore worker-local/preload state before publishing completion, and fail exact jobs when no normal worker can start or the queue refuses them. Failed speculative-preload startup leaves the build dormant so a later title demand can schedule it normally. The Windows GNU library/test cross-check passed with the existing 11 library warnings and 2 test warnings (1 duplicate). Windows MSVC runtime, GPU, and smoke tests were not available here. Panic-recovery source: xcl-dev#2053 by RandomGithub12309, written with Antigravity (Gemini 4 Neon). Assisted-by: Codex (GPT-5.6-sol)
Integrated XCL already keeps cold title-visible builds on workers, superseding xcl-dev#2615's title-thread compile fix without adopting its correctness-losing default skip policy. Worker failure still had terminal holes: a panicking job was caught only outside the Build and never woke its waiters, a panicking parallel piece omitted a result, and zero workers or a refused queue left accepted work with no executor. Catch pipeline and piece panics as failed results, restore worker-local/preload state before publishing completion, and fail exact jobs when no normal worker can start or the queue refuses them. Failed speculative-preload startup leaves the build dormant so a later title demand can schedule it normally. The Windows GNU library/test cross-check passed with the existing 11 library warnings and 2 test warnings (1 duplicate). Windows MSVC runtime, GPU, and smoke tests were not available here. Panic-recovery source: xcl-dev#2053 by RandomGithub12309, written with Antigravity (Gemini 4 Neon). Assisted-by: Codex (GPT-5.6-sol)
|
Windows / NVIDIA results for Regression run (default settings, 600 s)
This PR, Run 2, the same commit rebuilt:
Tested
Not tested: which texture the detiler read (the address is not in the log); this PR together with #2598 / #751 as in @GreemSC's runs; AMD / wave64. AI use: Claude Code (Claude Opus 5.5) built the commit, ran the suite and the runs on my machine, resolved the crash stack, read the logs and wrote this. |
|
Reviewed
Checked by merging AI use: Antigravity (Gemini 4 Carbon High) audited the diff against |
|
A follow-up to our report above (7185722614), on Linux + NVIDIA: on a vkd3d-proton build that releases command-pool memory, the device losses came with #2404's Setup: RTX 4060 Ti 16 GB, NVIDIA 615.71.09, Wine 11.21 Staging. vkd3d-proton was our report's build, with its allocator Reset releasing the command pool's memory (#2404, 7189698499). The base was
Not tested: Windows; AMD; our report's build without 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. |
|
Conflict note, source read of a0734c9, no run. Besides the PRs the description lists, two open PRs rely on behaviour this changes, and neither would fail to compile:
AI-assisted (Claude Code, Claude Opus 5.5). |
With
XCL_PSO_WAIT_MSunset (the default), a bind of a pipeline that is not built yet took the build from the queue, ran it on the title's own thread (DXC and the driver's compile), and waited until it was done. On a retail title that put one title thread into the AMD driver's compile of a 2.4 MB compute program at 124.0 s (itsdriver compile start), where it stayed to the end of a 600 s run: the compile never finished, the last frame was shown at about 125–126 s and none after it, while all thexcl-pso-*workers were idle. A title thread's build also passes the big-compile gate ungated, so several title threads could each run a huge driver compile at once.Now a bind with no budget gets the stand-in at once (its dispatches are skipped, its draws draw nothing, exactly as for a pipeline that is
lateafterXCL_PSO_WAIT_MStoday), and the build is sent to the workers. The build is markedwantedbefore it is sent, which is new (the inline build ran ungated on the title's thread and was marked only after it finished): it goes before the builds made ahead and takes the wanted slots ofbig_compile_turn(at mostXCL_HUGE_PSO_WANTED_CONCURRENCY).XCL_PSO_WAIT_MS=<ms>still waits up to that long, unchanged.XCL_ASYNC_PSO=0still builds every pipeline in the create call.Since #2118, a
Dispatch(or a dispatchingExecuteIndirect) whose pipeline is still being built is put off to the list's submit, in a segment (a PC command list) of its own, andExecuteCommandLists/KickoffXrecord it there through the sameresolve_wait. With no budget, the submitting title thread built the pipeline itself if no worker had started it, and waited for it without end. So the wait moved from the bind to the submit, but it was still unbounded and still on a title thread:main08db802stops presenting at 144–150 s on this title (2 runs), and at 136 s on NVIDIA (#2581).With this PR no bind or submit waits for a pipeline until it is built, so nothing is put off:
list_x::deferreturns false whilepso_async::waits_until_built()is false, which it always is with this change. A dispatch whose pipeline is still being built is recorded at once and skipped as a stand-in's, as before #2118. A put-off would only move a wait the submit no longer makes, and it costs a segment per call. With the put-off kept, on top of no wait, 3 walks of this title went past 8 000 put-off calls and lost the device (0x887a0007) at 175 s, 218 s and 222 s; in two of them a GPU fence wait had timed out just before (2 s), in the third no wait had timed out before it.main08db802without this PR, withXCL_PSO_WAIT_MS=1(the put-off and a bounded wait), hung the GPU the same way at 200.6 s (1 walk), as #2581 saw on NVIDIA. So the hang is in that path and not in this change; its exact cause (DRED: a page fault at GPU VA 0) is not found. Without the put-off, 3 of 3 walks ran to 355–361 s with no device removal.What this gives up: a put-off dispatch whose pipeline was built between the recording and the submit ran; it is now skipped. #2118's put-off stays in the code for a mode that waits until a pipeline is built; with this PR there is none. The cases where #2118 waited at the call itself (a list that cannot be split, predication), console-list replay and draws (
graphics_bound) go throughresolve_waittoo, and no longer wait either.Every bind path already handles a stand-in:
Dispatchand console-list replay skip it (is_translated_computeis false for a stand-in and for the shared stand-in driver pipeline),ExecuteIndirectskips it (is_pending), a draw binds the title's root signature and draws nothing (graphics_bound), andSetPipelineState/ClearState/Reset/CreateCommandListbind the stand-in's driver pipeline.This also changes draws:
graphics_boundcalledresolve_waittoo, so a draw of a cold graphics pipeline used to wait for it. Now it draws nothing until the pipeline is built, asSetPipelineStatealready did for graphics pipelines.Sequencing: #2364's
submit_aheaddoc ("a bind that reaches one not started takes the job itself") is no longer true after this; whichever of the two lands second fixes that line.ExecuteIndirectreadsis_pendingafterresolve_wait, so a build that ends between the two sends the stand-in to the PC call. Until now onlyXCL_PSO_WAIT_MS/XCL_PSO_IMAGE_SKIPopened that window; with this PR the default path does too. #2598 fixes that on its own (bound_unbuilt, one lookup), and #1652 fixes it too.#2581 makes
deferreturn false whileXCL_PSO_WAIT_MSis set, for the same reason (a bounded wait makes the put-off only move the wait), afterClose→E_OUTOFMEMORYand a device removal on NVIDIA withXCL_PSO_WAIT_MS=1. With this PR it holds for the default too. Both add an early return at the top ofdefer, so whichever lands second has a small conflict there, and #2581's check becomes part of this one.amd-dev(6a0bb5b4) bounds this wait differently. A draw or dispatch, and a submit's put-off dispatch, waits for its pipeline within a per-frame window of 12 s for each kind (XCL_PSO_FRAME_BUDGET_MS), and the build stays on the workers. This PR is formainand goes further: with no budget there is no wait at all. Whenmainis merged intoamd-dev, it conflicts inpso_async.rs(resolve_wait_for, the module doc, the worker loop) and inbind.rs, andamd-dev's window should be kept there. The whole form of a split program thatExecuteIndirectcompiles on the title's thread (#2404) is not changed here;amd-devalready builds it off that thread.What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs:resolve_wait_forwith no budget calls the newresolve_unwaitedinstead of building and waiting;wait_built(wait until a stand-in's build is over, for tests); module and field docs that said compute pipelines are waited for at their first bind.pso_async.rs): newa_bind_with_no_budget_neither_builds_nor_waits_for_the_pipeline(compute and graphics: the bind returns the stand-in while the build is blocked, the build runs on anxcl-pso*worker and is wanted, then the bind gets the real pipeline). Tests that used a no-budget bind to wait for a build now use a budget (they test the waiting bind:title_held,wanted) orwait_built.bind.rstests,tests/gpu_compute_e2e.rs,tests/gpu_pso_e2e.rs:resolve_waitused to wait for a build →wait_built.execute_indirect_skips_failed_shared_console_compute_standinbuilds its second shell withwait_builtbefore binding it.bind.rs,console_list.rs: two comments that said the bind waits.list_x.rs:deferreturns false whilepso_async::waits_until_built()is false (new,pso_async.rs). D3D12.X: a dispatch waits for its pipeline at the submit, not in the bind #2118's testa_dispatch_with_a_pipeline_still_building_waits_at_the_submitis now..._is_recorded_at_once_and_skipped: no segment is added, each dispatch returns at once and is skipped at the bind, the submit records nothing and does not wait; then the build is let finish and the list runs.real.rs: one comment from D3D12.X: a dispatch waits for its pipeline at the submit, not in the bind #2118 ("compute: waited for at its use") now adds "up toXCL_PSO_WAIT_MS".pso_async.rs,bind.rs):lazy(), theusedmodule,resolve_for_bindand abind_abicomment no longer say a compute bind waits for its build;wait_builtsays it returns at once for a pipeline that is no stand-in.Not in this PR
XCL_PSO_WAIT_MS>0). After this change the bounded wait is opt-in only. Deciding on "a big-compile slot is taken" alone would also skip the wait for pipelines that build in milliseconds and are never gated; the console shader's size is known when the pipeline is created (D3D12.X: start big compute pipelines building when they are created #2364 routes on it) but is not kept inPending, so doing it precisely means recording that size at submit. Deferred for its own measurement, not ruled out.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4ona0734c9f: 1429 passed, 1 failed, 47 ignored. The failure isgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 783,res[64] = 0xc, CPU 0x7fffffff), which fails the same way onmain. The e2e tests pass. SKIPPED: 6×lower_dxilf16/f32 per-lane programs (refused, gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(the driver cache cannot be disabled without Developer Mode).cargo test -p xcl --no-fail-fast -- --test-threads=4ona0734c9f(a3, debug, aftercargo build --workspace): 1428 passed, 2 failed (fuzz_validate_and_gpu_1, and e2etest_title_runs_and_game_folder_is_untouchedwith no desktop session), 47 ignored. Thelist_xtest fails without thedefercheck (0 passed, 1 failed: "a dispatch was put off to the submit").59f8e7c) merged locally, on this tree (built as6336dce1, the same tree asa0734c9f):XCL_PSO_WAIT_MSunset, 2 runs: no put-off, no device removal. Last present at 361 s in run 1. Run 2 was ended at 357 s by the title's int3 afterClose→E_OUTOFMEMORY, when the system had 1.2 GB of physical memory left (73.8 of 95.9 GB committed); that is not a device removal. 12–14 % of dispatches skipped (32 768 of 263 370, 45 789 of 337 045). On average 11.2 and 10.6 presents per 10 s over 120–350 s, unevenly spread.XCL_PSO_WAIT_MS=200, 1 run: no device removal, last present at 356 s, 8 192 of 186 604 dispatches skipped, 6.2 presents per 10 s.60371139(base08db802: this change without thedefercheck, so with D3D12.X: a dispatch waits for its pipeline at the submit, not in the bind #2118's put-off), + D3D12.X: title texture reads outside the coherent window use the safe copy #751, 3 walks: device removed (0x887a0007) at 217.98 s, 174.85 s and 222.23 s, each after more than 8 000 put-off calls; 701 of 33 056, 1 604 of 28 086 and 659 of 35 326 dispatches skipped. The third ran withXCL_DRED=1: a page fault at GPU VA 0, no allocation there.main08db802(2 walks): stops presenting at 144–150 s, no removal.8184b43(base8a3f912): suite 1402 passed, 1 failed (fuzz_validate_and_gpu_1, seed 783, the same onmain), 46 ignored. Walk with D3D12.X: title texture reads outside the coherent window use the safe copy #751, 2 runs: presented to the end, 0 crashes, 0 device removals, 9.0 and 8.2 presents per 10 s after 120 s.55d64c2(PR at7d38980), 2 runs each:mainstopped presenting at ~126 s and ~142 s. This PR presented to the end, at 3–13 presents per 10 s after ~130 s; one run crashed in the texture detile, which D3D12.X: title texture reads outside the coherent window use the safe copy #751 fixes.Regression run
(
scripts/smoke.ps1, same title, 60 s, adjacent runs in the order main, PR, main)main
08db802(run 1):this PR,
a0734c9f:main
08db802(run 2):Not tested
ExecuteIndirector dispatch reads. TheXCL_PSO_WAIT_MSpath skips them the same way, and once hung the GPU like that (see the doc ofimage_skip). No device removal was seen in the 7 walks with this PR, but all of them end in the intro / credits. Later gameplay was not reached.55d64c2(and in a second run in a reproduction) is in XCL's texture detile, not in code this PR changes.title_textures::subresources→gpu::tiling::Chain::detile_levelcopied from title memory thattitle_byteshad borrowed after a singlereadable()check, and a page of it was no longer mapped by then. D3D12.X: title texture reads outside the coherent window use the safe copy #751 fixes that read (0 crashes in 5 walks with it).mainhas the same code but does not reach it in this walk, because it stops presenting at 126–142 s. The walks on8184b43all ran with D3D12.X: title texture reads outside the coherent window use the safe copy #751. This PR alone was not walked on8a3f912, and neither wasmain.Docs
HANDOFF.mdbecomes wrong in two places: line 1051 ("compute is waited for at its first bind / replay (resolve_wait…)") and lines 1420–1421 ("draws wait for pipelines still being built (resolve_waitinbind::graphics_bound…)"). With this PR neither waits unlessXCL_PSO_WAIT_MSis set. Not edited here.AI use