Repository navigation
D3D12.X: XCL_PSO_WAIT_MS bounds how long a bind waits for a pipeline being built (retail world renders) - #891
Conversation
…being built
A retail game creates compute programs on its own threads and binds them at
once. The driver takes up to 30 s for the biggest translated ones, and the
bind waited for the build (`resolve_wait`). Once its world starts loading,
the title met programs not built yet, its main thread was held, and its
watchdog ended it 30 s later ("GPU Loc Sig", issue xcl-dev#505).
With `XCL_PSO_WAIT_MS=<ms>` a bind waits at most that long. The build then
goes on on the workers, not on the title's thread. Until it is done, the
pipeline is late: its binds get the stand-in, and their dispatches are
skipped, as for a pipeline without a translation. Unset, a bind waits for
the build as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKtJseucqXR6iuAE6HBtiA
|
Testing Nvidia GPU now |
|
Testing this on a second RX 7800 XT (driver 32.0.32029.2010, Ryzen 7 7800X3D, 32 GB, Windows 11 26300): AI use: Claude Code (Claude Fable 5.1) wrote this note; the runs are mine. |
|
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on clean The new test runs and passes here: Two notes from reading it, neither a blocker:
Tree restored afterwards (md5 and a full diff against a clean checkout); hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it. |
|
NVIDIA RTX 4070 Ti (12 GB) with 50 ms bounded waits: no watchdog any more; ~5 min later the GPU hangs Same idea as this PR, on a stack that already bounds the waits:
I haven't run this exact PR; this is the same behaviour from those two. Setup: RTX 4070 Ti 12 GB (driver 32.0.16.1062), i5-13600K, 32 GB RAM + 32 GB page file, Windows 11 26300, DXC 1.8.2502.
What happens after loading starts in run 19:
So on NVIDIA the bounded waits get past the watchdog, as on your RX 7800 XT, and the next wall here is a GPU hang. Whether that comes from dispatches skipped with stand-ins (their outputs never written), or from a producer queue that never reaches 0x7f9, I can't tell from this run. Investigated with AI assistance; all numbers are from runs on my machine. |
Reported in review: another build gives 0 that meaning, and 0 here skipped every dispatch of a pipeline still being built. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKtJseucqXR6iuAE6HBtiA
|
Thanks for the runs. @dcastell1, good catch on @Rednaxeh, your An update from more runs here (RX 7800 XT), to keep expectations honest:
So this PR removes the watchdog from the driver compile wait, but it is not enough on its own to play. The rest is getting those compute programs built before they are needed. AI use: Claude Code (Claude Opus 5.5) wrote the change and this reply. |
|
With Tested
In the second run, a two-second DirectStorage sample at 54.030 s recorded 6,473 requests and 821 failures. The four GPU waits then timed out between 69.976 and 75.991 s. The logs leave open whether a skipped dispatch, a storage failure, or another condition caused the invalid read. Presentation counts measure calls to PresentX. The counters alone cannot establish world rendering or playability. The dispatch counts above are the last periodic samples and include skips from all causes. AI use: Codex (gpt-6.2-astra) analyzed the local reports and logs and drafted this comment. |
|
RDNA3 (second RX 7800 XT): with Setup: AMD Radeon RX 7800 XT 16 GB, driver 32.0.32029.2010 (64-lane waves); Ryzen 7 7800X3D; 32 GB RAM, 12 GB page file; Windows 11 Pro 26300 (native); release builds, rustc 1.100.0 msvc, DXC 1.9.2602.17.
So on this RDNA3 the PR turns the watchdog into a GPU hang three seconds later, and the world does not render; it does get the title one screen further. Logs kept if useful. AI use: Claude Code (Claude Fable 5.1) read the logs and wrote this report; the runs and the input were mine on the hardware above. Counts, times and RVAs only. |
|
Cross-check on RTX 3060 Ti 8 GB (Ryzen 7 9800X3D, driver 32.0.16.1742, Windows 11, release) of
So on a second NVIDIA host the opt-in knob is inert-but-safe in the menu/load phase: no regression, no skipped work. The interesting regime is yours — builds of 16–31 s on RDNA — which this card doesn't reproduce (our biggest programs build in well under a second here). One note for the description: I can't confirm the world-render claim from here within my run window (150 s): this title's world load is blocked by the BCPack refusals regardless of pipeline waits. Once #905 lands I can re-run this pairing deeper into the load. AI use: GPT-6.2 Astra (API model selector) in DSH built the head, ran the walk, read the log, and drafted this comment; the human contributor reviewed the numbers before posting. |
|
RTX 3060 Ti 8 GB, Series S profile, player-controlled prologue test at 50 ms We tested
The 50 ms run logged at least 16 budget expirations. Its final report counted 3,548 presents. The game’s crash report put it in The integrations differ by the intervening allocator changes in #897 and #907 as well, so this is a hardware result on the combined build. The local workspace suite passed 856 tests with 48 ignored. Two wave64-only test bodies skipped on this card. Codex helped integrate the commits and analyze the logs and captured frames. Follow-up on the new breakpoint. In the local title image, the path to +0xb59278 checks a one-byte field at object offset +0x1a and accepts values 1 through 5. The crash registers indicate zero. The matching minidump contains the object. The first 64 bytes of the object were zero. Its allocation base matches the 16 GiB reservation that XCL identified at startup as outside its GPU windows. We have not established which component should have initialized this field or whether a skipped dispatch contributed. I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. Test coordination on Discord |
|
Follow-up to my report above: the budget swept over 50 / 500 / 2000 ms on the same RX 7800 XT, same build (
Logs of all seven runs kept. AI use: Claude Code (Claude Fable 5.1) read the logs and wrote this; the runs were mine. |
|
World-loading run of Tested
Not tested
AI use
|
|
AMD RDNA4 test report for 8cada26 (this PR's head, on Tested
What the log shows with this PR:
So on RDNA4 too, the 50 ms budget removes the heartbeat abort. What stops the title next is the Second run: this PR merged onto
So on RDNA4, with this PR and #795 together, both the heartbeat abort and the 64-bit wait timeouts are gone, and the next stop is a GPU hang soon after loading, with dispatches skipped. Not tested: the suite on this head; more than one run of each; other budgets (500 / 2000 ms); cold caches. Tested and written with Claude Code (Claude Opus 5.5). The runs were made on my machine; the run used this PR's build: its log has the PR's "still being built after 50 ms" lines. |
A first NVIDIA Ampere (RTX 3070, 8 GB) result for Setup: RTX 3070 8 GB (32-lane waves), i9-10900KF, 31.9 GB RAM, Windows 11 Pro 10.0.26200, rustc 1.100.0, release. Build: Run A (
Run B (this PR + #924,
What I did not test: other budgets than 50 ms; a run to the end of the stall on AI use: Claude Code, Claude Sonnet 5.5, ran the commands and wrote this comment. |
|
Test report: Linux, NVIDIA. This PR also fixes the watchdog crash there.
Before (same tree, After ( Not tested: Windows, AMD, AI use: Hermes agent with Claude Opus 5.5 ( |
A bind of a pipeline that is not built yet waits in resolve_wait, and builds it itself when no worker has started it - until it is built unless XCL_PSO_WAIT_MS sets a limit (ivall#891), and with no trace in the log. On an NVIDIA GPU a retail title's threads sat there for 3 - 23 s at a time in the driver's compiler; it took a profiler of the title's threads to see it, and the title's hang watchdog ended the run (ivall#505, ivall#675). resolve_wait now counts the calls that found their pipeline not built, for graphics and compute apart: how many, their total and longest time, and how many built it in the call. A wait with a limit is counted with the time it waited; a late pipeline's later binds, which do not wait, are not. The counts are logged at every power of two, and each wait of a second or more is logged (the first 32). Nothing else changes. Measured with it on that title (RTX 5080, XCL_NETWORK=0, 240 s): 16 compute binds built their pipeline in the call, 92.7 s in all, the longest 22.7 s; no graphics bind waited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ll#1221, and updated Linux PRs Update fork README for upstream/main 930e8b4 (BCPack BC1-BC7, XCL_PSO_WAIT_MS, low-VA ASLR < 2^40, alloc_pool, sparse tile parking/pool reuse, direct page moves, write-watch merge), newly integrated PRs (ivall#1078, ivall#1097, ivall#1139, ivall#1142, ivall#1150, ivall#1156, ivall#1182, ivall#1191, ivall#1195, ivall#1221), and updated Linux PRs (ivall#867, ivall#871, ivall#877). Assisted-by: Antigravity (Google DeepMind)
|
8 GB NVIDIA data point for Setup
Runs
With the budget, the screenshots show the loading-screen artwork up to about 270 s, then a black window. The title keeps working after that: at 317 s in run 3, a 2 s activity line has 0 presents but 390 draws and 1293 dispatches. Then the watchdog fires. I saw at most one The memory columns are probably part of it on this card: local video memory goes to 12.8–14.5 GB on an 8 GB GPU, and the process commit reaches 31 GB on a 32 GB machine. A later run in the same session ran the machine low enough on memory that my test script was stopped. Not tested
AI use
|
…d harden compute/sparse paths - crates/xcl/src/hle/d3d12x/pso_async.rs (fixes 1 MiB thread stack overflow / deadlock seen alongside ivall#611): Add urgent_queue() spawning dedicated 64 MiB-stack xcl-pso-wait-* workers and offload unstarted jobs in resolve_wait_for(..., None) instead of executing job() inline on the title's 1 MiB stack threads, avoiding silent Wine thread deaths without skipping compute dispatches (ivall#675, ivall#891). Guard build() with std::panic::catch_unwind plus a Drop completion guard so panics always call complete(p, 0) and notify waiters. - crates/xcl/src/hle/d3d12x/pso_async.rs & kernelx.rs (ivall#1288, ivall#505, ivall#232): Track active pipeline bind waits via HELD / title_held() and export kernelx::Sleep backed by title_sleep() so Sleep skips counting time spent blocked on background PSO compilation (XCL_SLEEP_HOLD=0 disables). - crates/xcl/src/hle/d3d12x/bind.rs, device_x.rs & real.rs (ivall#1195): Track console compute PSOs (CONSOLE_COMPUTE) and Dispatch-capable command signatures (DISPATCH_SIGNATURES) so ExecuteIndirect skips dispatches against untranslated console compute stand-ins or fallbacks while still forwarding native PC compute pipelines. - crates/xcl/src/hle/d3d12x/sparse.rs (ivall#1419, ivall#1277): Extract wait_fence_until() to ResetEvent before SetEventOnCompletion and re-check GetCompletedValue() until target or deadline so stale signals on the reusable auto-reset event cannot end waits early; bail cleanly from upload_dirty() if ring fence reclaim times out instead of holding STATE indefinitely. - crates/xcl/src/gpu/recomp/emit.rs & tests.rs (ivall#1361): Split GFX10.30 SADDR == 0x7F (ST immediate-only 0u base) from SADDR == 0x7D (v[ADDR] base) in Em::scratch and update ENC_FLAT_SCRATCH VADDR test encodings to 0x7D. Assisted-by: Antigravity (Gemini 4 Neon)
|
RX 7900 XT, Windows, retail Series X profile. I compared 1 ms and 50 ms on the same downstream executable, with identical starting DXIL/PSO caches, two DXC workers, and the same scripted Player1 selection at 33 s. This stack includes #1464 and direct texture uploads. One run per setting.
With 50 ms, skips appeared later during world streaming: by 219.145 s XCL logged 265 skipped draws and 7,217 skipped dispatches. Peak process commit was 25,674 MB, with no device removal in this run. Captured frames were still dark after the splash. I could not reproduce the visible terrain on this stack. Early skip counts alone would have missed the later behavior. |
|
A follow-up on the RX 7900 XT to distinguish queue backlog from a slow compile. I instrumented skipped direct Dispatch calls in a downstream Series X build with XCL_PSO_WAIT_MS=1, two DXC workers, and speculative preload disabled. Immediately after a failed resolution I checked whether the pipeline job still existed in the worker queue, had been taken for building, or had completed. The small race between resolution and observation can only describe the state when sampled. At 216.803 s, 26,624 skipped calls had been sampled: 26,568 still had an unclaimed build job and 56 had a job already taken. No completed/failed or ABI-binding reason was counted in that sample. These are calls, not unique shaders. The bounded per-shape table overflowed for 317 calls; the reason counters include all calls. The game accepted Player1 and streamed assets, but the last captures were dark and it exited on a guest breakpoint at RVA 0xf2cc4b, with no logged device removal. This run does not identify which missing compute result prevented the scene from drawing. I am comparing the same executable with only the 16 repeatedly missed shader-set keys seeded for preload. The numbers above are from the control. Targeted preload follow-up: same executable, same initial DXIL/driver blobs, 16 repeatedly missed compute keys in the isolated used-pipeline manifest. XCL acknowledged all 16 keys and logged 16 pipelines built ahead of first use by 11.356 s. This run stopped before the account picker on a second-chance guest write to zero at RVA 0x2215c35; last activity at 44.156 s, peak sampled process commit 13,372 MB, no device removal. A separate Rust build overlapped part of startup. There is no comparable world-stage dispatch sample in this run. Queue priority experiment (same base as the diagnostic control, preload off): when a compute pipeline's bounded wait expired, I promoted its unclaimed job. Same worker count; an ordinary FIFO selection after each burst of three promotions. All six async PSO tests passed. One hardware run per build, same initial application caches and job cap; picker input at 47 s and 45 s.
The last priority sample still recorded 16,238 unclaimed jobs out of 16,384 skipped direct calls (counts are calls, not distinct jobs). It ended with device removal at 194.478 s, fault VA 0xdcbe63000 without a named allocation; the last captured frame remained dark. This changes which work gets serviced during the burst, but it did not restore world rendering on this run. Runs 89/90, RX 7900 XT on Windows. Both started from independent copies of the same cache with 16 late compute pipelines prepared offline. A second native-device pass reused 16/16 driver blobs. Both selected Player1 at about 45 s with speculative preload disabled. With the regular queue (89), 7,537 dispatches had been skipped at 2,048 executed and 18,050 at 4,096. With an opt-in on-demand worker for just those keys (90), the counts were 762 and 7,248. The worker logged 16 completions by 184.426 s. The runs can execute different work at the same count. Both last captures were dark. Run 89 stopped at guest breakpoint +0xf2cc4b. Run 90 stopped at 196.692 s with device-hung 0x887a0006, DRED VA 0x26000, no named allocations. This isolates a measurable queueing effect in these two runs. It did not restore world rendering or player control. |
A bind of a pipeline that is not built yet waits in resolve_wait, and builds it itself when no worker has started it - until it is built unless XCL_PSO_WAIT_MS sets a limit (xcl-dev#891), and with no trace in the log. On an NVIDIA GPU a retail title's threads sat there for 3 - 23 s at a time in the driver's compiler; it took a profiler of the title's threads to see it, and the title's hang watchdog ended the run (xcl-dev#505, xcl-dev#675). resolve_wait now counts the calls that found their pipeline not built, for graphics and compute apart: how many, their total and longest time, and how many built it in the call. A wait with a limit is counted with the time it waited; a late pipeline's later binds, which do not wait, are not. The counts are logged at every power of two, and each wait of a second or more is logged (the first 32). Nothing else changes. Measured with it on that title (RTX 5080, XCL_NETWORK=0, 240 s): 16 compute binds built their pipeline in the call, 92.7 s in all, the longest 22.7 s; no graphics bind waited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A bind of a pipeline that is not built yet waits in resolve_wait, and builds it itself when no worker has started it - until it is built unless XCL_PSO_WAIT_MS sets a limit (xcl-dev#891), and with no trace in the log. On an NVIDIA GPU a retail title's threads sat there for 3 - 23 s at a time in the driver's compiler; it took a profiler of the title's threads to see it, and the title's hang watchdog ended the run (xcl-dev#505, xcl-dev#675). resolve_wait now counts the calls that found their pipeline not built, for graphics and compute apart: how many, their total and longest time, and how many built it in the call. A wait with a limit is counted with the time it waited; a late pipeline's later binds, which do not wait, are not. The counts are logged at every power of two, and each wait of a second or more is logged (the first 32). Nothing else changes. A wait still going is logged too, once it passes a second (from the thread xcl-pso-waits, which runs only while a wait is open): the wait a title's hang watchdog ends it in never returns, so it is never counted. report.json gets the counts (pipeline_waits). Measured with it on that title (RTX 5080, XCL_NETWORK=0, 240 s): 16 compute binds built their pipeline in the call, 92.7 s in all, the longest 22.7 s; no graphics bind waited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of #505.
A retail game creates its compute programs on its own threads and binds them right away. A bind of a compute pipeline waited for the build (
resolve_wait). The driver takes up to 30 s for the biggest translated programs (378 KB of DXIL: 16 s; 685 KB: 31 s on an RX 7800 XT).Once the world starts loading, the title meets programs that are not built yet and its threads are held. The main thread's heartbeat then stops, and the title's watchdog ends it 30 s later (
+0x23cf683, "GPU Loc Sig"). The driver-blob cache does not get past this: each run stops at the next program not built yet, before its build ends.With
XCL_PSO_WAIT_MS=<ms>, a bind waits at most that long:Unset, nothing changes: a bind waits for the build as before. It is opt-in because skipped dispatches leave their outputs unwritten.
Before / after (
maine50836b, same machine, warm driver-blob cache, A pressed at the title screen):XCL_PSO_WAIT_MS=50): the world renders. The first 3D frames (sky, clouds, terrain) are below, and the process was still running at 240 s, when the run ended.It is not playable yet. Frames come at under 1 fps, and on
mainthe waits of #708's kind still time out (40Wait64BitValueXtimeouts in the run above). With #708 merged as well, there were no timeouts, but the run crashed at 158 s on garbage read from a buffer (likely a skipped dispatch's output).What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs:wait_budget(XCL_PSO_WAIT_MS);resolve_wait_for/resolve_within: a bounded wait, which hands the build to the workers;Pending::late;a_bind_waits_for_a_slow_pipeline_no_longer_than_its_budget.Tested
cargo test --release --workspace -- --test-threads=4: 661 passed, 3 failed, 21 ignored.placed_title_textures_share_vram_and_preserve_pixels,transitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memory.main(e50836b) with--test-threads=4and pass alone, on both.XCL_PSO_WAIT_MS=50, as described above.Regression run (default settings,
XCL_PSO_WAIT_MSunset)main:
this PR:
Not tested
AI use
resolve_waitfrom thread dumps, wrote the change and its test, ran the tests and the runs.🤖 Generated with Claude Code