Skip to content

D3D12.X: XCL_PSO_WAIT_MS bounds how long a bind waits for a pipeline being built (retail world renders) - #891

Merged
ivall merged 2 commits into
xcl-dev:mainfrom
Sr-0w:pso-wait-budget
Nov 24, 2026
Merged

ivall merged 2 commits into
xcl-dev:mainfrom
Sr-0w:pso-wait-budget

Conversation

@Sr-0w

@Sr-0w Sr-0w commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

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:

  • the build goes on on XCL's workers, not on the title's thread;
  • the pipeline is then late: until it is built, its binds get the stand-in and do not wait again;
  • their dispatches are skipped, as for a pipeline without a translation.

Unset, nothing changes: a bind waits for the build as before. It is opt-in because skipped dispatches leave their outputs unwritten.

Before / after (main e50836b, same machine, warm driver-blob cache, A pressed at the title screen):

  • before: the loading screen fades to black; the title's watchdog ends it 31-36 s after the world starts loading (seven runs);
  • after (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.

world
world, another run

It is not playable yet. Frames come at under 1 fps, and on main the waits of #708's kind still time out (40 Wait64BitValueX timeouts 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;
    • the test a_bind_waits_for_a_slow_pipeline_no_longer_than_its_budget.

Tested

  • AMD Radeon RX 7800 XT (driver 32.0.32029.2010), Ryzen 7 3700X, Windows 11 26300, rustc 1.100.0, release.
  • cargo test --release --workspace -- --test-threads=4: 661 passed, 3 failed, 21 ignored.
    • The 3 failures are placed_title_textures_share_vram_and_preserve_pixels, transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory.
    • They fail the same way on main (e50836b) with --test-threads=4 and pass alone, on both.
    • No SKIPPED tests.
  • The new test fails when the budget is ignored ("not built within the budget: the stand-in") and passes with it.
  • The retail game with XCL_PSO_WAIT_MS=50, as described above.

Regression run (default settings, XCL_PSO_WAIT_MS unset)

main:

xcl-smoke v1
commit: e50836bdf6f5c026f281d545ed86fb2f07ba6e6a
gpu: AMD  Radeon RX 7800 XT
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1518 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 68390 MB

this PR:

xcl-smoke v1
commit: 5fab11264ee651312d063a465f752f53b6bd6be8
gpu: AMD  Radeon RX 7800 XT
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1543 (PresentX 1543)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18262 MB

Not tested

  • NVIDIA / Intel GPUs.
  • Budgets other than 50 ms and 1000 ms. At 1000 ms the watchdog still ended the run: about 30 late programs in a row each held a thread for 1 s.
  • Whether skipped dispatches can corrupt state the title reads back. That is the reason it is opt-in.

AI use

  • Claude Code, Claude Opus 5.5: traced the stall to resolve_wait from thread dumps, wrote the change and its test, ran the tests and the runs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SKtJseucqXR6iuAE6HBtiA

…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
@S33G

S33G commented Nov 24, 2026

Copy link
Copy Markdown

Testing Nvidia GPU now

@Rednaxeh

Copy link
Copy Markdown
Contributor

Testing this on a second RX 7800 XT (driver 32.0.32029.2010, Ryzen 7 7800X3D, 32 GB, Windows 11 26300): main 1c87b1d against 5fab112 merged onto it (7d5641c), release, same title, 300 s runs with XCL_ACTIVITY=1 XCL_TRACE_FAULTS=1 XCL_THREAD_DUMP_AT=…, with and without XCL_PSO_WAIT_MS=50. On main here the run ends in the watchdog at 115 s with four title threads in resolve_wait under set_pipeline_state and one 300 KB compute pipeline taking 13.1 s in the driver (dumps in #232). Report here today.

AI use: Claude Code (Claude Fable 5.1) wrote this note; the runs are mine.

@dcastell1

Copy link
Copy Markdown

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 main@beaa245 (713 passed, 0 failed, 41 ignored on this box):

patch -p1 < this PR            # clean, no fuzz
cargo test --workspace -- --test-threads=4
714 passed; 0 failed; 41 ignored   (exit 0)

The new test runs and passes here: hle::d3d12x::pso_async::used_tests::a_bind_waits_for_a_slow_pipeline_no_longer_than_its_budget.

Two notes from reading it, neither a blocker:

  1. XCL_PSO_WAIT_MS=0 now means "do not wait at all", because the value goes straight through Duration::from_millis. In the theaustinayers/xcl modified build the same variable means the opposite (0 = wait until the build ends, "as before"), so anyone carrying that value over gets skipped dispatches instead of the old blocking behaviour. A one-line comment on the variable, or treating 0 as unset, would stop that trap.
  2. The bounded path is good about the thread: resolve_within never calls complete(&p, job()) itself, only the unbounded path still builds on the caller's thread — which is the behaviour this PR exists to avoid when the variable is set.

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.

@burber

burber commented Nov 24, 2026

Copy link
Copy Markdown

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. main 11920b5 (with #795 / #797 / #866 / #897) + #533 + #267 + #640. Title 1.0.2.1, XCL_NETWORK=0, XCL_PAGE_BUDGET_MB=6144 (without it local video memory goes ~2 GB past this card), and 304 driver blobs precompiled offline (#744's approach).

XCL_COMPUTE_PSO_WAIT_MS=50 XCL_PSO_WAIT_MS=50:

4 s waits (runs 15–18) 50 ms waits (run 19)
end watchdog +0x23cf683 at 127–149 s no watchdog; process alive until 380 s
bounded binds 10–13 "still building after 4000 ms" 41 at 50 ms
compute pipelines from kept blobs 0–32 64

What happens after loading starts in run 19:

GPU queue.Wait at 0x70417fee8 >= 0x7f9 did not complete within 5000 ms (waiter=q0/ty2, prod=qSome(1)/tySome(0), recorded=0x7f9, submitted=0x7f9, completed=0x7f8) – released on CPU
GPU queue.Wait at 0x70417fe68 >= 0x7f9 did not complete within 5000 ms (waiter=q0/ty2, prod=qSome(3)/tySome(2), …)
GPU queue.Wait at 0x70417fe10 >= 0x7f9 did not complete within 5000 ms (waiter=q0/ty2, prod=qSome(1)/tySome(0), …)
  • 380.5 s: D3D12 device removed: 0x887a0006, then the title's assert 0x80000003 at +0x2474606.

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
@Sr-0w

Sr-0w commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the runs.

@dcastell1, good catch on 0. In the latest commit, XCL_PSO_WAIT_MS=0 now means the same as unset: wait until the pipeline is built. Only a positive value bounds the wait. On your second point: yes, the bounded path never builds on the title's thread. That is on purpose.

@Rednaxeh, your main result matches mine: watchdog at about 115 s, title threads in resolve_wait under set_pipeline_state, one compute program taking 10-30 s in the driver. I'm looking forward to the XCL_PSO_WAIT_MS=50 numbers.

An update from more runs here (RX 7800 XT), to keep expectations honest:

  • XCL_PSO_WAIT_MS=50 gets past the loading screen to the first world frames, but the runs still end between 120 s and 260 s. Hundreds of pipelines go late (513 in one run). The title then reads what their skipped dispatches did not write: crashes reading 0xffffffffffffffff, or values that look like +inf.
  • XCL_PSO_WAIT_MS=2000 skips far fewer (about 33), but about 30 two-second waits in a row bring the watchdog back (at about 160 s).
  • A late pipeline goes to the back of the shared build queue, behind tens of thousands of pipelines built ahead of use. A separate queue for pipelines a bind is waiting on did not change the outcome in my one run, so it is not in this PR.

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.

@S33G

S33G commented Nov 24, 2026

Copy link
Copy Markdown

With XCL_PSO_WAIT_MS=50 on an RTX 3090, the second run recorded at least 257 pipeline wait expirations and crashed at 76.518 s reading 0x29e45 at title offset +0x4e59848. An earlier run reached 325 seconds and exited when the window was closed.

Tested

  • PR head 5fab11264ee651312d063a465f752f53b6bd6be8, built with cargo build --workspace --release --locked and Rust 1.100.0 MSVC.
  • Ryzen 9 7900X3D, RTX 3090, NVIDIA 610.88, Windows 11 24H2 build 26100.9974, DXC 1.9.2602.17. Both runs used the same XCL title data directory. Both logs show reuse of cached driver blobs.
  • The launcher opened the same title from two different game folders. These runs have no matched baseline with the wait budget unset.
Observation First run Second run
Outcome Window closed at 325.028 s, exit 0 Unhandled access violation at 76.518 s
PresentX count in report 9,412 1,377
50 ms pipeline wait expirations 3 logged At least 257 (last logged count)
Last logged cumulative skipped dispatches 13 at 295.831 s 42 at 73.927 s
Logged 2 s Wait64BitValueX timeouts 0 4

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.

@Rednaxeh

Copy link
Copy Markdown
Contributor

RDNA3 (second RX 7800 XT): with XCL_PSO_WAIT_MS=50 the watchdog no longer fires and the loading completes, but both runs end 3 s later in a GPU hang (0x887a0006); the world did not render here.

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. main 1c87b1d, and 5fab112 merged onto it (7d5641c, clean). Title 1.0.2.1, own copy, warm DXIL cache; the driver's own shader cache warmed by the earlier runs of the day. Each run: xcl run, 300 s limit, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_TRACE_FAULTS=1 XCL_FRAME_DUMP=120 XCL_THREAD_DUMP_AT=90,110,150,200, one A press at ~14 s, nothing else. Four runs, one after the other:

run build ends presents at 0 from skipped draws / dispatches pipelines late (built past 50 ms) peak local VRAM PSO builds on title threads
1 main watchdog +0x23cf683 at 105.4 s 82 s 0 / 0 – 13.9 GB 72.8 s total, longest 29.9 s (391 KB DXIL)
2 PR, no variable watchdog at 107.4 s 84 s 0 / 0 – 20.6 GB 63.9 s, longest 14.3 s
3 PR, XCL_PSO_WAIT_MS=50 device removed 0x887a0006 at 102.4 s 82 s 2,048 / 4,968 (of 11,704 / 6,084) 513 22.9 GB 67.9 s, longest 22.3 s
4 PR, XCL_PSO_WAIT_MS=50, again device removed 0x887a0006 at 105.1 s 82 s 6,061 / 2,220 (of 12,301 / 25,303) 1,025 22.8 GB 111.3 s, longest 58.7 s (1.09 MB DXIL)
  • Runs 1 and 2 are the stop this PR is about, as on your RX 7800 XT: four title threads in pso_async::resolve_wait under bind::set_pipeline_state at the crash, the longest single build 29.9 s in amdxc64.
  • With the budget (runs 3 and 4) the watchdog never fires: 513 / 1,025 pipelines go late and their binds go on. In run 4 the loading finished: the loading art faded, a black screen, then a movie with sound drawn as a flat green (its planes read as zeros, the Retail game on NVIDIA: the intro movie is one flat green (its YUV planes read as zeros) #280 picture; 65536 so far textures in GPU views by then, twice the 32,768 of the other runs) – furthest screen so far on this card. Then, both times, the driver reported the GPU hung (DXGI_ERROR_DEVICE_HUNG) and the title ended with 0x80000003: 102.4 s and 105.1 s, 3 s after the last console code so far line. Presents were at 0 from 82 s in all four runs, budget or not.
  • What the budget does not change here: the driver still builds the big compute programs on the title's threads (run 4: 111 s of builds in 105 s of run, one of 58.7 s), and local video memory goes to 22.8 GB on a 16 GB card.
  • Not looked at: which skipped dispatch (or the oversubscribed video memory) hangs the GPU; a budget other than 50 ms; XCL_FRAME_DUMP had no frame to dump after 72 s (no presents).

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.

@ryosen0

ryosen0 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Cross-check on RTX 3060 Ti 8 GB (Ryzen 7 9800X3D, driver 32.0.16.1742, Windows 11, release) of 8cada26 with XCL_PSO_WAIT_MS=50, on the other retail title (ScarlettGame), 150 s scripted press-walk (25/35/45/55/65/80/95/110/125/140 s), XCL_NETWORK=0 XCL_ACTIVITY=1:

  • clean exit at the 150 s cap, 4153 frames, steady 60 presents / 2 s to the end, 0 device removals, 0 crashes
  • 0 skipped dispatches and 0 skipped draws in the console-code tallies (32,768 translated draws / 3,487 dispatches by t≈149 s) — on this card the builds finish inside the 50 ms budget in this phase, so the late path was never taken
  • 0 frame-event waits timed out; same 128 BCPack refusals as without the knob (that wall is DirectStorage: unpack BCPack BC1, BC3, BC4, BC5, BC6H and BC7 streams #905's territory, not this PR's)

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: XCL_PSO_WAIT_MS didn't exist in main-line trees before this PR, so earlier reports on other threads that set it were setting an inert variable; worth saying explicitly so nobody reads those as evidence about this change.

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.

@Prime1997

Prime1997 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RTX 3060 Ti 8 GB, Series S profile, player-controlled prologue test at 50 ms

We tested 5fab112 on Windows 11 build 26200, driver 617.14, with an i5-10400. Our integration was based on upstream 09940bb and included #615 and #495. We used XCL_PSO_WAIT_MS=50, XCL_PSO_PRELOAD=0, and the same starting profile and shader cache as our previous run. I pressed A myself. The later 8cada26 change affects an explicit zero budget. Exact source tested

Player run First failure after pressing A What the display did
Previous integration, unbounded waits (689ea7b) 220.9 s, watchdog at +0x23cf683 Loading artwork, then 29.2 s without presents before the fault
#891 integration, 50 ms (06fb44a) 207.2 s, breakpoint 0x80000003 at +0xb59278 Loading artwork, a black interval, then artwork again. Frames were still being submitted 1.8 s before the fault.

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 INTRO_min / Prestream with 793 streaming requests outstanding. We saw no playable world, GPU removal, or Wait64BitValueX timeout. Texture decompression errors also occurred. We have not established what triggered the new breakpoint.

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

@Rednaxeh

Copy link
Copy Markdown
Contributor

Follow-up to my report above: the budget swept over 50 / 500 / 2000 ms on the same RX 7800 XT, same build (7d5641c), same command, one A press at ~12–14 s. The question was whether the GPU hang at 50 ms comes from the skipped dispatches or from the video memory going past the card.

XCL_PSO_WAIT_MS ends pipelines late skipped draws / dispatches PSO builds on title threads peak local VRAM
unset watchdog 107.4 s – 0 / 0 63.9 s 20.6 GB
50 (two runs) device hung 102.4 s and 105.1 s 513 / 1,025 2,048 / 4,968 and 6,061 / 2,220 67.9 s, 111.3 s 22.9 GB
500 watchdog 105.3 s 129 128 / 142 167.8 s 22.9 GB
2000 watchdog 105.3 s 33 68 / 64 103.3 s 22.3 GB
  • With 500 and 2000 ms the title waits up to the budget at each bind and the sum of those waits trips its watchdog like main does: the stop moves by nothing. Only 50 ms gets past it, by skipping thousands of dispatches, and then the GPU hangs three seconds after the loading ends. So on this card there is no budget that both avoids the watchdog and keeps the GPU alive; a bound on the wait is not enough here, the builds have to leave the title's threads (the direction of D3D12.X: compute pipelines are built ahead of their first bind #889 / D3D12.X: bound compute pipeline waits so slow compiles do not trip wa… #533).
  • Video memory is the same in every run, budget or not: local VRAM goes from ~13 GB to 20–23 GB between 70 and 80 s, the moment presents stop in all of them, on a 16 GB card. So the oversubscription is not caused by the skips; whether the hang at 50 ms needs it I cannot tell from these runs. Commit peaks at 37–38 GB (32 GB RAM, 12 GB page file).
  • A first 500 ms run died at 32 s, in the intro movie, in title_textures::refresh → subresources → Chain::detile_level (0xC0000005, a read of the title's memory at a page it had just unmapped): the fault D3D12.X: title texture reads outside the coherent window use the safe copy #751 fixes, unrelated to this PR; the run was repeated.

Logs of all seven runs kept. AI use: Claude Code (Claude Fable 5.1) read the logs and wrote this; the runs were mine.

@throny

throny commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

World-loading run of 5fab112 on an RTX 4080 with XCL_PSO_WAIT_MS=50, against main on the same machine. One run of the PR, so read it as a data point; the PR has since moved to 8cada26, which I have not run.

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 16 GB (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 stable-x86_64-pc-windows-msvc; release builds. 5fab112 merged onto main 09940bb (clean merge); main runs on 1c87b1d.
  • xcl run <folder> with XCL_NETWORK=0, XCL_ACTIVITY=1, one key press at the profile prompt, 300 s limit, DXIL and driver-blob caches warm from earlier runs of main.
main 1c87b1d (two runs) this PR, XCL_PSO_WAIT_MS=50
last 2 s interval with a present 78 s, 78 s 108 s (after 80 s only three intervals had any: 2, 1 and 1 presents)
stop 107.9 s, 108.1 s (the #534 location) 137.9 s (the #232 title's location)
skipped at the end 0 draws, 0 dispatches 4 096 of 17 075 draws, 518 of 23 413 dispatches
peak commit 30.4 GB, 31.5 GB 32.3 GB
  • So here the budget moves the stop about 30 s later and to the other watchdog site, but the world does not render in this run: presents stay near zero after 80 s. No device removal.
  • A main run right after it stopped at 108.1 s as before, so the pipelines this run built in the background did not get main past the stall on the next run.

Not tested

AI use

  • Claude Code (Claude Fable 5.2) read the diff, built both trees, ran the title and wrote this report. No game data attached.

@emirduran707

emirduran707 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

AMD RDNA4 test report for 8cada26 (this PR's head, on main d5442d2), XCL_PSO_WAIT_MS=50.

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 Wait64BitValueX waits and then a -1 read, as on the other GPUs.

Second run: this PR merged onto main 077ce40 (local merge, no conflicts; that main has #795, which bridges Wait64BitValueX to GPU queue waits). Same machine, same settings, plus XCL_FRAME_DUMP=120.

  • 0 Wait64BitValueX timeouts. The log shows the waits "bridged to GPU queue.Wait".
  • 22 binds hit the 50 ms limit. By 115 s: 1 024 draws skipped of 16 119, and 910 dispatches skipped of 8 766.
  • No heartbeat abort, but presents still stopped. From 104 s there were 0 presents and 0–9 submits per 2 s.
  • The last frame dump (82.7 s) is the dark loading screen. No world was drawn in any dump.
  • It ended with 0x887a0006 (DXGI_ERROR_DEVICE_HUNG) at about 130 s, as on @Rednaxeh's RX 7800 XT.
    • Local video memory was at 15.4 GB of 16 GB just before.
    • After the removal, every CreateHeap of the sparse windows was refused with 0x887a0005.

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.

@milas6669

milas6669 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Correction to the setup line (added later): these runs were not entirely without input. The log of each run has GameInput: gamepad buttons 0x4 pressed for the first time (an A press from the PC's keyboard or pad, pressed by hand, not scripted) at 19–166 s depending on the run, and the first call of #101 (the start of world loading) came 70–89 s after that press in 16 of the 17 runs I checked (one run with a 2048 MB coherent window: 106.6 s). So where a comment says the world-load start varies between runs, it follows when A was pressed. The stalls, crashes and the other numbers are as measured.

A first NVIDIA Ampere (RTX 3070, 8 GB) result for XCL_PSO_WAIT_MS=50, plus two measurements of the stall that remains. Not a regression run (no xcl-smoke blocks, and a 30 GB memory watchdog of mine ended one run).

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: main 077ce40 + this PR's head 8cada26 (clean merge). XCL_NETWORK=0, retail title, 4095 MB coherent window, warm caches, no scripted input.

Run A (XCL_PSO_WAIT_MS=50, 300 s limit): without the cap the title stops at about 106 s and ends itself with +0x23cf683 (nine runs in #675). With it:

  • the burst of compute dispatches comes at 112–114 s (7146 dispatches in one 2 s window), then 0 presents / 0 submits / 0 draws from 116 s to 136 s, then the title recovers at 138 s (2755, 6954, 4514 dispatches per 2 s windows, but only 1 present per 2 s);
  • it stops again at 146 s and ends itself at 173.4 s with the sibling site +0x2215c35 (write at 0x0), not +0x23cf683: about 30 s after the last present (144 s);
  • the log has 22 a pipeline still being built after 50 ms lines, the counter at 513 by 124 s; 4 Dispatch with a pipeline that has no translated console shader ... skipped lines; no device removal;
  • during the 20 s stall XCL built pipelines in 1–3 s each, so it was not waiting for a long build.

Run B (this PR + #924, XCL_TRACE_WAITS=1, thread dumps every 10 s, nvidia-smi once a second, 330 s limit): the same shape. First call of the console method #101 at 105.7 s; 6669 dispatches in the window ending 112 s; 0 presents, 0 submits, 0 draws from 116 s to 136 s; recovery at 138 s; last present 144.1 s; my memory watchdog (30 GB private) then ended the run, so the self-kill was not reached.

  • The GPU was idle during the stall: nvidia-smi showed 0–1 % utilisation, the 210 MHz idle clock and 26 W from about 124 s to 136 s, and 100 % as soon as the title recovered at 138 s (the nvidia-smi rows are matched to the log by their order, so they can be off by a few seconds, but the 100 % starts at the recovery). So the wait is on the CPU side, not the GPU working through the burst.
  • The dump at 130 s lists waits of 14.7–19.2 s, so they started at about 111–115 s; 14 title threads sit in WaitForSingleObject from the same site (game_scarlett_master.exe+0x221c3c2, no timeout) since about 110.8 s. I did not symbolise the XCL-side stacks, so I cannot say which thread the stall depends on.

What I did not test: other budgets than 50 ms; a run to the end of the stall on main with the new commits; AMD. An earlier combined run (this PR + #924, 200 s limit) stayed on the loading screen at 30 fps the whole time and never reached the world (no #101), which fits how the world-load start moves between 89 s and 241 s in my runs, so it says nothing about the stall.

AI use: Claude Code, Claude Sonnet 5.5, ran the commands and wrote this comment.

@sander110419

Copy link
Copy Markdown

Test report: Linux, NVIDIA. This PR also fixes the watchdog crash there.

Before (same tree, XCL_PSO_WAIT_MS unset), two runs: the loading screen renders at 28–30 fps, then presents stop and the title's watchdog ends it at +0x23cf683 (write to 0). The thread dump at the crash shows five of the title's threads in pso_async::resolve_wait_for (via cl_set_pipeline_state), waiting on compute builds.

After (XCL_PSO_WAIT_MS=50), one run: no crash in 330 s; the run ended at my timeout. 22 pipelines went late, and 4 ExecuteIndirect with a pipeline still being built were skipped. Frames slowed from 28.8 fps (92 s) to 9.8 fps (139 s); after that fewer than 300 more frames came before the end. I did not capture what the screen showed after 145 s.

Not tested: Windows, AMD, cargo test on this commit, #708 together with this.

AI use: Hermes agent with Claude Opus 5.5 (claude-opus-5-5) ran the builds and runs and wrote this report; I pressed A and checked it.

@upipibi upipibi mentioned this pull request Nov 24, 2026
isaacwingate added a commit to isaacwingate/xcl that referenced this pull request Nov 24, 2026
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>
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 24, 2026
…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)
@NAbobo101

Copy link
Copy Markdown

8 GB NVIDIA data point for XCL_PSO_WAIT_MS=50 on main 67a3735 (which has this PR, #634, #690 and #631). It gets the title further on this card, through the end of the loading screen, but the world stays black and the watchdog still ends it, about 100–200 s later than without it.

Setup

Runs

run XCL_PSO_WAIT_MS end compute PSOs built peak local video memory process commit
1 unset watchdog (+0x23cf683), 185.7 s 23 12.6 GB 25.4 GB
2 50 watchdog, 369.7 s 210 14.1 GB 30.3 GB
3 50 watchdog, 346.9 s 291 14.5 GB 31.0 GB
4 50 watchdog, 395.9 s 351 12.8 GB 27.5 GB

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 Wait64BitValueX timeout per run, so #708's kind of wait doesn't look like the block here.

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

  • Other budgets than 50 ms; a run with input past the loading screen.
  • The test suite on this commit.
  • AMD.

AI use

  • Claude Code (Claude Opus 5.5) scripted and ran the runs, read the logs and screenshots and drafted this comment. I checked the results.

anoyarou added a commit to anoyarou/xcl that referenced this pull request Nov 24, 2026
…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)
@crosettiremi

Copy link
Copy Markdown

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.

XCL_PSO_WAIT_MS At the 16,384 translated-draw milestone Last positive 2 s present sample Terminal event
1 0 skipped draws, 4 skipped dispatches 194.1 s GPU page fault / device hung at 196.3 s
50 0 skipped draws, 0 skipped dispatches 216.1 s Guest access violation at +0x23cf683, write to zero, after the 240 s activity sample

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.

@crosettiremi

crosettiremi commented Nov 24, 2026 •

Copy link
Copy Markdown

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.

Executed compute dispatches Skipped dispatches, control Skipped dispatches, priority
1,024 3 3
2,048 7,383 123
4,096 16,601 13,282

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.

isaacwingate added a commit to isaacwingate/xcl that referenced this pull request Nov 24, 2026
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>
isaacwingate added a commit to isaacwingate/xcl that referenced this pull request Nov 24, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.