D3D12.X: bound compute pipeline waits so slow compiles do not trip wa… #533

Closed
github-bot wants to merge 1 commit from gh-pr/533/head into gh-pr/533/base
Owner

@⁠XaviFortes on GitHub · 2026-11-24 01:28 UTC · original
XaviFortes:pso-async-bounded-compute-wait → main · +408 −31 · 3 files · 1 commits · closed without merging

  • crates/xcl/src/hle/d3d12x/bind.rs: use pso_async::resolve_for_indirect in dispatch and execute_indirect; skip pending compute stand-ins in execute_indirect (DISPATCHES_SKIPPED) instead of forwarding to PC ExecuteIndirect; extend async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect to verify pending compute stand-ins are skipped.
  • crates/xcl/src/hle/d3d12x/present.rs: call pso_async::reset_frame_budget() at each PresentX boundary.
    Tested
  • Hardware / OS / toolchain: AMD Radeon RX 7900 XT (20420 MiB VRAM), AMD64 Family 25 Model 33 Stepping 2 (Zen 3), Windows 11 (10.0.26200.0), DXC 1.8.2502.11, rustc 1.98.1, debug (tests) and release (smoke).
  • cargo build --workspace && cargo test --workspace -- --test-threads=4: 680 passed, 0 failed, 41 ignored, 0 SKIPPED GPU tests.
  • New / updated tests: bounded_compute_wait_times_out_then_resolves_once_worker_finishes, bounded_compute_wait_returns_real_when_build_finishes_in_time, bounded_compute_wait_shares_per_frame_budget_across_pipelines (3 passed in 0.08 s), and async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect (1 passed in 0.04 s).
  • Retail title smoke run: 60 s run on clean HEAD 359851f9ee117e8241dbf0505ccacb17077d56fc completes with 1,304 frames (60 60 60 presents/2 s), 14,817 MB peak commit, 0 crashes, and 0 device removals.

Regression run

xcl-smoke v1
commit: 4017f8ff8faaae6007fd83910d230a027dd85a33
gpu: AMD Radeon RX 7900 XT
seconds: 60
exit: 0x0
frames shown: 1195 (PresentX 1196)
presents per 2 s (last 3): 56 54 57
device removals: 0
crashes: 0
peak commit: 14950 MB
xcl-smoke v1
commit: 001e37d400c5591b59b3f23a4f7090301b1e6d20
gpu: AMD Radeon RX 7900 XT
seconds: 60
exit: 0x0
frames shown: 1374 (PresentX 1374)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14942 MB

Not tested

  • NVIDIA / Intel GPUs and wave32-only adapters.
  • Other retail titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant).
  • Long gameplay soak combined with #267.
    AI use
  • Antigravity with Gemini 4 Neon: diagnosed the crash dump from xcl.log, wrote unit tests, and updated the PR description; all builds, tests, and smoke runs were executed locally on the hardware listed above.
**@⁠XaviFortes** on GitHub · 2026-11-24 01:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/533) `XaviFortes:pso-async-bounded-compute-wait` → `main` · +408 −31 · 3 files · 1 commits · closed without merging - `crates/xcl/src/hle/d3d12x/bind.rs`: use `pso_async::resolve_for_indirect` in `dispatch` and `execute_indirect`; skip pending compute stand-ins in `execute_indirect` (`DISPATCHES_SKIPPED`) instead of forwarding to PC `ExecuteIndirect`; extend `async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect` to verify pending compute stand-ins are skipped. - `crates/xcl/src/hle/d3d12x/present.rs`: call `pso_async::reset_frame_budget()` at each `PresentX` boundary. **Tested** - Hardware / OS / toolchain: AMD Radeon RX 7900 XT (20420 MiB VRAM), AMD64 Family 25 Model 33 Stepping 2 (Zen 3), Windows 11 (10.0.26200.0), DXC 1.8.2502.11, `rustc 1.98.1`, debug (tests) and release (smoke). - `cargo build --workspace && cargo test --workspace -- --test-threads=4`: 680 passed, 0 failed, 41 ignored, 0 `SKIPPED` GPU tests. - New / updated tests: `bounded_compute_wait_times_out_then_resolves_once_worker_finishes`, `bounded_compute_wait_returns_real_when_build_finishes_in_time`, `bounded_compute_wait_shares_per_frame_budget_across_pipelines` (3 passed in 0.08 s), and `async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect` (1 passed in 0.04 s). - Retail title smoke run: 60 s run on clean HEAD `359851f9ee117e8241dbf0505ccacb17077d56fc` completes with 1,304 frames (`60 60 60` presents/2 s), 14,817 MB peak commit, 0 crashes, and 0 device removals. **Regression run** ``` xcl-smoke v1 commit: 4017f8ff8faaae6007fd83910d230a027dd85a33 gpu: AMD Radeon RX 7900 XT seconds: 60 exit: 0x0 frames shown: 1195 (PresentX 1196) presents per 2 s (last 3): 56 54 57 device removals: 0 crashes: 0 peak commit: 14950 MB ``` ``` xcl-smoke v1 commit: 001e37d400c5591b59b3f23a4f7090301b1e6d20 gpu: AMD Radeon RX 7900 XT seconds: 60 exit: 0x0 frames shown: 1374 (PresentX 1374) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14942 MB ``` **Not tested** - NVIDIA / Intel GPUs and wave32-only adapters. - Other retail titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant). - Long gameplay soak combined with #267. **AI use** - Antigravity with Gemini 4 Neon: diagnosed the crash dump from `xcl.log`, wrote unit tests, and updated the PR description; all builds, tests, and smoke runs were executed locally on the hardware listed above.
Compute pipeline first-bind and ExecuteIndirect resolution previously ran uncached DXC + driver builds inline via resolve_wait on the title's render thread with no timeout, tripping retail watchdog aborts when large compute shaders take 20+ s to compile.

Move compute pipeline builds onto a dedicated xcl-pso-compute-* worker pool so graphics backlogs cannot starve compute builds, bound total compute wait time with a shared per-frame budget (XCL_COMPUTE_PSO_WAIT_MS, default 4000 ms, 0 = unbounded) reset at PresentX, recover sent on channel send failure, and skip pending compute stand-ins in ExecuteIndirect cleanly (matching Dispatch) until the background build finishes.

Assisted-by: Antigravity (Gemini 4 Neon)

# Conflicts:
#	crates/xcl/src/hle/d3d12x/bind.rs

# Conflicts:
#	crates/xcl/src/hle/d3d12x/pso_async.rs
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:24:54 +00:00
github-bot closed this pull request 2026-11-26 04:24:54 +00:00
Author
Owner

@⁠nieahax on GitHub · 2026-11-24 01:31 UTC · original

thanks sm antigravity this is exactly what we were stuck on over here!

**@⁠nieahax** on GitHub · 2026-11-24 01:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7119179197) thanks sm antigravity this is exactly what we were stuck on over here!
Author
Owner

@⁠yyc160 on GitHub · 2026-11-24 01:43 UTC · original

Direction makes sense — getting the build off the title's render thread and bounding the wait is the right shape for the watchdog. Three things to look at before this goes in.

1. execute_indirect sends the stand-in to the PC implementation. In bind.rs, dispatch handles an untranslated pipeline by skipping it:

if !super::real::is_translated_compute(pso) {
    xlog_warn!("... Dispatch with a pipeline that has no translated console shader ...");
    count(DISPATCHES_SKIPPED);
    return;
}

execute_indirect does not:

if !gfx && !compute {
    return pc(this, sig, max, args, args_off, count_buf, count_off);
}

Before this PR that branch was rare, because resolve_wait either returned the real pipeline or blocked. With a bounded wait, the stand-in becomes an everyday return value — so this call now reaches ID3D12GraphicsCommandList::ExecuteIndirect on the PC list with a PSO the PC driver has never seen. Does that need to skip like dispatch does, or is the command list a PC one whose PSO was already set? Worth confirming, because it is the one place where a timed-out pipeline is still passed onward.

2. sent never recovers if the send fails. if !p.sent.swap(true, AcqRel) { queue().send(...) } — if send returns Err (a SyncSender that is full or disconnected), sent stays true and the job is never queued again, so the pipeline never lands and every later bind takes the stand-in path. A failed send should clear sent and either retry with backoff or wake the waiters with the error.

3. A bounded wait does not help when the workers themselves are stuck. #156 is exactly this: all xcl-pso-* threads sit inside nvgpucomp64.dll on the heap lock. Timeout returns the thread to the title, which is the point, but the compute pipeline is now queued behind jobs that may never finish, so its dispatches are skipped indefinitely rather than for 4 seconds. If compute can end up behind a wall of large graphics programs, it may need a reserved worker or a separate pool — otherwise this turns "the title hangs" into "the title runs with a class of dispatches missing", which is harder to attribute when someone reports a wrong frame.

Two smaller ones:

  • compute_wait_timeout bounds one bind. A title that binds ten uncached compute pipelines in a row still spends up to 10 × 4000 ms in these waits. A shared per-frame budget would bound the total.
  • timed_out is checked after real, so a late-landing pipeline is picked up on the next bind — that ordering looks right to me, just noting it as the reason the permanent flag is acceptable.

Not tested: no smoke run. The GPU on this machine was at 100 % from an unrelated process for the whole session, so any frame timing from here would be meaningless. Everything above is from reading the diff and the two call sites; the execute_indirect question in particular should be settled by someone who can run the title on an idle card.

**@⁠yyc160** on GitHub · 2026-11-24 01:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7119376890) Direction makes sense — getting the build off the title's render thread and bounding the wait is the right shape for the watchdog. Three things to look at before this goes in. **1. `execute_indirect` sends the stand-in to the PC implementation.** In `bind.rs`, `dispatch` handles an untranslated pipeline by skipping it: ```rust if !super::real::is_translated_compute(pso) { xlog_warn!("... Dispatch with a pipeline that has no translated console shader ..."); count(DISPATCHES_SKIPPED); return; } ``` `execute_indirect` does not: ```rust if !gfx && !compute { return pc(this, sig, max, args, args_off, count_buf, count_off); } ``` Before this PR that branch was rare, because `resolve_wait` either returned the real pipeline or blocked. With a bounded wait, the stand-in becomes an everyday return value — so this call now reaches `ID3D12GraphicsCommandList::ExecuteIndirect` on the PC list with a PSO the PC driver has never seen. Does that need to skip like `dispatch` does, or is the command list a PC one whose PSO was already set? Worth confirming, because it is the one place where a timed-out pipeline is still passed onward. **2. `sent` never recovers if the send fails.** `if !p.sent.swap(true, AcqRel) { queue().send(...) }` — if `send` returns `Err` (a `SyncSender` that is full or disconnected), `sent` stays `true` and the job is never queued again, so the pipeline never lands and every later bind takes the stand-in path. A failed send should clear `sent` and either retry with backoff or wake the waiters with the error. **3. A bounded wait does not help when the workers themselves are stuck.** #156 is exactly this: all `xcl-pso-*` threads sit inside `nvgpucomp64.dll` on the heap lock. Timeout returns the thread to the title, which is the point, but the compute pipeline is now queued behind jobs that may never finish, so its dispatches are skipped indefinitely rather than for 4 seconds. If compute can end up behind a wall of large graphics programs, it may need a reserved worker or a separate pool — otherwise this turns "the title hangs" into "the title runs with a class of dispatches missing", which is harder to attribute when someone reports a wrong frame. Two smaller ones: - `compute_wait_timeout` bounds one bind. A title that binds ten uncached compute pipelines in a row still spends up to 10 × 4000 ms in these waits. A shared per-frame budget would bound the total. - `timed_out` is checked after `real`, so a late-landing pipeline is picked up on the next bind — that ordering looks right to me, just noting it as the reason the permanent flag is acceptable. **Not tested:** no smoke run. The GPU on this machine was at 100 % from an unrelated process for the whole session, so any frame timing from here would be meaningless. Everything above is from reading the diff and the two call sites; the `execute_indirect` question in particular should be settled by someone who can run the title on an idle card.
Author
Owner

@⁠sperm on GitHub · 2026-11-24 01:47 UTC · original

Test report: f849ecc (this PR) merged onto main 508a0c7, retail GTA VI on AMD RX 9070 XT (RDNA4), but under Linux/Wine, which XCL doesn't support. Treat it as a data point, not a Windows regression run.

Tested

  • RX 9070 XT (RADV GFX1201, Mesa), CachyOS, kernel 7.3.4. Proton Experimental's Wine, vkd3d-proton 3.1 (release, from_iface checks relaxed as in #257), DXVK dxgi, DXC 1.9.2609.
  • XCL release build cross-compiled from Linux (-Zbuild-std, lld-link).
  • VKD3D_CONFIG=ignore_shared_fence XCL_NETWORK=0 XCL_COHERENT_MB=512, isolated network namespace, DualSense as XInput pad 0.
  • One run of each, played by hand into the world:
main 508a0c7 + #533
presents 2,841 2,235
fps (300-frame windows) 30 → 29.5 → 6.9 30 → 14.3 → 7.7 → 21.4 → 7.6
still building after 4000 ms – proceeding with stand-in – 4× (at 176.9, 180.9, 184.9, 189.5 s)
end 0xc0000005 write at +0x23cf683 at 229.8 s the same at 202.7 s
title crash context (main run) Game Running, 3m18s, frame 2455, 637 streaming requests not written this run

So on this setup the bounded wait works as described (the four slow compute builds went to the background), but the "GPU Loc Sig" abort (#505 / #534) still came, at about the same point. Whatever starves it here isn't only first-bind compute waits. The frame rate falls to about 7 fps for a minute or more before the abort in both runs.

Not tested: cargo test (the crate doesn't build natively on Linux), Windows, smoke.ps1, other XCL_COMPUTE_PSO_WAIT_MS values, #267 together with this.

AI use: Claude Code, Claude Opus 5.5: merged and built the branch, ran it, and wrote this report from the logs (the runs were played by a person).

**@⁠sperm** on GitHub · 2026-11-24 01:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7119446363) Test report: `f849ecc` (this PR) merged onto `main` `508a0c7`, retail GTA VI on **AMD RX 9070 XT (RDNA4)**, but **under Linux/Wine**, which XCL doesn't support. Treat it as a data point, not a Windows regression run. **Tested** - RX 9070 XT (RADV GFX1201, Mesa), CachyOS, kernel 7.3.4. Proton Experimental's Wine, vkd3d-proton 3.1 (release, `from_iface` checks relaxed as in #257), DXVK `dxgi`, DXC 1.9.2609. - XCL release build cross-compiled from Linux (`-Zbuild-std`, `lld-link`). - `VKD3D_CONFIG=ignore_shared_fence XCL_NETWORK=0 XCL_COHERENT_MB=512`, isolated network namespace, DualSense as XInput pad 0. - One run of each, played by hand into the world: | | `main` `508a0c7` | + #533 | |---|---|---| | presents | 2,841 | 2,235 | | fps (300-frame windows) | 30 → 29.5 → **6.9** | 30 → 14.3 → 7.7 → 21.4 → **7.6** | | `still building after 4000 ms – proceeding with stand-in` | – | 4× (at 176.9, 180.9, 184.9, 189.5 s) | | end | `0xc0000005` write at `+0x23cf683` at 229.8 s | the same at 202.7 s | | title crash context (main run) | `Game Running`, 3m18s, frame 2455, 637 streaming requests | not written this run | So on this setup the bounded wait works as described (the four slow compute builds went to the background), but the "GPU Loc Sig" abort (#505 / #534) still came, at about the same point. Whatever starves it here isn't only first-bind compute waits. The frame rate falls to about 7 fps for a minute or more before the abort in both runs. **Not tested:** `cargo test` (the crate doesn't build natively on Linux), Windows, `smoke.ps1`, other `XCL_COMPUTE_PSO_WAIT_MS` values, #267 together with this. **AI use:** Claude Code, Claude Opus 5.5: merged and built the branch, ran it, and wrote this report from the logs (the runs were played by a person).
Author
Owner

@⁠XaviFortes on GitHub · 2026-11-24 02:00 UTC · original

Thanks everyone for the reviews and extra testing (@⁠thehollowedone, @⁠yyc160, @⁠CryingLaughing, @⁠sperm)! I pushed an updated commit (359851f) addressing the feedback:

ExecuteIndirect pending compute stand-ins: now skipped cleanly (DISPATCHES_SKIPPED, matching Dispatch) instead of forwarding a timed-out stand-in to PC ExecuteIndirect, with the unit test in bind.rs extended to cover it.
Shared per-frame wait budget: XCL_COMPUTE_PSO_WAIT_MS is now shared across all uncached compute binds within a frame and reset on PresentX, so binding multiple new compute pipelines in one frame (like the 4 consecutive 4 s waits in the RADV log) queues all of them without multiplying wait time.
Dedicated compute worker pool (xcl-pso-compute-*): compute pipelines no longer sit behind graphics PSO backlogs/stalls (#156).
sent recovery: enqueue() clears sent if channel send ever fails instead of wedging future binds.

Also updated the PR description with the fresh 60 s smoke run and noted that non-compute stalls (e.g., graphics waits in #267) can still independently trigger +0x23cf683.

**@⁠XaviFortes** on GitHub · 2026-11-24 02:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7119671720) Thanks everyone for the reviews and extra testing (@⁠thehollowedone, @⁠yyc160, @⁠CryingLaughing, @⁠sperm)! I pushed an updated commit (359851f) addressing the feedback: ExecuteIndirect pending compute stand-ins: now skipped cleanly (DISPATCHES_SKIPPED, matching Dispatch) instead of forwarding a timed-out stand-in to PC ExecuteIndirect, with the unit test in bind.rs extended to cover it. Shared per-frame wait budget: XCL_COMPUTE_PSO_WAIT_MS is now shared across all uncached compute binds within a frame and reset on PresentX, so binding multiple new compute pipelines in one frame (like the 4 consecutive 4 s waits in the RADV log) queues all of them without multiplying wait time. Dedicated compute worker pool (xcl-pso-compute-*): compute pipelines no longer sit behind graphics PSO backlogs/stalls (#156). sent recovery: enqueue() clears sent if channel send ever fails instead of wedging future binds. Also updated the PR description with the fresh 60 s smoke run and noted that non-compute stalls (e.g., graphics waits in #267) can still independently trigger +0x23cf683.
Author
Owner

@⁠grahamster2 on GitHub · 2026-11-24 02:02 UTC · original

Test run of f849ecc merged onto main 508a0c7 + #451 + #435, on the retail title that trips #232. Result: bounding the wait alone does not get past the watchdog on NVIDIA. The compile backlog is longer than the title's ~28 s hang watchdog.

Setup: RTX 3080 10 GB, Ryzen (12 threads), 32 GB, Windows 11 26200, release build, XCL_NETWORK=0, A presses at 14–31 s, 240 s runs.

What happens (3 runs, the last with this PR)

  • Presents drop to 0 at ~78 s, when the world load starts. The process then dies at 105–107 s with the title's write to 0 at +0x23cf683. +0x2215c35 is on its stack, so this is the #232 watchdog. It is the same with and without this PR.
  • No Wait64BitValueX ... timed out lines in any run.
  • Thread dumps (function names from the PDB):
    • main without this PR, at 90/95 s: 4–5 title render-job threads in pso_async::resolve_wait ← resolve_for_bind ← bind::set_pipeline_state, each building a compute PSO itself: translate, then DXC (compile_cached_in → dxc::compile), then the driver (nvgpucomp64). On a cold cache a 381 KB CS took 11.5 s in the driver and a 309 KB one 8 s.
    • with this PR, at 100 s: the title threads cycle through resolve_compute (4 s bounded waits, one new pipeline after another). One thread is in execute_indirect → resolve_for_indirect → resolve_wait, so it is unbounded. The XboxBvhBuilder thread waits in set_pipeline_state → resolve_compute. 4 xcl-pso workers wait in translated_compute_pso for the BIG_COMPILES slot (most: 1), 2 are inside the driver compiler, and 3 DXC threads are busy.
  • The cache warms from run to run: 104 new DXC compiles in run 2, then 71 in run 3 (this PR). About 115 compute PSOs are built between 75 s and the crash. Each run still dies at the same point.

Question: is the intended direction to raise BIG_COMPILES (commit permitting; this machine had ~30 GB of commit headroom left) or to precompile compute pipelines ahead of time (xcl shaders --precompile --only cs --pipelines)? Bounded waits keep the threads moving, but the title still needs those results before it presents.

#567 (bounded wait_for_commit) does not apply to this stall: no worker was in wait_for_commit in these dumps; the slot holder was compiling in the driver.

Test report written with Claude Code (Claude Opus 5.5) from my own runs.

**@⁠grahamster2** on GitHub · 2026-11-24 02:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7119691770) Test run of `f849ecc` merged onto `main` 508a0c7 + #451 + #435, on the retail title that trips #232. **Result: bounding the wait alone does not get past the watchdog on NVIDIA.** The compile backlog is longer than the title's ~28 s hang watchdog. **Setup**: RTX 3080 10 GB, Ryzen (12 threads), 32 GB, Windows 11 26200, release build, `XCL_NETWORK=0`, A presses at 14–31 s, 240 s runs. **What happens (3 runs, the last with this PR)** - Presents drop to 0 at ~78 s, when the world load starts. The process then dies at 105–107 s with the title's write to 0 at `+0x23cf683`. `+0x2215c35` is on its stack, so this is the #232 watchdog. It is the same with and without this PR. - No `Wait64BitValueX ... timed out` lines in any run. - Thread dumps (function names from the PDB): - main without this PR, at 90/95 s: 4–5 title render-job threads in `pso_async::resolve_wait` ← `resolve_for_bind` ← `bind::set_pipeline_state`, each building a compute PSO itself: translate, then DXC (`compile_cached_in` → `dxc::compile`), then the driver (`nvgpucomp64`). On a cold cache a 381 KB CS took 11.5 s in the driver and a 309 KB one 8 s. - with this PR, at 100 s: the title threads cycle through `resolve_compute` (4 s bounded waits, one new pipeline after another). One thread is in `execute_indirect` → `resolve_for_indirect` → `resolve_wait`, so it is unbounded. The `XboxBvhBuilder` thread waits in `set_pipeline_state` → `resolve_compute`. 4 `xcl-pso` workers wait in `translated_compute_pso` for the `BIG_COMPILES` slot (`most: 1`), 2 are inside the driver compiler, and 3 DXC threads are busy. - The cache warms from run to run: 104 new DXC compiles in run 2, then 71 in run 3 (this PR). About 115 compute PSOs are built between 75 s and the crash. Each run still dies at the same point. **Question**: is the intended direction to raise `BIG_COMPILES` (commit permitting; this machine had ~30 GB of commit headroom left) or to precompile compute pipelines ahead of time (`xcl shaders --precompile --only cs --pipelines`)? Bounded waits keep the threads moving, but the title still needs those results before it presents. #567 (bounded `wait_for_commit`) does not apply to this stall: no worker was in `wait_for_commit` in these dumps; the slot holder was compiling in the driver. _Test report written with Claude Code (Claude Opus 5.5) from my own runs._
Author
Owner

@⁠XaviFortes on GitHub · 2026-11-24 02:10 UTC · original

Gonna fix the CI that fails, not a problem really just that the runner is 2-cores and cannot handle that much when bumping cores

**@⁠XaviFortes** on GitHub · 2026-11-24 02:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7119828342) Gonna fix the CI that fails, not a problem really just that the runner is 2-cores and cannot handle that much when bumping cores
Author
Owner

@⁠qinrxx on GitHub · 2026-11-24 02:20 UTC · original

@⁠XaviFortes we've been preparing a change in pso_async.rs that overlaps this PR and #539, so here is how they layer, before any of them lands.

What #533 doesn't have, in one line: a bind that is waiting on a compute pipeline should jump to the front of the compute pool's queue.

Why that matters, and why it comes from the other two:

  • #539's commit a5c4937 already builds compute pipelines in the background when the game makes them (graphics stay lazy), and its workers skip pipelines the game has already released. So the "build when made" part is #539's, not ours to claim. Our local branch does the same thing and isn't opened.
  • With that on top of this PR, a title that makes many compute pipelines while loading fills this PR's compute pool (2–4 workers, compile_threads() / 2 clamped) with builds nobody waits for yet. tiagonleal's run on #232 made 265, 133 of them in the first 20 s (https://github.com/ivall/xcl/issues/232#issuecomment-7119800304). The pipeline a bind actually waits for queues behind them, so under your budget more dispatches go without their pipeline.
  • Building early on its own doesn't move the stall: in tiagonleal's experiment the watchdog write went from 168.9 s to 170.9 s. The waits that remain are what your budget and this ordering are for. imnicho measured 200–400 KB compute programs at a median 26.9 s on an RTX 5080 (#267).

So after #533 lands, the only piece from our side worth having:

  1. In the compute pool, builds a bind is waiting for go ahead of builds started early.
  2. Possibly skipping pipelines the game has already released, if #539 is split up without it.

Nothing else from our branch. Our graphics-first queue isn't needed, because your separate pools already keep graphics builds out of the compute queue.

Would you like (1) in #533 directly? If not, we'll send it as a small PR on top of #533 once it lands, with its own tests and regression runs.

For whoever resolves the merges: our branch and #533 conflict in four places in pso_async.rs, and our branch drops the mpsc import that your pools use. But if (1) goes into #533 or on top of it, our branch isn't needed.

AI use: Claude Code (Claude Opus 5.5) read the three diffs, did the trial merge and wrote this comment.

**@⁠qinrxx** on GitHub · 2026-11-24 02:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7120035917) @⁠XaviFortes we've been preparing a change in `pso_async.rs` that overlaps this PR and #539, so here is how they layer, before any of them lands. **What #533 doesn't have, in one line:** a bind that is waiting on a compute pipeline should jump to the front of the compute pool's queue. **Why that matters, and why it comes from the other two:** - #539's commit `a5c4937` already builds compute pipelines in the background when the game makes them (graphics stay lazy), and its workers skip pipelines the game has already released. So the "build when made" part is #539's, not ours to claim. Our local branch does the same thing and isn't opened. - With that on top of this PR, a title that makes many compute pipelines while loading fills this PR's compute pool (2–4 workers, `compile_threads() / 2` clamped) with builds nobody waits for yet. tiagonleal's run on #232 made 265, 133 of them in the first 20 s (https://github.com/ivall/xcl/issues/232#issuecomment-7119800304). The pipeline a bind actually waits for queues behind them, so under your budget more dispatches go without their pipeline. - Building early on its own doesn't move the stall: in tiagonleal's experiment the watchdog write went from 168.9 s to 170.9 s. The waits that remain are what your budget and this ordering are for. imnicho measured 200–400 KB compute programs at a median 26.9 s on an RTX 5080 (#267). **So after #533 lands, the only piece from our side worth having:** 1. In the compute pool, builds a bind is waiting for go ahead of builds started early. 2. Possibly skipping pipelines the game has already released, if #539 is split up without it. Nothing else from our branch. Our graphics-first queue isn't needed, because your separate pools already keep graphics builds out of the compute queue. Would you like (1) in #533 directly? If not, we'll send it as a small PR on top of #533 once it lands, with its own tests and regression runs. For whoever resolves the merges: our branch and #533 conflict in four places in `pso_async.rs`, and our branch drops the `mpsc` import that your pools use. But if (1) goes into #533 or on top of it, our branch isn't needed. AI use: Claude Code (Claude Opus 5.5) read the three diffs, did the trial merge and wrote this comment.
Author
Owner

@⁠XaviFortes on GitHub · 2026-11-24 02:26 UTC · original

Fixed, if anybody elseThanks everyone for the reviews and extra testing (@⁠thehollowedone, @⁠yyc160, @⁠CryingLaughing, @⁠sperm, @⁠qinrxx)!

I've pushed an updated commit (5e6aca8) addressing the review feedback:

Pending compute stand-ins in ExecuteIndirect (@⁠thehollowedone, @⁠yyc160): bind::execute_indirect now checks pso_async::is_pending_compute and skips cleanly (DISPATCHES_SKIPPED, matching bind::dispatch) instead of forwarding a timed-out stand-in to native PC ExecuteIndirect. Extended async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect to cover this path.
Shared per-frame wait budget (@⁠yyc160, @⁠sperm): XCL_COMPUTE_PSO_WAIT_MS (default 4000 ms, 0 = unbounded) is now a shared per-frame budget reset at each PresentX boundary, so binding multiple uncached compute pipelines in one frame (like the 4 back-to-back 4 s waits in the RADV run) queues all of them without multiplying wait time.
Dedicated compute worker pool (@⁠yyc160): compute pipelines now run on their own xcl-pso-compute-* pool ((compile_threads / 2).clamp(2, 4) threads) so graphics PSO backlogs/stalls (#156) cannot starve compute builds indefinitely, and a single slow compute shader won't head-of-line block faster ones on low-core hosts.
sent recovery (@⁠yyc160): enqueue() clears sent if channel send fails instead of leaving future binds wedged.
Scope note (@⁠sperm, @⁠CryingLaughing): updated the PR description with the fresh 60 s smoke run on 5e6aca8 and noted that non-compute stalls (e.g., unbounded graphics waits covered by #267) can still independently trigger +0x23cf683 ("GPU Loc Sig").
Compute queue priority (@⁠qinrxx): makes total sense, especially once #539's eager compute builds layer on top! Since #533 is already ~357 lines and CI is green, let's keep #533 focused and land your jump-to-front priority ordering as a small follow-up PR on top of #533 once it merges.

All CI checks and the full local workspace suite (680 passed, 0 failed, 41 ignored) are green.

**@⁠XaviFortes** on GitHub · 2026-11-24 02:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7120140327) Fixed, if anybody elseThanks everyone for the reviews and extra testing (@⁠thehollowedone, @⁠yyc160, @⁠CryingLaughing, @⁠sperm, @⁠qinrxx)! I've pushed an updated commit (5e6aca8) addressing the review feedback: Pending compute stand-ins in ExecuteIndirect (@⁠thehollowedone, @⁠yyc160): bind::execute_indirect now checks pso_async::is_pending_compute and skips cleanly (DISPATCHES_SKIPPED, matching bind::dispatch) instead of forwarding a timed-out stand-in to native PC ExecuteIndirect. Extended async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect to cover this path. Shared per-frame wait budget (@⁠yyc160, @⁠sperm): XCL_COMPUTE_PSO_WAIT_MS (default 4000 ms, 0 = unbounded) is now a shared per-frame budget reset at each PresentX boundary, so binding multiple uncached compute pipelines in one frame (like the 4 back-to-back 4 s waits in the RADV run) queues all of them without multiplying wait time. Dedicated compute worker pool (@⁠yyc160): compute pipelines now run on their own xcl-pso-compute-* pool ((compile_threads / 2).clamp(2, 4) threads) so graphics PSO backlogs/stalls (#156) cannot starve compute builds indefinitely, and a single slow compute shader won't head-of-line block faster ones on low-core hosts. sent recovery (@⁠yyc160): enqueue() clears sent if channel send fails instead of leaving future binds wedged. Scope note (@⁠sperm, @⁠CryingLaughing): updated the PR description with the fresh 60 s smoke run on 5e6aca8 and noted that non-compute stalls (e.g., unbounded graphics waits covered by #267) can still independently trigger +0x23cf683 ("GPU Loc Sig"). Compute queue priority (@⁠qinrxx): makes total sense, especially once #539's eager compute builds layer on top! Since #533 is already ~357 lines and CI is green, let's keep #533 focused and land your jump-to-front priority ordering as a small follow-up PR on top of #533 once it merges. All CI checks and the full local workspace suite (680 passed, 0 failed, 41 ignored) are green.
Author
Owner

@⁠alpz1000 on GitHub · 2026-11-24 02:02 UTC · original · edited 2026-11-24 02:27 UTC

Independent timing check of f849ecc738a4791cbdf8eca9c174824562e8586e on Intel Core i5-8400, Windows 11 Home 26200.9974, Rust 1.100.0 x86_64-pc-windows-msvc, debug.

Tested: cargo test --locked -p xcl --lib bounded_compute_wait -- --test-threads=2 --nocapture passed both tests. Then I reran the same test executable with bounded_compute_wait --test-threads=2 in 30 fresh processes. All 30 passed both tests (60 test executions, no failures or skips). The tests cover returning the real pipeline when ready in time and timing out then resolving after the worker finishes.

Not tested: actual driver compilation latency, retail loading or watchdog behavior, and the full workspace suite. These tests use synthetic timing.

AI use: OpenAI Codex (GPT-6) ran the local tests and drafted this report.

Follow-up on revised head 359851f9ee117e8241dbf0505ccacb17077d56fc

On the same machine, cargo test --locked -p xcl --lib -- --test-threads=4 bounded_compute_wait async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect passed all four tests. I repeated the same filters with four threads in 30 fresh processes: 30/30 passed, 120 test executions, no test skips. This includes exhausting the wait budget across two slow pipelines, resetting it for the next frame in the test, and skipping ExecuteIndirect while its compute pipeline is still pending. This remains synthetic coverage; no driver compile or retail title was exercised. Codex ran and summarized the checks.

Follow-up on revised head 5e6aca8305a3d555437046ecc310988fc32ddfbb

Same Windows/i5-8400 machine and Rust toolchain. cargo test --locked -p xcl --lib -- --test-threads=2 --nocapture bounded_compute_wait async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect passed all four. The log recorded ExecuteIndirect with pending compute pipeline ... skipped from the exercised branch. Then I reran the same four tests with two test threads in 30 fresh processes: 30/30 passed, 120 test executions, no test skips. No retail title or real driver compile was tested. Codex ran and summarized the checks.

**@⁠alpz1000** on GitHub · 2026-11-24 02:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7119689989) · edited 2026-11-24 02:27 UTC Independent timing check of `f849ecc738a4791cbdf8eca9c174824562e8586e` on Intel Core i5-8400, Windows 11 Home 26200.9974, Rust 1.100.0 x86_64-pc-windows-msvc, debug. **Tested**: `cargo test --locked -p xcl --lib bounded_compute_wait -- --test-threads=2 --nocapture` passed both tests. Then I reran the same test executable with `bounded_compute_wait --test-threads=2` in 30 fresh processes. All 30 passed both tests (60 test executions, no failures or skips). The tests cover returning the real pipeline when ready in time and timing out then resolving after the worker finishes. **Not tested**: actual driver compilation latency, retail loading or watchdog behavior, and the full workspace suite. These tests use synthetic timing. **AI use**: OpenAI Codex (GPT-6) ran the local tests and drafted this report. **Follow-up on revised head `359851f9ee117e8241dbf0505ccacb17077d56fc`** On the same machine, `cargo test --locked -p xcl --lib -- --test-threads=4 bounded_compute_wait async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect` passed all four tests. I repeated the same filters with four threads in 30 fresh processes: **30/30 passed, 120 test executions, no test skips**. This includes exhausting the wait budget across two slow pipelines, resetting it for the next frame in the test, and skipping ExecuteIndirect while its compute pipeline is still pending. This remains synthetic coverage; no driver compile or retail title was exercised. Codex ran and summarized the checks. **Follow-up on revised head `5e6aca8305a3d555437046ecc310988fc32ddfbb`** Same Windows/i5-8400 machine and Rust toolchain. `cargo test --locked -p xcl --lib -- --test-threads=2 --nocapture bounded_compute_wait async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect` passed all four. The log recorded `ExecuteIndirect with pending compute pipeline ... skipped` from the exercised branch. Then I reran the same four tests with two test threads in 30 fresh processes: **30/30 passed, 120 test executions, no test skips**. No retail title or real driver compile was tested. Codex ran and summarized the checks.
Author
Owner

@⁠CryingLaughing on GitHub · 2026-11-24 01:46 UTC · original · edited 2026-11-24 02:28 UTC

I ran the dependent GPU readback suggested above on RTX 4080. At f849ecc738a4791cbdf8eca9c174824562e8586e, the direct and indirect calls recorded while the producer PSO was pending both left its output at the initial value. A dependent GPU shader read that value in both cases. New calls recorded after the PSO resolved wrote and consumed the expected producer value.

Tested

  • RTX 4080, NVIDIA driver 621.01, Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC x64, DXC 1.8.2502.11, debug. XCL_ADAPTER=4080, XCL_REQUIRE_GPU=1, all XCL_SAMPLE_* variables unset.
  • The local diagnostic adds only a #[cfg(test)] fixture. It calls the PR's bind, dispatch, and indirect hooks on a real D3D12 command list. A channel holds the producer's PSO pending until the queue has completed both pending submissions. The indirect call uses a dispatch-only signature and a real argument buffer. The producer and XOR consumer use synthetic HLSL and coherent UMA, separated by a UAV barrier. Each trial starts with the same initial word.
  • With XCL_COMPUTE_PSO_WAIT_MS=10, cargo test -p xcl --lib --locked -j 4 gpu_pending_compute_dispatch_output_is_not_recovered -- --show-output passed 1/1. The run logged the timeout and the skipped direct dispatch.
First dispatch recorded Producer word Dependent consumer word
Direct, while pending 0x11223344 0x11dd33bb
Indirect, while pending 0x11223344 0x11dd33bb
Direct, after resolution 0xa5c01234 0xa53f12cb
Indirect, after resolution 0xa5c01234 0xa53f12cb
  • On the clean PR head, cargo test -p xcl --test gpu_compute_e2e --locked -j 4 console_wave64_compute_through_the_pso_hook_dispatch_and_read_back -- --show-output passed 1/1. cargo build --workspace --locked -j 4 passed, and cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output reported 679 passed, 0 failed, 41 ignored, including the two bounded-wait tests and both compute integration tests.
  • The workspace pass count includes opt-in game-data tests that returned early and four explicit SKIPPED tests: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (native wave64), plus test_title_draws_with_a_root_signature_under_the_debug_layer and uploads_start_from_each_subresources_state (D3D12 debug layer).

Not tested

  • Retail behavior, release builds, other adapters, or delays from DXC or driver work. The diagnostic controls the pending interval itself.

AI use

  • OpenAI Codex (GPT-6 family, exact variant unavailable) wrote the scratch fixture, ran the commands, and drafted this report.

Follow-up on the pending ExecuteIndirect guard

On the same Windows 11 25H2 (build 26200.9974) machine with an RTX 4080 and NVIDIA driver 621.01, I ran a test-only readback fixture on f849ecc738a4791cbdf8eca9c174824562e8586e and 5e6aca8305a3d555437046ecc310988fc32ddfbb. The native stand-in shader writes 0x5354414e to its own word. This distinguishes running the stand-in from skipping the pending dispatch even when both leave the producer's output unchanged.

Synthetic dispatch f849ecc marker 5e6aca8 marker
Native indirect, before marking the pipeline pending 0x5354414e 0x5354414e
Direct, pending 0x00000000 0x00000000
Indirect, pending 0x5354414e 0x00000000

The fixture passed 1/1 on each revision with XCL_COMPUTE_PSO_WAIT_MS=10 and cargo test -p xcl --lib --locked -j 4 gpu_pending_compute_indirect_standin_marker -- --show-output --test-threads=1. The dependent consumer read the initial producer word while pending on both revisions, and the resolved direct and indirect dispatches each wrote the expected producer and consumer words.

On the clean 5e6aca8 head, bounded_compute_wait_shares_per_frame_budget_across_pipelines passed 1/1, and cargo build --workspace --locked -j 4 passed. The workspace test run with --test-threads=4 was stopped after four recompiler GPU tests reported over 60 seconds. A fresh cargo test --workspace --locked -j 4 -- --test-threads=1 --show-output completed with 680 passed, 0 failed, 41 ignored, including the same four explicit capability skips listed above. The serial run establishes the test result. The cause of the parallel stall is unverified. OpenAI Codex prepared the synthetic follow-up fixture and ran the checks.

**@⁠CryingLaughing** on GitHub · 2026-11-24 01:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7119435515) · edited 2026-11-24 02:28 UTC I ran the dependent GPU readback suggested above on RTX 4080. At `f849ecc738a4791cbdf8eca9c174824562e8586e`, the direct and indirect calls recorded while the producer PSO was pending both left its output at the initial value. A dependent GPU shader read that value in both cases. New calls recorded after the PSO resolved wrote and consumed the expected producer value. **Tested** - RTX 4080, NVIDIA driver 621.01, Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC x64, DXC 1.8.2502.11, debug. `XCL_ADAPTER=4080`, `XCL_REQUIRE_GPU=1`, all `XCL_SAMPLE_*` variables unset. - The local diagnostic adds only a `#[cfg(test)]` fixture. It calls the PR's bind, dispatch, and indirect hooks on a real D3D12 command list. A channel holds the producer's PSO pending until the queue has completed both pending submissions. The indirect call uses a dispatch-only signature and a real argument buffer. The producer and XOR consumer use synthetic HLSL and coherent UMA, separated by a UAV barrier. Each trial starts with the same initial word. - With `XCL_COMPUTE_PSO_WAIT_MS=10`, `cargo test -p xcl --lib --locked -j 4 gpu_pending_compute_dispatch_output_is_not_recovered -- --show-output` passed 1/1. The run logged the timeout and the skipped direct dispatch. | First dispatch recorded | Producer word | Dependent consumer word | | --- | --- | --- | | Direct, while pending | `0x11223344` | `0x11dd33bb` | | Indirect, while pending | `0x11223344` | `0x11dd33bb` | | Direct, after resolution | `0xa5c01234` | `0xa53f12cb` | | Indirect, after resolution | `0xa5c01234` | `0xa53f12cb` | - On the clean PR head, `cargo test -p xcl --test gpu_compute_e2e --locked -j 4 console_wave64_compute_through_the_pso_hook_dispatch_and_read_back -- --show-output` passed 1/1. `cargo build --workspace --locked -j 4` passed, and `cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output` reported 679 passed, 0 failed, 41 ignored, including the two bounded-wait tests and both compute integration tests. - The workspace pass count includes opt-in game-data tests that returned early and four explicit `SKIPPED` tests: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (native wave64), plus `test_title_draws_with_a_root_signature_under_the_debug_layer` and `uploads_start_from_each_subresources_state` (D3D12 debug layer). **Not tested** - Retail behavior, release builds, other adapters, or delays from DXC or driver work. The diagnostic controls the pending interval itself. **AI use** - OpenAI Codex (GPT-6 family, exact variant unavailable) wrote the scratch fixture, ran the commands, and drafted this report. **Follow-up on the pending `ExecuteIndirect` guard** On the same Windows 11 25H2 (build 26200.9974) machine with an RTX 4080 and NVIDIA driver 621.01, I ran a test-only readback fixture on `f849ecc738a4791cbdf8eca9c174824562e8586e` and `5e6aca8305a3d555437046ecc310988fc32ddfbb`. The native stand-in shader writes `0x5354414e` to its own word. This distinguishes running the stand-in from skipping the pending dispatch even when both leave the producer's output unchanged. | Synthetic dispatch | `f849ecc` marker | `5e6aca8` marker | | --- | --- | --- | | Native indirect, before marking the pipeline pending | `0x5354414e` | `0x5354414e` | | Direct, pending | `0x00000000` | `0x00000000` | | Indirect, pending | `0x5354414e` | `0x00000000` | The fixture passed 1/1 on each revision with `XCL_COMPUTE_PSO_WAIT_MS=10` and `cargo test -p xcl --lib --locked -j 4 gpu_pending_compute_indirect_standin_marker -- --show-output --test-threads=1`. The dependent consumer read the initial producer word while pending on both revisions, and the resolved direct and indirect dispatches each wrote the expected producer and consumer words. On the clean `5e6aca8` head, `bounded_compute_wait_shares_per_frame_budget_across_pipelines` passed 1/1, and `cargo build --workspace --locked -j 4` passed. The workspace test run with `--test-threads=4` was stopped after four recompiler GPU tests reported over 60 seconds. A fresh `cargo test --workspace --locked -j 4 -- --test-threads=1 --show-output` completed with 680 passed, 0 failed, 41 ignored, including the same four explicit capability skips listed above. The serial run establishes the test result. The cause of the parallel stall is unverified. OpenAI Codex prepared the synthetic follow-up fixture and ran the checks.
Author
Owner

@⁠qinrxx on GitHub · 2026-11-24 02:36 UTC · original

@⁠XaviFortes thanks, agreed. Once #533 is merged, we'll send the ordering as a small PR on top of it: inside the xcl-pso-compute pool, a build that a bind is waiting for is taken before builds started early. It will come with its own test (a waited-for build finishing before speculative builds queued ahead of it) and its own main / head regression pair. Our earlier branch won't be opened.

AI use: Claude Code (Claude Opus 5.5) drafted this reply.

**@⁠qinrxx** on GitHub · 2026-11-24 02:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7120318589) @⁠XaviFortes thanks, agreed. Once #533 is merged, we'll send the ordering as a small PR on top of it: inside the `xcl-pso-compute` pool, a build that a bind is waiting for is taken before builds started early. It will come with its own test (a waited-for build finishing before speculative builds queued ahead of it) and its own `main` / head regression pair. Our earlier branch won't be opened. AI use: Claude Code (Claude Opus 5.5) drafted this reply.
Author
Owner

@⁠H0UNDZER0 on GitHub · 2026-11-24 02:40 UTC · original

Tested on an RTX 5080: pass at the current head 5e6aca8, release and debug, 680 passed, 0 failed. The RTX 4080 and RTX 3080 results above are of the earlier head f849ecc; this one covers the current head. f849ecc also passed here before the update (679 / 0 / 41, release twice and debug).

  • Commit 5e6aca8305a3d555437046ecc310988fc32ddfbb, this PR's head as is (on its base 7ebf1b8).
  • NVIDIA GeForce RTX 5080 16 GB, driver 621.24 (32.0.16.2124), 32-lane waves; Ryzen 7 9700X (8 cores, 16 threads); Windows 11 Pro 24H2 (26100.9711); Rust 1.100.0 MSVC; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); D3D12 debug layer installed. No XCL_* variables set.
  • cargo build --release --workspace --locked and cargo build --workspace --locked: OK, the same single fetch_update warning as main.
  • cargo test --workspace --release --no-fail-fast --locked -- --test-threads=4, run twice (the second with --show-output), and the same in debug: 680 passed, 0 failed, 41 ignored all three times. The base 7ebf1b8 gives 677 / 0 / 41 here (release): the difference is the 3 bounded_compute_wait_* tests.
  • SKIPPED: only the usual 2, gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64). The two debug-layer tests run and pass.
  • hle::d3d12x::pso_async::tests alone, 3 runs (release): 3 passed each time. async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect passes, with its new pending-ExecuteIndirect step.
  • The new limit: every still building after … ms – proceeding with stand-in and ExecuteIndirect with pending compute pipeline … skipped line in these runs comes from the tests' own synthetic pipelines. No pipeline the suite builds for real on this GPU reached the 4 s budget, in release or in debug.

Not tested

  • A real compile slower than the budget, and retail titles (the RTX 3080 run above covers one, on f849ecc); scripts/smoke.ps1.
  • This PR merged onto a newer main. At the time of the run that was 9ce2070; git merge-tree showed no conflict.

AI use: Claude Code (Claude Opus 5.5, Claude Fable 5.2)

**@⁠H0UNDZER0** on GitHub · 2026-11-24 02:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7120372168) **Tested** on an RTX 5080: **pass** at the current head `5e6aca8`, release and debug, 680 passed, 0 failed. The RTX 4080 and RTX 3080 results above are of the earlier head `f849ecc`; this one covers the current head. `f849ecc` also passed here before the update (679 / 0 / 41, release twice and debug). - Commit `5e6aca8305a3d555437046ecc310988fc32ddfbb`, this PR's head as is (on its base `7ebf1b8`). - NVIDIA GeForce RTX 5080 16 GB, driver 621.24 (32.0.16.2124), 32-lane waves; Ryzen 7 9700X (8 cores, 16 threads); Windows 11 Pro 24H2 (26100.9711); Rust 1.100.0 MSVC; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); D3D12 debug layer installed. No `XCL_*` variables set. - `cargo build --release --workspace --locked` and `cargo build --workspace --locked`: OK, the same single `fetch_update` warning as `main`. - `cargo test --workspace --release --no-fail-fast --locked -- --test-threads=4`, run twice (the second with `--show-output`), and the same in debug: **680 passed, 0 failed, 41 ignored** all three times. The base `7ebf1b8` gives 677 / 0 / 41 here (release): the difference is the 3 `bounded_compute_wait_*` tests. - `SKIPPED`: only the usual 2, `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64). The two debug-layer tests run and pass. - `hle::d3d12x::pso_async::tests` alone, 3 runs (release): 3 passed each time. `async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect` passes, with its new pending-`ExecuteIndirect` step. - The new limit: every `still building after … ms – proceeding with stand-in` and `ExecuteIndirect with pending compute pipeline … skipped` line in these runs comes from the tests' own synthetic pipelines. No pipeline the suite builds for real on this GPU reached the 4 s budget, in release or in debug. **Not tested** - A real compile slower than the budget, and retail titles (the RTX 3080 run above covers one, on `f849ecc`); `scripts/smoke.ps1`. - This PR merged onto a newer `main`. At the time of the run that was `9ce2070`; `git merge-tree` showed no conflict. **AI use:** Claude Code (Claude Opus 5.5, Claude Fable 5.2)
Author
Owner

@⁠XaviFortes on GitHub · 2026-11-24 02:53 UTC · original

Had to make new commit to solve conflicts done by merging other PRs probably. Solved now

**@⁠XaviFortes** on GitHub · 2026-11-24 02:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7120570039) Had to make new commit to solve conflicts done by merging other PRs probably. Solved now
Author
Owner

@⁠MonkeyPython on GitHub · 2026-11-24 02:55 UTC · original

NVIDIA / wave32 data point (the "Not tested" axis): the bounded compute-pipeline waits work on an RTX 3080 Ti — the fallback path exercised 16 times in a loading-phase soak, with no watchdog trip or device removal.

Setup: Windows 11 Pro 26300, Ryzen 7 7800X3D, 32 GB, RTX 3080 Ti 12 GB (driver 621.01, wave32-only), PR head f849ecc, release build, XCL_NETWORK=0 + firewall, GTA VI Series 1.0.2.1, 3840×2160. Scripted menu walk (XCL_PRESS_AT) into loading.

Suite at this head: 679 passed / 0 failed / 41 ignored, 2 internal SKIPPED (the wave64 pair on this wave32 adapter) — includes the pso_async bounded-wait unit tests.

Soak (266 s, into the cold-compile wave): the new path fired 16 times: D3D12.X: compute pipeline 0x… still building after 4000 ms – proceeding with stand-in (continues in background). Each time the draw continued with the stand-in and compilation kept going in the background; no device removal, no watchdog-style hang attributable to the waits. fps over the last 300: 15.6 @⁠1200 presents, 16.6 @⁠1500. BCPack refusals reached 2048 and 40 mesh AS-slot refusals as loading progressed (the usual shapes for this title).

Limit, honestly: the run ended at 266 s in the pre-existing #232 null write (game_scarlett_master.exe+0x23cf683, same signature as on plain main) — so a soak past the 578 s point was not reachable on this title/host: #232 kills it at ~266–298 s regardless of this PR. The bounded-wait behavior above was observed during the cold-compile wave before that crash; the PR neither causes nor prevents the null write.

Not tested: Intel GPUs, gameplay past the #232 crash, other titles.

AI use: Gentle Shell (Pi coding agent), model qwen4-max: ran the suite and the soak with scripted input and wrote this report from the logs; a human reviews it before posting. No code changes.

**@⁠MonkeyPython** on GitHub · 2026-11-24 02:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7120600815) NVIDIA / wave32 data point (the "Not tested" axis): the bounded compute-pipeline waits work on an RTX 3080 Ti — the fallback path exercised 16 times in a loading-phase soak, with no watchdog trip or device removal. **Setup:** Windows 11 Pro 26300, Ryzen 7 7800X3D, 32 GB, RTX 3080 Ti 12 GB (driver 621.01, wave32-only), PR head `f849ecc`, release build, `XCL_NETWORK=0` + firewall, GTA VI Series 1.0.2.1, 3840×2160. Scripted menu walk (`XCL_PRESS_AT`) into loading. **Suite at this head:** 679 passed / 0 failed / 41 ignored, 2 internal `SKIPPED` (the wave64 pair on this wave32 adapter) — includes the `pso_async` bounded-wait unit tests. **Soak (266 s, into the cold-compile wave):** the new path fired **16 times**: `D3D12.X: compute pipeline 0x… still building after 4000 ms – proceeding with stand-in (continues in background)`. Each time the draw continued with the stand-in and compilation kept going in the background; **no device removal, no watchdog-style hang** attributable to the waits. fps over the last 300: 15.6 @⁠1200 presents, 16.6 @⁠1500. BCPack refusals reached 2048 and 40 mesh AS-slot refusals as loading progressed (the usual shapes for this title). **Limit, honestly:** the run ended at 266 s in the pre-existing #232 null write (`game_scarlett_master.exe+0x23cf683`, same signature as on plain main) — so a soak **past the 578 s point was not reachable on this title/host**: #232 kills it at ~266–298 s regardless of this PR. The bounded-wait behavior above was observed during the cold-compile wave before that crash; the PR neither causes nor prevents the null write. **Not tested:** Intel GPUs, gameplay past the #232 crash, other titles. **AI use:** Gentle Shell (Pi coding agent), model qwen4-max: ran the suite and the soak with scripted input and wrote this report from the logs; a human reviews it before posting. No code changes.
Author
Owner

@⁠Jevix on GitHub · 2026-11-24 02:56 UTC · original

I've implemented an additional regression test for the dedicated compute worker pool.

The test saturates both graphics workers and verifies that a lazy compute PSO completes through the actual runtime routing path on a dedicated compute worker.

Validation on RTX 4060, i7-7700, Windows 11, Rust 1.100.0:

  • Final regression test: 5/5 passed.
  • Routing mutation: correctly failed when compute jobs were redirected to the graphics queue.
  • Child-process validation: correctly rejected a successful exit with zero tests executed.
  • Full workspace: 678 passed, 3 pre-existing VRAM-related failures, 41 ignored, 2 GPU SKIPPED.
  • The same three failures were reproduced on the unmodified base.

Tested on commit 5e6aca8. The patch adds 140 lines of test-only code.

Would you prefer to incorporate this test into #533 or have me open a stacked PR?

AI assistance: OpenAI Codex (GPT-5) and ChatGPT (GPT-6.2).

**@⁠Jevix** on GitHub · 2026-11-24 02:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7120626205) I've implemented an additional regression test for the dedicated compute worker pool. The test saturates both graphics workers and verifies that a lazy compute PSO completes through the actual runtime routing path on a dedicated compute worker. Validation on RTX 4060, i7-7700, Windows 11, Rust 1.100.0: - Final regression test: 5/5 passed. - Routing mutation: correctly failed when compute jobs were redirected to the graphics queue. - Child-process validation: correctly rejected a successful exit with zero tests executed. - Full workspace: 678 passed, 3 pre-existing VRAM-related failures, 41 ignored, 2 GPU SKIPPED. - The same three failures were reproduced on the unmodified base. Tested on commit `5e6aca8`. The patch adds 140 lines of test-only code. Would you prefer to incorporate this test into #533 or have me open a stacked PR? AI assistance: OpenAI Codex (GPT-5) and ChatGPT (GPT-6.2).
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-24 01:33 UTC · original · edited 2026-11-24 03:02 UTC

Tested after the rebase

GitHub's integration revision 09a58f3 combines PR head a966993 with main at dd2ae9a. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, DXC 1.8.2502.11, Rust 1.99.1 MSVC, debug.

  • cargo build --offline --locked --workspace passed. cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 reported 693 passed, 0 failed, 41 ignored. Two of the reported passes returned early for lack of native wave64 (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware).
  • The stock mock dispatch test passed 1/1, including the pending indirect-dispatch skip. With the D3D12 debug layer enabled, cargo test --offline --locked -p xcl --test gpu_compute_e2e -- --nocapture --test-threads=1 passed 2/2 on the selected GPU with no runtime skips or debug-layer errors.

Not tested

GPU output from a dispatch recorded during a forced timeout, and the retail watchdog.

AI use

Codex with GPT-6.2 Sol ran the tests and drafted the update.

Results on earlier revisions

The two bounded-wait tests passed on Windows 11 build 26300, Rust 1.99.1 MSVC, debug, at f849ecc. cargo test --offline --locked -p xcl --lib bounded_compute_wait -- --nocapture reported 2 passed, 0 failed, 0 ignored.

The tests verify that the real pipeline becomes available after a timeout. There’s also a command-recording case worth checking. While resolution still returns the stand-in, direct Dispatch is counted as skipped. ExecuteIndirect takes the native forwarding branch, and the compute stand-in uses dummy bytecode. Later binds get the real pipeline, but that leaves earlier compute outputs unverified. Direct dispatch · Indirect dispatch · Stand-in

Could a synthetic GPU test read back a value written by a dispatch recorded during the timeout, then consumed by a dependent command? My verification covers the source and unit tests. The GPU dispatch path and retail behavior remain untested here.

I also extended the existing fake command-list test locally at this commit. A channel held the compute build pending across a 25 ms timeout. The recording calls added zero native direct dispatches, one skipped direct dispatch, and one native indirect call. Releasing the build gate made the real pipeline available, with the native direct-dispatch count still unchanged. The extended test passed (1 passed, 0 failed, 0 ignored) with XCL_COMPUTE_PSO_WAIT_MS=25 cargo test --offline --locked -p xcl --lib async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect -- --nocapture (environment variable set in PowerShell). This checks command recording with a fake list. GPU readback remains open.

AI use

Codex with GPT-6.2 Sol extended the scratch fixture, ran the unit tests, traced the dispatch paths, and drafted this report.

Follow-up on 359851f

The updated fake command-list test passed on Windows. It observed the new skip for an indirect dispatch whose compute pipeline was still pending. The three built-in wait tests also passed. Tested revision

In a scratch test, two caller threads entered the resolver together while a channel held the same compute build pending. With a 200 ms budget, the counter recorded 400 ms of combined waits. Both callers can read the full remaining balance before either charges its wait. If the budget is meant to cap combined wait time across render threads, could callers reserve their allowance before waiting, then return any unused portion? If it is meant to cap wall-clock stall, the combined counter can include overlapping time.

Windows 11 build 26300, Rust 1.99.1 MSVC, debug. cargo test --offline --locked -p xcl --lib bounded_compute_wait -- --test-threads=1 --nocapture reported 4 passed including the scratch probe. The same command with the filter async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect reported 1 passed. Both runs had zero failures or ignored tests. This CPU-side check leaves GPU output and retail behavior open.

Codex with GPT-6.2 Sol wrote the scratch probe, ran the tests, and drafted this update.

GPU follow-up on 359851f

The stock gpu_compute_e2e integration tests passed 2/2 on the RTX 3080 Ti (621.35), Windows 11 build 26300, Rust 1.99.1 MSVC, debug. I used XCL_ADAPTER=3080 Ti, XCL_REQUIRE_GPU=1, and a fresh DXIL cache. Tested revision

In a scratch copy I changed the readback fixture to require a pending compute stand-in and call the new resolve_compute path with the 4,000 ms budget. It returned the translated PSO from the cold build. The fixture dispatched it on the hardware and matched both expected output words at each of 768 positions (1,536 words total). The scratch run passed 1/1 with no reported skips. Both runs used cargo test --offline --locked -p xcl --test gpu_compute_e2e -- --test-threads=1 --nocapture, with the scratch run filtered to the readback test.

This verifies the GPU result when compilation finishes within budget. Output from a command recorded during a forced timeout and retail watchdog behavior remain untested. Codex with GPT-6.2 Sol ran the tests and drafted this update.

Follow-up to the 5e6aca8 update

I checked the two-worker floor with XCL_DXC_THREADS=2. In a scratch Windows test, the first compute job held one worker at a channel gate while a second job ran on a compute worker. The second job ran before releasing the first, so the two jobs did not serialize behind that gate. The probe passed 1/1. Author update · Tested revision

The stock gpu_compute_e2e tests also passed 2/2 on RTX 3080 Ti (621.35) with the D3D12 debug layer enabled and no reported skips. XCL logged live-object warnings at process exit. Windows 11 build 26300, Rust 1.99.1 MSVC, debug, serial tests. This exercises the worker scheduling and synthetic compute readback. Retail watchdog behavior remains untested here.

Codex with GPT-6.2 Sol wrote the scratch probe, ran the tests, and drafted this update.

**@⁠thehollowedone** on GitHub · 2026-11-24 01:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7119214708) · edited 2026-11-24 03:02 UTC **Tested after the rebase** GitHub's [integration revision `09a58f3`](https://github.com/ivall/xcl/commit/09a58f33c4f4649e1ff10426c132f304d31597e6) combines [PR head `a966993`](https://github.com/ivall/xcl/commit/a9669938d8d1b24f943053efa7f97b70c57486bb) with [`main` at `dd2ae9a`](https://github.com/ivall/xcl/commit/dd2ae9a70af5eb5aad60f02d86e386b72abe1e95). Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, DXC 1.8.2502.11, Rust 1.99.1 MSVC, debug. - `cargo build --offline --locked --workspace` passed. `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4` reported **693 passed, 0 failed, 41 ignored**. Two of the reported passes returned early for lack of native wave64 (`gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`). - The stock mock dispatch test passed 1/1, including the pending indirect-dispatch skip. With the D3D12 debug layer enabled, `cargo test --offline --locked -p xcl --test gpu_compute_e2e -- --nocapture --test-threads=1` passed 2/2 on the selected GPU with no runtime skips or debug-layer errors. **Not tested** GPU output from a dispatch recorded during a forced timeout, and the retail watchdog. **AI use** Codex with GPT-6.2 Sol ran the tests and drafted the update. <details> <summary>Results on earlier revisions</summary> The two bounded-wait tests passed on Windows 11 build 26300, Rust 1.99.1 MSVC, debug, at [f849ecc](https://github.com/ivall/xcl/commit/f849ecc738a4791cbdf8eca9c174824562e8586e). `cargo test --offline --locked -p xcl --lib bounded_compute_wait -- --nocapture` reported 2 passed, 0 failed, 0 ignored. The tests verify that the real pipeline becomes available after a timeout. There’s also a command-recording case worth checking. While resolution still returns the stand-in, direct `Dispatch` is counted as skipped. `ExecuteIndirect` takes the native forwarding branch, and the compute stand-in uses dummy bytecode. Later binds get the real pipeline, but that leaves earlier compute outputs unverified. [Direct dispatch](https://github.com/ivall/xcl/blob/f849ecc738a4791cbdf8eca9c174824562e8586e/crates/xcl/src/hle/d3d12x/bind.rs#L674-L695) · [Indirect dispatch](https://github.com/ivall/xcl/blob/f849ecc738a4791cbdf8eca9c174824562e8586e/crates/xcl/src/hle/d3d12x/bind.rs#L210-L236) · [Stand-in](https://github.com/ivall/xcl/blob/f849ecc738a4791cbdf8eca9c174824562e8586e/crates/xcl/src/hle/d3d12x/real.rs#L3663-L3668) Could a synthetic GPU test read back a value written by a dispatch recorded during the timeout, then consumed by a dependent command? My verification covers the source and unit tests. The GPU dispatch path and retail behavior remain untested here. I also extended the existing fake command-list test locally at this commit. A channel held the compute build pending across a 25 ms timeout. The recording calls added zero native direct dispatches, one skipped direct dispatch, and one native indirect call. Releasing the build gate made the real pipeline available, with the native direct-dispatch count still unchanged. The extended test passed (1 passed, 0 failed, 0 ignored) with `XCL_COMPUTE_PSO_WAIT_MS=25 cargo test --offline --locked -p xcl --lib async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect -- --nocapture` (environment variable set in PowerShell). This checks command recording with a fake list. GPU readback remains open. **AI use** Codex with GPT-6.2 Sol extended the scratch fixture, ran the unit tests, traced the dispatch paths, and drafted this report. **Follow-up on 359851f** The updated fake command-list test passed on Windows. It observed the new skip for an indirect dispatch whose compute pipeline was still pending. The three built-in wait tests also passed. [Tested revision](https://github.com/ivall/xcl/commit/359851f9ee117e8241dbf0505ccacb17077d56fc) In a scratch test, two caller threads entered the resolver together while a channel held the same compute build pending. With a 200 ms budget, the counter recorded 400 ms of combined waits. Both callers can read the full remaining balance before either charges its wait. If the budget is meant to cap combined wait time across render threads, could callers reserve their allowance before waiting, then return any unused portion? If it is meant to cap wall-clock stall, the combined counter can include overlapping time. Windows 11 build 26300, Rust 1.99.1 MSVC, debug. `cargo test --offline --locked -p xcl --lib bounded_compute_wait -- --test-threads=1 --nocapture` reported 4 passed including the scratch probe. The same command with the filter `async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect` reported 1 passed. Both runs had zero failures or ignored tests. This CPU-side check leaves GPU output and retail behavior open. Codex with GPT-6.2 Sol wrote the scratch probe, ran the tests, and drafted this update. **GPU follow-up on 359851f** The stock `gpu_compute_e2e` integration tests passed 2/2 on the RTX 3080 Ti (621.35), Windows 11 build 26300, Rust 1.99.1 MSVC, debug. I used `XCL_ADAPTER=3080 Ti`, `XCL_REQUIRE_GPU=1`, and a fresh DXIL cache. [Tested revision](https://github.com/ivall/xcl/commit/359851f9ee117e8241dbf0505ccacb17077d56fc) In a scratch copy I changed the readback fixture to require a pending compute stand-in and call the new `resolve_compute` path with the 4,000 ms budget. It returned the translated PSO from the cold build. The fixture dispatched it on the hardware and matched both expected output words at each of 768 positions (1,536 words total). The scratch run passed 1/1 with no reported skips. Both runs used `cargo test --offline --locked -p xcl --test gpu_compute_e2e -- --test-threads=1 --nocapture`, with the scratch run filtered to the readback test. This verifies the GPU result when compilation finishes within budget. Output from a command recorded during a forced timeout and retail watchdog behavior remain untested. Codex with GPT-6.2 Sol ran the tests and drafted this update. **Follow-up to the 5e6aca8 update** I checked the two-worker floor with `XCL_DXC_THREADS=2`. In a scratch Windows test, the first compute job held one worker at a channel gate while a second job ran on a compute worker. The second job ran before releasing the first, so the two jobs did not serialize behind that gate. The probe passed 1/1. [Author update](https://github.com/ivall/xcl/pull/533#issuecomment-7120140327) · [Tested revision](https://github.com/ivall/xcl/commit/5e6aca8305a3d555437046ecc310988fc32ddfbb) The stock `gpu_compute_e2e` tests also passed 2/2 on RTX 3080 Ti (621.35) with the D3D12 debug layer enabled and no reported skips. XCL logged live-object warnings at process exit. Windows 11 build 26300, Rust 1.99.1 MSVC, debug, serial tests. This exercises the worker scheduling and synthetic compute readback. Retail watchdog behavior remains untested here. Codex with GPT-6.2 Sol wrote the scratch probe, ran the tests, and drafted this update. </details>
Author
Owner

@⁠XaviFortes on GitHub · 2026-11-24 03:02 UTC · original

Thanks @⁠Jevix for writing and validating that saturation test!

Since #533 is already at ~351 insertions (close to the ~400-line guideline) and CI is green on the rebased head (a966993), a stacked / follow-up PR on top of #533 is cleaner — especially now that #507 landed for test-only PRs, and that way you get proper commit credit for the test too.

**@⁠XaviFortes** on GitHub · 2026-11-24 03:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7120714908) Thanks @⁠Jevix for writing and validating that saturation test! Since #533 is already at ~351 insertions (close to the ~400-line guideline) and CI is green on the rebased head (a966993), a stacked / follow-up PR on top of #533 is cleaner — especially now that #507 landed for test-only PRs, and that way you get proper commit credit for the test too.
Author
Owner

@⁠Jevix on GitHub · 2026-11-24 03:20 UTC · original

Gracias@Jevix¡Gracias por escribir y validar esa prueba de saturación!

Dado que #533 ya tiene ~351 inserciones (cerca de la directriz de ~400 líneas) y CI está en verde en el encabezado rebasado ( a966993 ), una PR apilada/de seguimiento sobre #533 es más limpia, especialmente ahora que #507 se implementó para PR solo de prueba, y de esa manera también obtienes el crédito de confirmación adecuado para la prueba.

¡Muchas gracias, Xavi! Veo que eres de España, así que aprovecho para saludarte desde Argentina.

Agradezco mucho que hayas tenido en cuenta el reconocimiento de mi aporte. Esperaré a que se fusione el #533 para preparar mi PR independiente y volver a validar las pruebas sobre main.

¡Un placer poder contribuir al proyecto!

**@⁠Jevix** on GitHub · 2026-11-24 03:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7121002298) > Gracias@Jevix¡Gracias por escribir y validar esa prueba de saturación! > > Dado que #533 ya tiene ~351 inserciones (cerca de la directriz de ~400 líneas) y CI está en verde en el encabezado rebasado ( [a966993](https://github.com/ivall/xcl/commit/a9669938d8d1b24f943053efa7f97b70c57486bb) ), una PR apilada/de seguimiento sobre #533 es más limpia, especialmente ahora que #507 se implementó para PR solo de prueba, y de esa manera también obtienes el crédito de confirmación adecuado para la prueba. ¡Muchas gracias, Xavi! Veo que eres de España, así que aprovecho para saludarte desde Argentina. Agradezco mucho que hayas tenido en cuenta el reconocimiento de mi aporte. Esperaré a que se fusione el #533 para preparar mi PR independiente y volver a validar las pruebas sobre main. ¡Un placer poder contribuir al proyecto!
Author
Owner

@⁠xstraok on GitHub · 2026-11-24 03:20 UTC · original · edited 2026-11-24 03:24 UTC

Linux / RADV (RDNA4) run with the retail title (1.0.2.1). With this PR the title gets ~10–20 s further before the heartbeat abort. In one run (j) the skips were followed by a GPU page fault and a ring reset. Edited after a rerun (k2): the Wait64BitValueX timeouts are not caused by this PR's skips. They also appear with no skip at all.

Setup: RX 9060 XT (RDNA4, RADV, Mesa 26.2.6), Ryzen 5 7600, 32 GB, Arch Linux (kernel 7.2.15), Proton Experimental, vkd3d-proton 3.1 with dxil-spirv updated to upstream 53aac418 (the older one hangs on two of this title's compute programs, #611). XCL release build, x86_64-pc-windows-gnu. Local tree: main a6f5f7a + #257 (Linux kit) + #458 + #496 + #484 + #610 + #172 + this PR at a966993 (bind.rs conflict in execute_indirect resolved to this PR's side). Run j also has #267. Uncommitted, so no smoke block. XCL_COHERENT_MB=512, saved profile, one A press, warm DXIL cache.

Without this PR (run h2, same setup minus #172 / this PR / #267): presents stop at 150 s. Three title threads wait in pso::compile_console_shader → dxc::compile on three long DXC compiles, the other DXC workers are idle, and the title aborts at 180 s (+0x23cf683, the heartbeat abort from #505).

With this PR:

run build first skip Wait64BitValueX timeouts GPU end
i + this PR 161.9 s, 4 × ExecuteIndirect with a pipeline that is still being built skipped 3, from 164.2 s no reset logged title abort 190 s
j + this PR + #267 168.4 s, 4 × the same warning 5, from 171.8 s ring gfx_0.0.0 timeout ~178 s, ring reset title abort 197 s
k as j, XCL_COMPUTE_PSO_WAIT_MS=0 none none clean stopped by my RAM guard at ~180 s (title RSS 20 GB)
k2 as k, no RAM guard none (0 draws, 0 dispatches skipped) 3, from 167.7 s clean title abort 195 s

The timeouts all read like Wait64BitValueX timed out after 2000 ms at 0x1e55f9b8 (op 7, want 0x9c3, mask 0xffffffffffffffff; memory holds Some(0)), and the counter is never written. This is the pattern @⁠tadymila reported in #505. Run k2 shows them without any skip, so they come with reaching that point of loading (~162 s here), not with this PR. Run h2 never got that far.

Run j's devcoredump (/sys/class/drm/card1/device/devcoredump/data, decoded with gc_12_0_0_sh_mask.h / gfxhub_v12_0.c): [gfxhub] Page fault observed, address 0x0000800004622000, GCVM_L2_PROTECTION_FAULT_STATUS 0x00501431. Fields: MORE_FAULTS 1, PERMISSION_FAULTS 0x3, MAPPING_ERROR 0, CID 10 = SQC (data), RW 0 (read), VMID 5. So a shader's scalar load (descriptor / root constant / constant buffer) read an unmapped page, and the gfx front end stalled (CP_CPF_STALLED_STAT1 0x3) until the ring reset.

What is left that may be this PR's: the page fault and ring reset happened only in run j (256 dispatches skipped by 168.7 s). It did not happen in run i, which had more skips (4096 by 162.2 s), or in k / k2 without skips. So the link to the skips is weak: one sample. Possibly a skipped dispatch or ExecuteIndirect leaves state that a later shader reads through, but this is not proven. I have not identified which buffer 0x800004622000 belongs to (no RADV_DEBUG=bo_history in that run). None of the runs gets past the heartbeat abort, with or without this PR.

Not tested: Windows, any other GPU, cargo test and smoke.ps1 on this tree, this PR alone on main. One run each, so the timings are single samples.

Tested and written with Claude Code (Claude Opus 5.5); runs and measurements from this machine.

**@⁠xstraok** on GitHub · 2026-11-24 03:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7121004655) · edited 2026-11-24 03:24 UTC Linux / RADV (RDNA4) run with the retail title (1.0.2.1). With this PR the title gets ~10–20 s further before the heartbeat abort. In one run (j) the skips were followed by a GPU page fault and a ring reset. *Edited after a rerun (k2):* the `Wait64BitValueX` timeouts are **not** caused by this PR's skips. They also appear with no skip at all. **Setup:** RX 9060 XT (RDNA4, RADV, Mesa 26.2.6), Ryzen 5 7600, 32 GB, Arch Linux (kernel 7.2.15), Proton Experimental, vkd3d-proton 3.1 with dxil-spirv updated to upstream `53aac418` (the older one hangs on two of this title's compute programs, #611). XCL release build, `x86_64-pc-windows-gnu`. Local tree: `main` `a6f5f7a` + #257 (Linux kit) + #458 + #496 + #484 + #610 + #172 + this PR at `a966993` (`bind.rs` conflict in `execute_indirect` resolved to this PR's side). Run j also has #267. Uncommitted, so no smoke block. `XCL_COHERENT_MB=512`, saved profile, one A press, warm DXIL cache. **Without this PR (run h2, same setup minus #172 / this PR / #267):** presents stop at 150 s. Three title threads wait in `pso::compile_console_shader → dxc::compile` on three long DXC compiles, the other DXC workers are idle, and the title aborts at 180 s (`+0x23cf683`, the heartbeat abort from #505). **With this PR:** | run | build | first skip | `Wait64BitValueX` timeouts | GPU | end | |---|---|---|---|---|---| | i | + this PR | 161.9 s, 4 × `ExecuteIndirect with a pipeline that is still being built skipped` | 3, from 164.2 s | no reset logged | title abort 190 s | | j | + this PR + #267 | 168.4 s, 4 × the same warning | 5, from 171.8 s | `ring gfx_0.0.0 timeout` ~178 s, ring reset | title abort 197 s | | k | as j, `XCL_COMPUTE_PSO_WAIT_MS=0` | none | none | clean | stopped by my RAM guard at ~180 s (title RSS 20 GB) | | k2 | as k, no RAM guard | none (0 draws, 0 dispatches skipped) | 3, from 167.7 s | clean | title abort 195 s | The timeouts all read like `Wait64BitValueX timed out after 2000 ms at 0x1e55f9b8 (op 7, want 0x9c3, mask 0xffffffffffffffff; memory holds Some(0))`, and the counter is never written. This is the pattern @⁠tadymila reported in #505. Run k2 shows them without any skip, so they come with reaching that point of loading (~162 s here), not with this PR. Run h2 never got that far. **Run j's devcoredump** (`/sys/class/drm/card1/device/devcoredump/data`, decoded with `gc_12_0_0_sh_mask.h` / `gfxhub_v12_0.c`): `[gfxhub] Page fault observed`, address `0x0000800004622000`, `GCVM_L2_PROTECTION_FAULT_STATUS 0x00501431`. Fields: MORE_FAULTS 1, PERMISSION_FAULTS 0x3, MAPPING_ERROR 0, **CID 10 = SQC (data)**, RW 0 (read), VMID 5. So a shader's scalar load (descriptor / root constant / constant buffer) read an unmapped page, and the gfx front end stalled (`CP_CPF_STALLED_STAT1 0x3`) until the ring reset. What is left that may be this PR's: the page fault and ring reset happened only in run j (256 dispatches skipped by 168.7 s). It did not happen in run i, which had more skips (4096 by 162.2 s), or in k / k2 without skips. So the link to the skips is weak: one sample. Possibly a skipped dispatch or ExecuteIndirect leaves state that a later shader reads through, but this is not proven. I have not identified which buffer `0x800004622000` belongs to (no `RADV_DEBUG=bo_history` in that run). None of the runs gets past the heartbeat abort, with or without this PR. **Not tested:** Windows, any other GPU, `cargo test` and `smoke.ps1` on this tree, this PR alone on `main`. One run each, so the timings are single samples. Tested and written with Claude Code (Claude Opus 5.5); runs and measurements from this machine.
Author
Owner

@⁠WarmMilkCodes on GitHub · 2026-11-24 04:05 UTC · original

<html> <html><head></head>

RDNA2 results (RX 6600 XT 8 GB, Ryzen 5 5500, 32 GB RAM, DXC 1.8.2502.11), retail title from #505

#533 helps on AMD too, but on its own it didn't get past the "GPU Loc Sig" watchdog here. Two more waits had to be bounded: draws, and the timeouts that pile up back to back. With both, the title got past the world loading screen into gameplay (audio of gameplay playing, black screen) for the first time on this machine.

What the crash dumps showed at each step

Build Ends at State at the crash
main 7ebf1b8 watchdog, 548 s 5 title threads inside amdxc64.dll building compute PSOs; all xcl-pso-* idle
main dd2ae9a, unmodified watchdog, 424 s 4 threads inside amdxc64.dll
  • #533 | watchdog, 481 s | compute builds now on xcl-pso-* (7 in amdxc64.dll); 5 title threads in the bounded wait under SetPipelineState; the 4000 ms timeout logged back to back (log capped at 16); background_pipelines [104, 0, 58656]
  • #533, XCL_COMPUTE_PSO_WAIT_MS=1 | watchdog, 498 s | a title thread in DrawIndexedInstanced → graphics_bound → resolve_wait (no limit)

So with the waits bounded, the watchdog is gone, and what's left is the cost @⁠thehollowedone pointed at: work skipped while its pipeline builds. It looks like it ends in a device removal a few seconds later. I'm finishing the full precompile now to see how far that goes when nothing has to be skipped.

One path still looks unbounded: with the DXIL already in the cache, a compute PSO seems to be built in the create call, on the title's thread (the build log lines come from unnamed title threads). On a run with a half-filled cache, the watchdog came back at 297 s, with a title thread in the driver's compiler; the slowest builds took 3.8 s and 6.1 s. It's another candidate for the background workers.

</html> </html>
**@⁠WarmMilkCodes** on GitHub · 2026-11-24 04:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7121695158) <html> <body> <!--StartFragment--><html><head></head><body><p><strong>RDNA2 results (RX 6600 XT 8 GB, Ryzen 5 5500, 32 GB RAM, DXC 1.8.2502.11), retail title from #505</strong></p> <p>#533 helps on AMD too, but on its own it didn't get past the "GPU Loc Sig" watchdog here. Two more waits had to be bounded: draws, and the timeouts that pile up back to back. With both, the title got past the world loading screen into gameplay (audio of gameplay playing, black screen) for the first time on this machine.</p> <p><strong>What the crash dumps showed at each step</strong></p> Build | Ends at | State at the crash -- | -- | -- main 7ebf1b8 | watchdog, 548 s | 5 title threads inside amdxc64.dll building compute PSOs; all xcl-pso-* idle main dd2ae9a, unmodified | watchdog, 424 s | 4 threads inside amdxc64.dll + #533 | watchdog, 481 s | compute builds now on xcl-pso-* (7 in amdxc64.dll); 5 title threads in the bounded wait under SetPipelineState; the 4000 ms timeout logged back to back (log capped at 16); background_pipelines [104, 0, 58656] + #533, XCL_COMPUTE_PSO_WAIT_MS=1 | watchdog, 498 s | a title thread in DrawIndexedInstanced → graphics_bound → resolve_wait (no limit) <p>So with the waits bounded, the watchdog is gone, and what's left is the cost @⁠thehollowedone pointed at: work skipped while its pipeline builds. It looks like it ends in a device removal a few seconds later. I'm finishing the full precompile now to see how far that goes when nothing has to be skipped.</p> <p><strong>One path still looks unbounded:</strong> with the DXIL already in the cache, a compute PSO seems to be built in the create call, on the title's thread (the build log lines come from unnamed title threads). On a run with a half-filled cache, the watchdog came back at 297 s, with a title thread in the driver's compiler; the slowest builds took 3.8 s and 6.1 s. It's another candidate for the background workers.</p> </body></html><!--EndFragment--> </body> </html>
Author
Owner

@⁠itsd-effex on GitHub · 2026-11-24 04:10 UTC · original

Linux (Wine + vkd3d-proton) test of this PR's head. On this stack it takes the slow compute conversions off the title threads; the title then stops on the two waits #662 describes.

Tested

  • RTX 3080 Ti 12 GB (NVIDIA 620.73.04), i7-11700KF, 32 GB RAM + 36 GB swap, Linux. Wine from Proton Experimental and patched vkd3d-proton 3.1 (the #257 kit). Release build, cross-compiled with cargo-xwin.
  • Build: main 91f9a5e + #684 (e56dbc3) + #273 (BC1) + this PR (a966993). All three merged without conflicts (0d1c76b). Our test title under Wine: 48 PASS / 2 FAIL, the same as main.
  • Retail 1.0.2.1, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_COMPUTE_PSO_WAIT_MS=1. One run.

Before this PR (the same tree without it, two runs): the title's watchdog fired at 200 s and 204 s (GPU Loc Sig 7333478d). In the dumps, a title thread builds a compute pipeline itself: resolve_for_bind → resolve_wait → real::translated_compute_pso → vkd3d-proton → dxil-spirv's CFG structurizer, for ≥ 29 s. Four other title threads wait in resolve_wait. Details in #505.

With this PR

  • Six compute pipeline … still building after 1 ms – proceeding with stand-in (continues in background).
  • At the stop, the dxil-spirv work is on xcl-pso-compute-1 / -3, and xcl-pso-compute-2 is in winevulkan.dll. None of it is on title threads, which is what this PR is for.
  • The title still stops at 199 s, with a different signature, GPU Loc Sig c20e3b19:
    • Title threads 564 and 568 are in resolve_for_indirect → resolve_wait, the graphics branch, which this PR leaves unbounded. That's the same thing jimokulou2-ops reports in #662. The xcl-pso-* workers are idle and one xcl-dxc-* thread is compiling.
    • From 171 s, 16 Wait64BitValueX timed out after 2000 ms (want 0x62d, memory holds Some(0)) back to back, with 0 presents from ~172 s (#505, #662).

Not tested: Windows. The workspace suite: XCL doesn't build or run its tests on Linux. #267 together with this PR. A run with the default 4000 ms. A second run of this build.

AI use: Claude Code (Claude Opus 5.5) merged and built the trees, symbolized the thread dumps (xcl.pdb, the local d3d12core.dll) and drafted this comment. The runs are mine, on the hardware above.

**@⁠itsd-effex** on GitHub · 2026-11-24 04:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7121778254) Linux (Wine + vkd3d-proton) test of this PR's head. On this stack it takes the slow compute conversions off the title threads; the title then stops on the two waits #662 describes. **Tested** - RTX 3080 Ti 12 GB (NVIDIA 620.73.04), i7-11700KF, 32 GB RAM + 36 GB swap, Linux. Wine from Proton Experimental and patched vkd3d-proton 3.1 (the #257 kit). Release build, cross-compiled with cargo-xwin. - Build: `main` `91f9a5e` + #684 (`e56dbc3`) + #273 (BC1) + this PR (`a966993`). All three merged without conflicts (`0d1c76b`). Our test title under Wine: 48 PASS / 2 FAIL, the same as `main`. - Retail 1.0.2.1, `XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_COMPUTE_PSO_WAIT_MS=1`. One run. **Before this PR** (the same tree without it, two runs): the title's watchdog fired at 200 s and 204 s (`GPU Loc Sig` `7333478d`). In the dumps, a title thread builds a compute pipeline itself: `resolve_for_bind` → `resolve_wait` → `real::translated_compute_pso` → vkd3d-proton → dxil-spirv's CFG structurizer, for ≥ 29 s. Four other title threads wait in `resolve_wait`. Details in #505. **With this PR** - Six `compute pipeline … still building after 1 ms – proceeding with stand-in (continues in background)`. - At the stop, the dxil-spirv work is on `xcl-pso-compute-1` / `-3`, and `xcl-pso-compute-2` is in `winevulkan.dll`. None of it is on title threads, which is what this PR is for. - The title still stops at 199 s, with a different signature, `GPU Loc Sig` `c20e3b19`: - Title threads 564 and 568 are in `resolve_for_indirect` → `resolve_wait`, the graphics branch, which this PR leaves unbounded. That's the same thing jimokulou2-ops reports in #662. The `xcl-pso-*` workers are idle and one `xcl-dxc-*` thread is compiling. - From 171 s, 16 `Wait64BitValueX timed out after 2000 ms` (`want 0x62d`, `memory holds Some(0)`) back to back, with 0 presents from ~172 s (#505, #662). **Not tested:** Windows. The workspace suite: XCL doesn't build or run its tests on Linux. #267 together with this PR. A run with the default 4000 ms. A second run of this build. **AI use:** Claude Code (Claude Opus 5.5) merged and built the trees, symbolized the thread dumps (`xcl.pdb`, the local `d3d12core.dll`) and drafted this comment. The runs are mine, on the hardware above.
Author
Owner

@⁠claudetools-gh on GitHub · 2026-11-24 04:16 UTC · original

Tested locally on an RTX 5070 Ti (NVIDIA, 32-lane waves) with this PR on top of main 508a0c7. It helps, but graphics pipelines can still block a title thread long enough to trip the title's watchdog:

  • pso_async::resolve_for_indirect still calls resolve_wait for graphics PSOs. A thread dump taken at the watchdog crash showed a title thread blocked in bind::graphics_bound -> resolve_for_indirect -> resolve_wait.
  • Direct draws (graphics_bound) also use resolve_wait.

Bounding both with a per-frame budget like this PR's compute one (stand-in past it) moved the crash ~20-40 s later in our runs.

For context, the watchdog (from the title's code): a thread wakes every 1 s and scans 64 per-thread "wait started" timestamps; a slot that stays stale across checks calls the fatal handler (the write to address 0 everyone sees). So any title thread blocked inside XCL for a few seconds trips it: PSO waits, Wait64 waits, readback waits.

(Findings and text by Claude Code / Claude Opus 5.5; runs done locally on the hardware above.)

**@⁠claudetools-gh** on GitHub · 2026-11-24 04:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7121869098) Tested locally on an RTX 5070 Ti (NVIDIA, 32-lane waves) with this PR on top of main 508a0c7. It helps, but graphics pipelines can still block a title thread long enough to trip the title's watchdog: - `pso_async::resolve_for_indirect` still calls `resolve_wait` for graphics PSOs. A thread dump taken at the watchdog crash showed a title thread blocked in `bind::graphics_bound -> resolve_for_indirect -> resolve_wait`. - Direct draws (`graphics_bound`) also use `resolve_wait`. Bounding both with a per-frame budget like this PR's compute one (stand-in past it) moved the crash ~20-40 s later in our runs. For context, the watchdog (from the title's code): a thread wakes every 1 s and scans 64 per-thread "wait started" timestamps; a slot that stays stale across checks calls the fatal handler (the write to address 0 everyone sees). So any title thread blocked inside XCL for a few seconds trips it: PSO waits, Wait64 waits, readback waits. (Findings and text by Claude Code / Claude Opus 5.5; runs done locally on the hardware above.)
Author
Owner

@⁠vibryxcx on GitHub · 2026-11-24 02:51 UTC · original · edited 2026-11-24 04:39 UTC

Test report on the retail title into the world, AMD RDNA2 on Windows: with this PR the bounded compute wait does fire, and the watchdog still ends the title at about the same time. At the stop, the title's threads are no longer waiting in set_pipeline_state but in draws and indirect calls (draw_instanced / execute_indirect → resolve_wait).

Setup: AMD Radeon RX 6800 16 GB (RDNA2, native wave64), driver 32.0.21045.5002; Intel Core i5-10600KF (clwb / monitorx emulated); 32 GB RAM, commit limit 45.4 GB (system-managed page file, peak use 407 MB); Windows 11 build 26200; Rust 1.100.0 MSVC; release builds. cargo clean --release -p xcl before each build.

Builds: main 3db536e (has #435), and this PR's head 5e6aca8 merged onto it (local merge commit f45bb77, no conflicts). Default XCL_COMPUTE_PSO_WAIT_MS.

Run: XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=600, XCL_PRESS_A_AT=14,17,21,125,131,…,197 (A at 14/17/21 s, then every 6 s from 125 to 197 s). main first, then the PR, back to back.

main 3db536e 3db536e + this PR
ends with +0x23cf683 (write at 0x0), rbx=0x0, at 301.9 s the same, at 306.1 s
frames shown 4,781 5,221
last submit 274.7 s 286.5 s
background_pipelines at the stop [47, 0, 58715] [62, 0, 58702]
still building after … ms – proceeding with stand-in lines – 2
ExecuteIndirect with pending compute pipeline … skipped lines – 4
commit at 301 s 27.7 GB 27.6 GB

Both runs hold 60 presents per 2 s up to about 190 s, then fall to 0–9 per 2 s while the world loads.

Where the title's threads wait at the stop. From XCL's thread dump, symbolized against each run's own release build with llvm-symbolizer (the main binary rebuilt from 3db536e with the same toolchain):

  • main: four title threads at the same frames, Condvar::wait ← pso_async::resolve_wait ← pso_async::resolve_for_bind ← bind::set_pipeline_state (title +0x248c734).
  • With this PR, none is in set_pipeline_state. Instead:
    • Condvar::wait ← pso_async::resolve_wait ← bind::graphics_bound ← bind::draw_instanced (title +0xbff06): one thread;
    • Condvar::wait ← pso_async::resolve_wait ← pso_async::resolve_for_indirect ← bind::execute_indirect (title +0x248d690, +0x248d4ef): three threads;
    • sleep ← list_x::wait64_x ← list_x::execute_with_waits ← real::q_execute_command_lists (title +0x24821e3): one thread.

So on this machine the bounded compute wait works as described, and the stall moves to draws and indirect calls that still wait in resolve_wait. The draw_instanced one is a graphics pipeline with no limit, which #267 bounds; I have not run the two together.

Not tested

  • This PR together with #267, or with XCL_COMPUTE_PSO_WAIT_MS other than the default.
  • Whether the three execute_indirect waits are for graphics or compute pipelines: the symbolized frames do not say, and resolve_for_indirect is the path this PR changes.
  • One run of each, so I do not count the 4 s difference in the stop time as a change.
  • The unit tests and scripts/smoke.ps1 on this machine.

AI use: Claude Code (Claude Opus 5.5): ran the tests and wrote this report.


Update: this PR together with #267, and a larger page file (same machine). #267 043d1f7 merged onto the local merge of this PR (f45bb77 above); the conflict in bind::execute_indirect resolved to keep both sides (this PR's pending-compute skip, then #267's root-signature bind for a stand-in), and resolve_for_indirect's graphics arm changed from resolve_wait to #267's resolve_for_draw. Local commit 2323f14, not pushed. cargo test -p xcl --lib pso_async: 5 passed, 0 failed. Same run command as above, 600 s limit, one run each.

build page file / commit limit XCL_PSO_WAIT_MS ends with +0x23cf683 at background_pipelines standin_draws
3db536e + this PR + #267 system-managed, 45.4 GB 4 s (default) 299.2 s [86, 0, 58678] 14
3db536e + this PR + #267 system-managed, 45.4 GB 150 ms 294.2 s [119, 0, 58646] 190
3db536e + this PR + #267 32–64 GB, 63.9 GB 150 ms 303.2 s [206, 0, 58558] 134
main 3db536e 32–64 GB, 63.9 GB – 302.0 s [46, 0, 58715] –
  • With both PRs, no title thread is left in an unbounded pipeline wait at the stop: the thread dump has one or two in Condvar::wait_timeout ← pso_async::resolve_for_draw (from bind::draw_instanced / bind::execute_indirect), as #267 intends. main with the larger page file still has four in resolve_wait ← resolve_for_bind ← bind::set_pipeline_state.
  • On the 45.4 GB limit, 10 of the 11 xcl-dxc workers were in dxc::wait_for_memory at the stop (as @⁠S1m0ne1997 describes in #505). With the 63.9 GB limit, 3 of 11 were; 5 were in dxcompiler.dll and 4 xcl-pso workers in amdxc64.dll.
  • In every run with this PR: the bounded compute wait expires (still building after ~3.6–4.0 s), the dispatch / ExecuteIndirect skips follow in the same millisecond, and 2–8 s later Wait64BitValueX timed out after 2000 ms at 0x70417fe… (op 7 …; memory holds Some(0)) three times. @⁠xstraok's run k2 has these timeouts with no skip at all, so I read this as the same loading point, not as caused by the skips.

So on RDNA2 / Windows, bounding both waits and roughly doubling the pipelines built before the stop still leaves the heartbeat abort at about 300 s.

Not tested (update): this PR and #267 at their current heads (a966993 for this PR); a warm or precompiled DXIL cache; XCL_COMPUTE_PSO_WAIT_MS other than the default.


Update: merging this PR (a966993) onto current main (f4ce27c, which has #690). It conflicts in pso_async.rs (Pending fields and submit_as). Two things a rebase needs beyond the conflict markers:

  • resolve_compute_within does not call p.note_use(), which #690's other resolve paths do. Without it, a compute pipeline bound through this PR's path is never kept in used-pipelines, so #690 does not build it ahead in the next run. These are the compute pipelines the watchdog is about. I added p.note_use() right after entry(pso) there.
  • submit_as (from #690) sends with queue().send(p); this PR's enqueue(&p) keeps compute on the compute pool. I used enqueue(&p).

With #267 on top I also changed resolve_for_indirect's graphics arm from resolve_wait to #267's resolve_for_draw (the case @⁠claudetools-gh describes above), and gave resolve_within the same note_use(). The tests that call submit_lazy need #690's new key argument (0). cargo test -p xcl --lib pso_async: 7 passed; bind::: 6 passed. Local only (f0e46a4); the runs on that tree are in #505.

**@⁠vibryxcx** on GitHub · 2026-11-24 02:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7120547969) · edited 2026-11-24 04:39 UTC Test report on the retail title **into the world, AMD RDNA2 on Windows**: with this PR the bounded compute wait does fire, and the watchdog still ends the title at about the same time. At the stop, the title's threads are no longer waiting in `set_pipeline_state` but in draws and indirect calls (`draw_instanced` / `execute_indirect` → `resolve_wait`). **Setup:** AMD Radeon RX 6800 16 GB (RDNA2, native wave64), driver 32.0.21045.5002; Intel Core i5-10600KF (`clwb` / `monitorx` emulated); 32 GB RAM, commit limit 45.4 GB (system-managed page file, peak use 407 MB); Windows 11 build 26200; Rust 1.100.0 MSVC; release builds. `cargo clean --release -p xcl` before each build. **Builds:** `main` `3db536e` (has #435), and this PR's head `5e6aca8` merged onto it (local merge commit `f45bb77`, no conflicts). Default `XCL_COMPUTE_PSO_WAIT_MS`. **Run:** `XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=600`, `XCL_PRESS_A_AT=14,17,21,125,131,…,197` (A at 14/17/21 s, then every 6 s from 125 to 197 s). `main` first, then the PR, back to back. | | `main` `3db536e` | `3db536e` + this PR | |---|---|---| | ends with | `+0x23cf683` (write at 0x0), `rbx=0x0`, at **301.9 s** | the same, at **306.1 s** | | frames shown | 4,781 | 5,221 | | last submit | 274.7 s | 286.5 s | | `background_pipelines` at the stop | `[47, 0, 58715]` | `[62, 0, 58702]` | | `still building after … ms – proceeding with stand-in` lines | – | 2 | | `ExecuteIndirect with pending compute pipeline … skipped` lines | – | 4 | | commit at 301 s | 27.7 GB | 27.6 GB | Both runs hold 60 presents per 2 s up to about 190 s, then fall to 0–9 per 2 s while the world loads. **Where the title's threads wait at the stop.** From XCL's thread dump, symbolized against each run's own release build with `llvm-symbolizer` (the `main` binary rebuilt from `3db536e` with the same toolchain): - `main`: four title threads at the same frames, `Condvar::wait` ← `pso_async::resolve_wait` ← `pso_async::resolve_for_bind` ← `bind::set_pipeline_state` (title `+0x248c734`). - With this PR, none is in `set_pipeline_state`. Instead: - `Condvar::wait` ← `pso_async::resolve_wait` ← `bind::graphics_bound` ← `bind::draw_instanced` (title `+0xbff06`): one thread; - `Condvar::wait` ← `pso_async::resolve_wait` ← `pso_async::resolve_for_indirect` ← `bind::execute_indirect` (title `+0x248d690`, `+0x248d4ef`): three threads; - `sleep` ← `list_x::wait64_x` ← `list_x::execute_with_waits` ← `real::q_execute_command_lists` (title `+0x24821e3`): one thread. So on this machine the bounded compute wait works as described, and the stall moves to draws and indirect calls that still wait in `resolve_wait`. The `draw_instanced` one is a graphics pipeline with no limit, which #267 bounds; I have not run the two together. **Not tested** - This PR together with #267, or with `XCL_COMPUTE_PSO_WAIT_MS` other than the default. - Whether the three `execute_indirect` waits are for graphics or compute pipelines: the symbolized frames do not say, and `resolve_for_indirect` is the path this PR changes. - One run of each, so I do not count the 4 s difference in the stop time as a change. - The unit tests and `scripts/smoke.ps1` on this machine. **AI use:** Claude Code (Claude Opus 5.5): ran the tests and wrote this report. --- **Update: this PR together with #267, and a larger page file (same machine).** #267 `043d1f7` merged onto the local merge of this PR (`f45bb77` above); the conflict in `bind::execute_indirect` resolved to keep both sides (this PR's pending-compute skip, then #267's root-signature bind for a stand-in), and `resolve_for_indirect`'s graphics arm changed from `resolve_wait` to #267's `resolve_for_draw`. Local commit `2323f14`, not pushed. `cargo test -p xcl --lib pso_async`: 5 passed, 0 failed. Same run command as above, 600 s limit, one run each. | build | page file / commit limit | `XCL_PSO_WAIT_MS` | ends with `+0x23cf683` at | `background_pipelines` | `standin_draws` | |---|---|---|---|---|---| | `3db536e` + this PR + #267 | system-managed, 45.4 GB | 4 s (default) | 299.2 s | `[86, 0, 58678]` | 14 | | `3db536e` + this PR + #267 | system-managed, 45.4 GB | 150 ms | 294.2 s | `[119, 0, 58646]` | 190 | | `3db536e` + this PR + #267 | 32–64 GB, 63.9 GB | 150 ms | 303.2 s | `[206, 0, 58558]` | 134 | | `main` `3db536e` | 32–64 GB, 63.9 GB | – | 302.0 s | `[46, 0, 58715]` | – | - With both PRs, no title thread is left in an unbounded pipeline wait at the stop: the thread dump has one or two in `Condvar::wait_timeout` ← `pso_async::resolve_for_draw` (from `bind::draw_instanced` / `bind::execute_indirect`), as #267 intends. `main` with the larger page file still has four in `resolve_wait` ← `resolve_for_bind` ← `bind::set_pipeline_state`. - On the 45.4 GB limit, 10 of the 11 `xcl-dxc` workers were in `dxc::wait_for_memory` at the stop (as @⁠S1m0ne1997 describes in #505). With the 63.9 GB limit, 3 of 11 were; 5 were in `dxcompiler.dll` and 4 `xcl-pso` workers in `amdxc64.dll`. - In every run with this PR: the bounded compute wait expires (`still building after ~3.6–4.0 s`), the dispatch / `ExecuteIndirect` skips follow in the same millisecond, and 2–8 s later `Wait64BitValueX timed out after 2000 ms at 0x70417fe… (op 7 …; memory holds Some(0))` three times. @⁠xstraok's run k2 has these timeouts with no skip at all, so I read this as the same loading point, not as caused by the skips. So on RDNA2 / Windows, bounding both waits and roughly doubling the pipelines built before the stop still leaves the heartbeat abort at about 300 s. **Not tested (update):** this PR and #267 at their current heads (`a966993` for this PR); a warm or precompiled DXIL cache; `XCL_COMPUTE_PSO_WAIT_MS` other than the default. --- **Update: merging this PR (`a966993`) onto current `main` (`f4ce27c`, which has #690).** It conflicts in `pso_async.rs` (`Pending` fields and `submit_as`). Two things a rebase needs beyond the conflict markers: - `resolve_compute_within` does not call `p.note_use()`, which #690's other resolve paths do. Without it, a compute pipeline bound through this PR's path is never kept in `used-pipelines`, so #690 does not build it ahead in the next run. These are the compute pipelines the watchdog is about. I added `p.note_use()` right after `entry(pso)` there. - `submit_as` (from #690) sends with `queue().send(p)`; this PR's `enqueue(&p)` keeps compute on the compute pool. I used `enqueue(&p)`. With #267 on top I also changed `resolve_for_indirect`'s graphics arm from `resolve_wait` to #267's `resolve_for_draw` (the case @⁠claudetools-gh describes above), and gave `resolve_within` the same `note_use()`. The tests that call `submit_lazy` need #690's new `key` argument (`0`). `cargo test -p xcl --lib pso_async`: 7 passed; `bind::`: 6 passed. Local only (`f0e46a4`); the runs on that tree are in #505.
Author
Owner

@⁠CowboyBingus on GitHub · 2026-11-24 05:22 UTC · original

Found while merging this onto current main (which now has #690): after the rebase, resolve_compute_within needs a note_use().

Compute pipelines bound through Dispatch, ExecuteIndirect and resolve_for_bind now go through resolve_compute_within instead of resolve_wait, and only resolve_wait calls #690's note_use(). So they are never written to used-pipelines.txt, and the next run does not build them ahead of their first use. Only the XCL_COMPUTE_PSO_WAIT_MS=0 fallback, which goes to resolve_wait, still records them.

Fix: p.note_use(); right after let Some(p) = entry(pso) else { return pso }; in resolve_compute_within. This test fails without the line and passes with it:

/// A compute pipeline the title binds through the bounded wait (`resolve_compute_within`) is
/// recorded for the next run's prebuild (`used`), as one through `resolve_wait` is.
#[test]
fn bounded_compute_wait_records_the_pipeline_for_the_next_run() {
    let (standin, key) = (0x7300_0101usize, 0x5EED_0000_0000_0101u64);
    submit_lazy(standin, true, Box::new(|| 0x7300_0102usize), key);
    assert!(!used::noted(key));
    let budget = FrameBudget::new();
    let _ = resolve_compute_within(standin, Some(Duration::from_secs(2)), &budget);
    assert!(used::noted(key), "a compute pipeline used through the bounded wait is kept for the next run");
    let _ = released(standin);
}

Checked on a local merge of this PR (a966993) onto main d5442d2: cargo test -p xcl --lib pso_async, 8 passed with the line, the new test fails without it (Windows 11, RTX 5070 Ti, Rust 1.91).

AI use: found by an adversarial review run with Claude Code (Claude Opus 5.5), confirmed by a second independent merge and the test above.

**@⁠CowboyBingus** on GitHub · 2026-11-24 05:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7122886548) Found while merging this onto current `main` (which now has #690): after the rebase, `resolve_compute_within` needs a `note_use()`. Compute pipelines bound through `Dispatch`, `ExecuteIndirect` and `resolve_for_bind` now go through `resolve_compute_within` instead of `resolve_wait`, and only `resolve_wait` calls #690's `note_use()`. So they are never written to `used-pipelines.txt`, and the next run does not build them ahead of their first use. Only the `XCL_COMPUTE_PSO_WAIT_MS=0` fallback, which goes to `resolve_wait`, still records them. Fix: `p.note_use();` right after `let Some(p) = entry(pso) else { return pso };` in `resolve_compute_within`. This test fails without the line and passes with it: ```rust /// A compute pipeline the title binds through the bounded wait (`resolve_compute_within`) is /// recorded for the next run's prebuild (`used`), as one through `resolve_wait` is. #[test] fn bounded_compute_wait_records_the_pipeline_for_the_next_run() { let (standin, key) = (0x7300_0101usize, 0x5EED_0000_0000_0101u64); submit_lazy(standin, true, Box::new(|| 0x7300_0102usize), key); assert!(!used::noted(key)); let budget = FrameBudget::new(); let _ = resolve_compute_within(standin, Some(Duration::from_secs(2)), &budget); assert!(used::noted(key), "a compute pipeline used through the bounded wait is kept for the next run"); let _ = released(standin); } ``` Checked on a local merge of this PR (`a966993`) onto `main` `d5442d2`: `cargo test -p xcl --lib pso_async`, 8 passed with the line, the new test fails without it (Windows 11, RTX 5070 Ti, Rust 1.91). AI use: found by an adversarial review run with Claude Code (Claude Opus 5.5), confirmed by a second independent merge and the test above.
Author
Owner

@⁠gccody on GitHub · 2026-11-24 06:14 UTC · original

A Linux data point (Wine + vkd3d-proton, RTX 3080). With this PR merged, graphics pipelines can still hold a title thread past the GPU Loc Sig watchdog (#505). A suggested extension follows.

What I saw. Retail title 1.0.2.1, main f4ce27c + #257 + #684 + this PR (merged onto main; the only conflict was pso_async.rs). XCL_THREAD_DUMP_AT=215,230; the watchdog fired at 247 s.

  • At 230 s, a title thread was in bind::execute_indirect → pso_async::resolve_for_indirect → resolve_wait → real::build_graphics → translated_graphics_pso → d3d12core.dll → winevulkan.dll. That is a graphics pipeline built by the driver, waited for without a bound.
  • At the stop, the same thread was in dxc::compile for the next one.
  • The title's main thread waited on its render thread, which waited on that render job.

resolve_for_indirect gives compute pipelines the bounded wait but graphics ones resolve_wait. bind::graphics_bound, which runs before every draw, also uses resolve_wait.

Suggestion. Give graphics pipelines the same bounded wait in both places. resolve_compute_within has nothing compute-specific in it (enqueue picks the pool from p.compute), and both callers already handle a stand-in: execute_indirect skips while is_pending, and graphics_bound draws with the stand-in (nothing), as for a failed build. The diff against this PR merged on main:

diff (bind.rs, pso_async.rs, plus a test)
diff --git a/crates/xcl/src/hle/d3d12x/bind.rs b/crates/xcl/src/hle/d3d12x/bind.rs
--- a/crates/xcl/src/hle/d3d12x/bind.rs
+++ b/crates/xcl/src/hle/d3d12x/bind.rs
@@ -386,8 +386,10 @@ pub(super) unsafe fn emit_prepared_indexed_draw(
 unsafe fn graphics_bound(this: *mut c_void) -> Option<ID3D12GraphicsCommandList> {
     let list = ID3D12GraphicsCommandList::from_raw_borrowed(&this)?.clone();
     let pso = with(this, |s| s.pso);
-    // a pipeline still being built in the background is waited for (its stand-in draws nothing)
-    if !super::real::is_translated_graphics(super::pso_async::resolve_wait(pso)) {
+    // a pipeline still being built in the background is waited for up to the frame's budget,
+    // then drawn with its stand-in (nothing) while the build goes on: waiting for it without a
+    // bound held a retail title's render job past its 30 s watchdog (`GPU Loc Sig`)
+    if !super::real::is_translated_graphics(super::pso_async::resolve_bounded(pso)) {
         count(DRAWS_PC);
         if super::present::trace_frame() {
             // which pipelines draw without a translation (first 12 distinct)
diff --git a/crates/xcl/src/hle/d3d12x/pso_async.rs b/crates/xcl/src/hle/d3d12x/pso_async.rs
--- a/crates/xcl/src/hle/d3d12x/pso_async.rs
+++ b/crates/xcl/src/hle/d3d12x/pso_async.rs
@@ -477,7 +477,8 @@ fn resolve_compute_within(pso: usize, limit: Option<std::time::Duration>, budget
             static LOGGED: AtomicUsize = AtomicUsize::new(0);
             if LOGGED.fetch_add(1, Ordering::Relaxed) < 16 {
                 crate::xlog_warn!(
-                    "D3D12.X: compute pipeline {pso:#x} still building after {} ms – proceeding with stand-in (continues in background)",
+                    "D3D12.X: {} pipeline {pso:#x} still building after {} ms – proceeding with stand-in (continues in background)",
+                    if p.compute { "compute" } else { "graphics" },
                     elapsed.as_millis()
                 );
             }
@@ -506,11 +507,20 @@ pub fn resolve_for_bind(pso: usize) -> usize {
     }
 }
 
-/// For `ExecuteIndirect`: compute pipelines use bounded waits, graphics pipelines keep `resolve_wait`.
+/// For `ExecuteIndirect`: compute and graphics pipelines alike wait up to the frame's budget
+/// (`XCL_COMPUTE_PSO_WAIT_MS`), then the call is skipped while the build goes on in the
+/// background (`bind::execute_indirect`), as a draw of a pipeline still being built is. An
+/// unbounded wait here held a retail title's render job – and with it the thread its watchdog
+/// watches – for 30 s while the driver compiled one graphics pipeline (`GPU Loc Sig`).
 pub fn resolve_for_indirect(pso: usize) -> usize {
+    resolve_bounded(pso)
+}
+
+/// A pipeline of either kind, waited for up to the frame's budget (`XCL_COMPUTE_PSO_WAIT_MS`):
+/// the real one if its build finished in time, else the stand-in while the build goes on.
+pub fn resolve_bounded(pso: usize) -> usize {
     match entry(pso) {
-        Some(p) if p.compute => resolve_compute(pso),
-        Some(_) => resolve_wait(pso),
+        Some(_) => resolve_compute(pso),
         None => pso,
     }
 }
@@ -595,6 +605,37 @@ mod tests {
         assert_eq!(released(standin), real_pso);
     }
 
+    /// A graphics pipeline an `ExecuteIndirect` binds while its build is still running gets the
+    /// same bounded wait as a compute one: the stand-in comes back after the limit (the call is
+    /// then skipped) instead of the title's thread waiting for the build.
+    #[test]
+    fn bounded_wait_covers_graphics_pipelines_too() {
+        let standin = 0x7300_0101usize;
+        let real_pso = 0x7300_0102usize;
+        let budget = FrameBudget::new();
+        let (tx, rx) = mpsc::channel::<()>();
+        submit_lazy(
+            standin,
+            false,
+            Box::new(move || {
+                let _ = rx.recv_timeout(Duration::from_secs(5));
+                real_pso
+            }),
+            0,
+        );
+        let t0 = Instant::now();
+        assert_eq!(resolve_compute_within(standin, Some(Duration::from_millis(60)), &budget), standin);
+        assert!(t0.elapsed() < Duration::from_secs(1), "a graphics build must not hold the binding thread");
+        assert!(is_pending(standin) && !is_pending_compute(standin));
+        tx.send(()).unwrap();
+        let wait = Instant::now();
+        while resolve_compute_within(standin, Some(Duration::from_millis(50)), &budget) != real_pso {
+            assert!(wait.elapsed() < Duration::from_secs(5), "background graphics PSO never completed");
+            std::thread::sleep(Duration::from_millis(10));
+        }
+        assert_eq!(released(standin), real_pso);
+    }
+
     #[test]
     fn bounded_compute_wait_returns_real_when_build_finishes_in_time() {
         let standin = 0x7300_0003usize;

On this PR's own branch, submit_lazy still takes three arguments: the test then drops the trailing 0,. The commit is 97fd2c5 on gccody/xcl branch linux-boot.

What it changed here: pso_async tests (including the new one) and bind:: tests pass under Wine.

  • In the title, no title thread was in a pipeline wait at the next stop. That run also had #708 and #273 merged, so the effect isn't isolated: the watchdog moved from ~245 s to 330 s.
  • Skipping the draws and dispatches of pipelines that are still building has a cost of its own on Linux. There, big compute builds took 25 – 120 s each (#820 makes the single big-build slot configurable), and in one run the title later read data those dispatches would have written.

AI use: Claude Code (Claude Opus 5.5) found this, wrote the diff and this comment; the runs were on the commenter's machine.

**@⁠gccody** on GitHub · 2026-11-24 06:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7123736699) A Linux data point (Wine + vkd3d-proton, RTX 3080). With this PR merged, graphics pipelines can still hold a title thread past the `GPU Loc Sig` watchdog (#505). A suggested extension follows. **What I saw.** Retail title 1.0.2.1, `main` `f4ce27c` + #257 + #684 + this PR (merged onto `main`; the only conflict was `pso_async.rs`). `XCL_THREAD_DUMP_AT=215,230`; the watchdog fired at 247 s. - At 230 s, a title thread was in `bind::execute_indirect` → `pso_async::resolve_for_indirect` → `resolve_wait` → `real::build_graphics` → `translated_graphics_pso` → `d3d12core.dll` → `winevulkan.dll`. That is a **graphics** pipeline built by the driver, waited for without a bound. - At the stop, the same thread was in `dxc::compile` for the next one. - The title's main thread waited on its render thread, which waited on that render job. `resolve_for_indirect` gives compute pipelines the bounded wait but graphics ones `resolve_wait`. `bind::graphics_bound`, which runs before every draw, also uses `resolve_wait`. **Suggestion.** Give graphics pipelines the same bounded wait in both places. `resolve_compute_within` has nothing compute-specific in it (`enqueue` picks the pool from `p.compute`), and both callers already handle a stand-in: `execute_indirect` skips while `is_pending`, and `graphics_bound` draws with the stand-in (nothing), as for a failed build. The diff against this PR merged on `main`: <details><summary>diff (bind.rs, pso_async.rs, plus a test)</summary> ```diff diff --git a/crates/xcl/src/hle/d3d12x/bind.rs b/crates/xcl/src/hle/d3d12x/bind.rs --- a/crates/xcl/src/hle/d3d12x/bind.rs +++ b/crates/xcl/src/hle/d3d12x/bind.rs @@ -386,8 +386,10 @@ pub(super) unsafe fn emit_prepared_indexed_draw( unsafe fn graphics_bound(this: *mut c_void) -> Option<ID3D12GraphicsCommandList> { let list = ID3D12GraphicsCommandList::from_raw_borrowed(&this)?.clone(); let pso = with(this, |s| s.pso); - // a pipeline still being built in the background is waited for (its stand-in draws nothing) - if !super::real::is_translated_graphics(super::pso_async::resolve_wait(pso)) { + // a pipeline still being built in the background is waited for up to the frame's budget, + // then drawn with its stand-in (nothing) while the build goes on: waiting for it without a + // bound held a retail title's render job past its 30 s watchdog (`GPU Loc Sig`) + if !super::real::is_translated_graphics(super::pso_async::resolve_bounded(pso)) { count(DRAWS_PC); if super::present::trace_frame() { // which pipelines draw without a translation (first 12 distinct) diff --git a/crates/xcl/src/hle/d3d12x/pso_async.rs b/crates/xcl/src/hle/d3d12x/pso_async.rs --- a/crates/xcl/src/hle/d3d12x/pso_async.rs +++ b/crates/xcl/src/hle/d3d12x/pso_async.rs @@ -477,7 +477,8 @@ fn resolve_compute_within(pso: usize, limit: Option<std::time::Duration>, budget static LOGGED: AtomicUsize = AtomicUsize::new(0); if LOGGED.fetch_add(1, Ordering::Relaxed) < 16 { crate::xlog_warn!( - "D3D12.X: compute pipeline {pso:#x} still building after {} ms – proceeding with stand-in (continues in background)", + "D3D12.X: {} pipeline {pso:#x} still building after {} ms – proceeding with stand-in (continues in background)", + if p.compute { "compute" } else { "graphics" }, elapsed.as_millis() ); } @@ -506,11 +507,20 @@ pub fn resolve_for_bind(pso: usize) -> usize { } } -/// For `ExecuteIndirect`: compute pipelines use bounded waits, graphics pipelines keep `resolve_wait`. +/// For `ExecuteIndirect`: compute and graphics pipelines alike wait up to the frame's budget +/// (`XCL_COMPUTE_PSO_WAIT_MS`), then the call is skipped while the build goes on in the +/// background (`bind::execute_indirect`), as a draw of a pipeline still being built is. An +/// unbounded wait here held a retail title's render job – and with it the thread its watchdog +/// watches – for 30 s while the driver compiled one graphics pipeline (`GPU Loc Sig`). pub fn resolve_for_indirect(pso: usize) -> usize { + resolve_bounded(pso) +} + +/// A pipeline of either kind, waited for up to the frame's budget (`XCL_COMPUTE_PSO_WAIT_MS`): +/// the real one if its build finished in time, else the stand-in while the build goes on. +pub fn resolve_bounded(pso: usize) -> usize { match entry(pso) { - Some(p) if p.compute => resolve_compute(pso), - Some(_) => resolve_wait(pso), + Some(_) => resolve_compute(pso), None => pso, } } @@ -595,6 +605,37 @@ mod tests { assert_eq!(released(standin), real_pso); } + /// A graphics pipeline an `ExecuteIndirect` binds while its build is still running gets the + /// same bounded wait as a compute one: the stand-in comes back after the limit (the call is + /// then skipped) instead of the title's thread waiting for the build. + #[test] + fn bounded_wait_covers_graphics_pipelines_too() { + let standin = 0x7300_0101usize; + let real_pso = 0x7300_0102usize; + let budget = FrameBudget::new(); + let (tx, rx) = mpsc::channel::<()>(); + submit_lazy( + standin, + false, + Box::new(move || { + let _ = rx.recv_timeout(Duration::from_secs(5)); + real_pso + }), + 0, + ); + let t0 = Instant::now(); + assert_eq!(resolve_compute_within(standin, Some(Duration::from_millis(60)), &budget), standin); + assert!(t0.elapsed() < Duration::from_secs(1), "a graphics build must not hold the binding thread"); + assert!(is_pending(standin) && !is_pending_compute(standin)); + tx.send(()).unwrap(); + let wait = Instant::now(); + while resolve_compute_within(standin, Some(Duration::from_millis(50)), &budget) != real_pso { + assert!(wait.elapsed() < Duration::from_secs(5), "background graphics PSO never completed"); + std::thread::sleep(Duration::from_millis(10)); + } + assert_eq!(released(standin), real_pso); + } + #[test] fn bounded_compute_wait_returns_real_when_build_finishes_in_time() { let standin = 0x7300_0003usize; ``` </details> On this PR's own branch, `submit_lazy` still takes three arguments: the test then drops the trailing `0,`. The commit is `97fd2c5` on `gccody/xcl` branch `linux-boot`. **What it changed here:** `pso_async` tests (including the new one) and `bind::` tests pass under Wine. - In the title, no title thread was in a pipeline wait at the next stop. That run also had #708 and #273 merged, so the effect isn't isolated: the watchdog moved from ~245 s to 330 s. - Skipping the draws and dispatches of pipelines that are still building has a cost of its own on Linux. There, big compute builds took 25 – 120 s each (#820 makes the single big-build slot configurable), and in one run the title later read data those dispatches would have written. AI use: Claude Code (Claude Opus 5.5) found this, wrote the diff and this comment; the runs were on the commenter's machine.
Author
Owner

@⁠XaviFortes on GitHub · 2026-11-24 07:55 UTC · original

Rebased onto current main (1ec4c98) at 001e37d and resolved the #690 conflict in pso_async.rs, folding in the two suggestions from overnight:

@⁠CowboyBingus: added p.note_use() in resolve_compute_within + bounded_compute_wait_records_the_pipeline_for_the_next_run so pipelines bound through the bounded wait are still recorded in used-pipelines.txt for #690 preloading.
@⁠gccody & @⁠WarmMilkCodes: added resolve_bounded and wired both resolve_for_indirect and bind::graphics_bound to share the per-frame budget + bounded_wait_covers_graphics_pipelines_too, so graphics pipeline builds no longer stall past the GPU Loc Sig watchdog either.
@⁠xstraok: thanks for the thorough RADV bisect and confirming the Wait64BitValueX timeouts weren't caused by the skips.

Updated the PR description with a fresh 60 s smoke run on 001e37d (1,374 frames, 60 60 60 presents/2 s, 14,942 MB peak commit, 0 crashes, 0 device removals).

**@⁠XaviFortes** on GitHub · 2026-11-24 07:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7125518923) Rebased onto current main (1ec4c98) at 001e37d and resolved the #690 conflict in pso_async.rs, folding in the two suggestions from overnight: @⁠CowboyBingus: added p.note_use() in resolve_compute_within + bounded_compute_wait_records_the_pipeline_for_the_next_run so pipelines bound through the bounded wait are still recorded in used-pipelines.txt for #690 preloading. @⁠gccody & @⁠WarmMilkCodes: added resolve_bounded and wired both resolve_for_indirect and bind::graphics_bound to share the per-frame budget + bounded_wait_covers_graphics_pipelines_too, so graphics pipeline builds no longer stall past the GPU Loc Sig watchdog either. @⁠xstraok: thanks for the thorough RADV bisect and confirming the Wait64BitValueX timeouts weren't caused by the skips. Updated the PR description with a fresh 60 s smoke run on 001e37d (1,374 frames, 60 60 60 presents/2 s, 14,942 MB peak commit, 0 crashes, 0 device removals).
Author
Owner

@⁠CowboyBingus on GitHub · 2026-11-24 08:00 UTC · original

Thanks. Confirmed at 001e37d: p.note_use() is in resolve_compute_within, and bounded_compute_wait_records_the_pipeline_for_the_next_run is there.

On the graphics side, our traces support resolve_bounded. RTX 5070 Ti, retail world load, #533 at a966993 + #267, before this change. In every thread dump during the stall, the title thread was in bind::execute_indirect → pso_async::resolve_for_indirect → resolve_for_draw → resolve_within → Condvar::wait_timeout. That was 10 waits of 2.1-2.4 s each back to back, 23.7 s in all. Presents stopped and the watchdog followed. With both caps at 50 / 100 ms (XCL_PSO_WAIT_MS / XCL_COMPUTE_PSO_WAIT_MS), the title got the odd frame out and the watchdog moved from ~104 s to ~159 s, so the waits are one part of that stall but not all of it. I'll run 001e37d on the same setup and post what changes.

AI use: Claude Code (Claude Opus 5.5) read the diff and the thread dumps; I ran the tests.

**@⁠CowboyBingus** on GitHub · 2026-11-24 08:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7125614899) Thanks. Confirmed at `001e37d`: `p.note_use()` is in `resolve_compute_within`, and `bounded_compute_wait_records_the_pipeline_for_the_next_run` is there. On the graphics side, our traces support `resolve_bounded`. RTX 5070 Ti, retail world load, #533 at `a966993` + #267, before this change. In every thread dump during the stall, the title thread was in `bind::execute_indirect` → `pso_async::resolve_for_indirect` → `resolve_for_draw` → `resolve_within` → `Condvar::wait_timeout`. That was 10 waits of 2.1-2.4 s each back to back, 23.7 s in all. Presents stopped and the watchdog followed. With both caps at 50 / 100 ms (`XCL_PSO_WAIT_MS` / `XCL_COMPUTE_PSO_WAIT_MS`), the title got the odd frame out and the watchdog moved from ~104 s to ~159 s, so the waits are one part of that stall but not all of it. I'll run `001e37d` on the same setup and post what changes. AI use: Claude Code (Claude Opus 5.5) read the diff and the thread dumps; I ran the tests.
Author
Owner

@⁠bstillbstill on GitHub · 2026-11-24 09:06 UTC · original

Test report: 001e37d on NVIDIA RTX 3090 Ti (Windows) with the retail title of #505. The bounded waits work and move the "GPU Loc Sig" abort ~12 s later. The next block is a sparse readback in Map that holds the sparse lock while it waits for the GPU.

Builds (merged locally onto main 09940bb):

Build Commit Contents
baseline 6c13c10 main + #899 (bind-wait logging only)
this PR 16ebe79 main + 001e37d, clean merge
this PR + #433 4dc8428 main + 001e37d + #433 19004e1; one conflict in sparse.rs, doc comments only (#433's text for readback_after_execute next to main's new queue()), both kept as they were

Retail title, 300 s per run. Same machine, same warm caches, DXC 1.9.2609.5, scripts/smoke.ps1 (with the crashed-run fix from a local branch, so a crashing run still gets a block). Scripted input XCL_PRESS_A_AT=15,21,…,585 (every 6 s), XCL_THREAD_DUMP_AT for thread dumps, XCL frames resolved against each build's PDB.

Build End Skipped (draws / dispatches) Sparse readback timeouts Peak commit
baseline abort at +0x23cf683, 95.7 s 0 / 0 0 34,288 MB
this PR, run 1 crash at 32.2 s in tiling::Chain::detile_level (see below) 0 / 0 0 18,542 MB
this PR, run 2 abort, write to 0 at +0x2215c35, 107.8 s 1,320 / 5,310 4 (88–103 s) 36,401 MB
this PR + #433, run 2 abort at +0x23cf683, 118.8 s 1,786 / 8,952 5 (93–113 s) 32,097 MB
  • Baseline: #899's log has 11 graphics waits of 1.0–2.6 s back to back on one title thread from 72 s to 95.5 s, each "waited for a worker". The dumps at 75 s and 90 s show that thread in bind::execute_indirect (bind.rs:238) → pso_async::resolve_wait. Only 1 of 31 xcl-pso-* workers was in the driver: the title binds one new graphics pipeline after another and waits for each.
  • This PR, run 2: those waits are gone. The title thread that stalls is now in real::res_map → sparse::readback_now → State::readback_ranges → State::wait_for (sparse.rs:776). Its fence stays 2 short (has not reached fence value 38430 after 5 s (at 38428)), 4 times in a row, until the abort.
  • This PR + #433, run 2: the same, 5 times (39956 … (at 39951)). The dumps at 90 s and 105 s also show the title's submitting thread in q_execute_command_lists → sparse::before_execute / sparse::queue() → Mutex::lock_contended. readback_now takes STATE and keeps it through readback_ranges and both of its wait_for calls. So while Map waits for the GPU, the title cannot submit, and the work the fence is waiting for may be in that submit. #433 covers the copy back after ExecuteCommandLists, not this Map path.

Two crashes that are probably not this PR:

  • Run 1 at 32.2 s: three title_textures::subresources_on workers crashed together in VCRUNTIME140.dll+0x1bb86 from tiling::Chain::detile_level (tiling.rs:438), reading unmapped title memory. Nothing had been skipped yet, and it did not come back in the other 13 runs of the title on this machine. #751 changes title texture reads in this area.
  • The first run of this PR + #433 ended at 60.06 s in ntdll.dll (read at 0x2b), 57 ms after a scheduled XCL_THREAD_DUMP_AT=60 dump. With the first dump at 75 s, the rerun went on to the abort above. An earlier comment on #505 reports eh::dump_threads faulting in ntdll on live stacks.

I did not see the 0xffffffffffffffff read others reported with skipped dispatches.

Tested

  • NVIDIA GeForce RTX 3090 Ti (driver 32.0.16.2101, 32-lane waves), Intel i9-13900K, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0 MSVC.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 (debug):
    • this PR on main (16ebe79): 721 passed, 0 failed, 41 ignored
    • this PR + #433 (4dc8428): 723 passed, 0 failed, 41 ignored
    • SKIPPED in both: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64)
  • Title runs: release builds, one run per row above (two of this PR).

Not tested: AMD / Intel; more than one or two runs per build; whether skipped work shows up as wrong rendering (the title never left its loading screen in these runs); #533 with #267 or #891.

Test runs, log and dump analysis and this comment by Claude Code (Claude Opus 5.5); I checked the logs it is based on.

**@⁠bstillbstill** on GitHub · 2026-11-24 09:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7126968877) **Test report: `001e37d` on NVIDIA RTX 3090 Ti (Windows) with the retail title of #505. The bounded waits work and move the "GPU Loc Sig" abort ~12 s later. The next block is a sparse readback in `Map` that holds the sparse lock while it waits for the GPU.** **Builds** (merged locally onto `main` `09940bb`): | Build | Commit | Contents | |---|---|---| | baseline | `6c13c10` | `main` + #899 (bind-wait logging only) | | this PR | `16ebe79` | `main` + `001e37d`, clean merge | | this PR + #433 | `4dc8428` | `main` + `001e37d` + #433 `19004e1`; one conflict in `sparse.rs`, doc comments only (#433's text for `readback_after_execute` next to `main`'s new `queue()`), both kept as they were | **Retail title, 300 s per run.** Same machine, same warm caches, DXC 1.9.2609.5, `scripts/smoke.ps1` (with the crashed-run fix from a local branch, so a crashing run still gets a block). Scripted input `XCL_PRESS_A_AT=15,21,…,585` (every 6 s), `XCL_THREAD_DUMP_AT` for thread dumps, XCL frames resolved against each build's PDB. | Build | End | Skipped (draws / dispatches) | Sparse readback timeouts | Peak commit | |---|---|---|---|---| | baseline | abort at `+0x23cf683`, 95.7 s | 0 / 0 | 0 | 34,288 MB | | this PR, run 1 | crash at 32.2 s in `tiling::Chain::detile_level` (see below) | 0 / 0 | 0 | 18,542 MB | | this PR, run 2 | abort, write to 0 at `+0x2215c35`, 107.8 s | 1,320 / 5,310 | 4 (88–103 s) | 36,401 MB | | this PR + #433, run 2 | abort at `+0x23cf683`, 118.8 s | 1,786 / 8,952 | 5 (93–113 s) | 32,097 MB | - **Baseline:** #899's log has 11 *graphics* waits of 1.0–2.6 s back to back on one title thread from 72 s to 95.5 s, each "waited for a worker". The dumps at 75 s and 90 s show that thread in `bind::execute_indirect` (bind.rs:238) → `pso_async::resolve_wait`. Only 1 of 31 `xcl-pso-*` workers was in the driver: the title binds one new graphics pipeline after another and waits for each. - **This PR, run 2:** those waits are gone. The title thread that stalls is now in `real::res_map` → `sparse::readback_now` → `State::readback_ranges` → `State::wait_for` (sparse.rs:776). Its fence stays 2 short (`has not reached fence value 38430 after 5 s (at 38428)`), 4 times in a row, until the abort. - **This PR + #433, run 2:** the same, 5 times (`39956 … (at 39951)`). The dumps at 90 s and 105 s also show the title's submitting thread in `q_execute_command_lists` → `sparse::before_execute` / `sparse::queue()` → `Mutex::lock_contended`. `readback_now` takes `STATE` and keeps it through `readback_ranges` and both of its `wait_for` calls. So while `Map` waits for the GPU, the title cannot submit, and the work the fence is waiting for may be in that submit. #433 covers the copy back after `ExecuteCommandLists`, not this `Map` path. **Two crashes that are probably not this PR:** - Run 1 at 32.2 s: three `title_textures::subresources_on` workers crashed together in `VCRUNTIME140.dll+0x1bb86` from `tiling::Chain::detile_level` (tiling.rs:438), reading unmapped title memory. Nothing had been skipped yet, and it did not come back in the other 13 runs of the title on this machine. #751 changes title texture reads in this area. - The first run of this PR + #433 ended at 60.06 s in `ntdll.dll` (read at `0x2b`), 57 ms after a scheduled `XCL_THREAD_DUMP_AT=60` dump. With the first dump at 75 s, the rerun went on to the abort above. An earlier comment on #505 reports `eh::dump_threads` faulting in `ntdll` on live stacks. I did not see the `0xffffffffffffffff` read others reported with skipped dispatches. **Tested** - NVIDIA GeForce RTX 3090 Ti (driver 32.0.16.2101, 32-lane waves), Intel i9-13900K, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0 MSVC. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` (debug): - this PR on `main` (`16ebe79`): 721 passed, 0 failed, 41 ignored - this PR + #433 (`4dc8428`): 723 passed, 0 failed, 41 ignored - SKIPPED in both: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64) - Title runs: release builds, one run per row above (two of this PR). **Not tested:** AMD / Intel; more than one or two runs per build; whether skipped work shows up as wrong rendering (the title never left its loading screen in these runs); #533 with #267 or #891. Test runs, log and dump analysis and this comment by Claude Code (Claude Opus 5.5); I checked the logs it is based on.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-24 10:42 UTC · original

Closing as superseded by #891, which has already been merged into main.

**@⁠raylitebull** on GitHub · 2026-11-24 10:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7129145140) Closing as superseded by #891, which has already been merged into `main`.
Author
Owner

@⁠T0ns1 on GitHub · 2026-11-24 12:07 UTC · original

On a 32-lane NVIDIA GPU, the skipped compute work this PR falls back to hung the GPU; with skipping off there was no GPU hang, only the title's watchdog. Three runs of the retail title (1.0.2.1) into world loading, same build, differing only in XCL_COMPUTE_PSO_WAIT_MS.

Setup: RTX 5070 Ti 16 GB (driver 32.0.16.2101), Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 MSVC, DXC 1.9.2609. Release build of main 077ce40 + #905 + #889 + this PR (cherry-picked; the one conflict, in submit_as, resolved by keeping enqueue(&p) and #889's || compute), plus two local list-slot changes unrelated to pipelines. XCL_NETWORK=0 XCL_ACTIVITY=1, menus walked with XCL_PRESS_A_AT. About 225 compute pipelines were in the driver cache from a partial xcl shaders --precompile --pipelines.

XCL_COMPUTE_PSO_WAIT_MS skipped dispatches / ExecuteIndirect still building after would close a GPU cycle queue.Wait … did not complete within 5000 ms end
4000 (default) yes, from ~100 s 16 2 4 (~141 s) TDR (below)
20000 yes, from ~94 s 3 (one after 11 441 ms) 2 11 (from ~106 s) stopped by hand at ~112 s, before a TDR
0 0 0 0 0 the title's watchdog, +0x23cf683 at 112.6 s
  • 4000: once the first stand-ins were used, the title went on submitting (thousands of dispatches per 2 s until ~138 s) – it got past the stop that main hits. Then GPU waits stopped completing; Wait64BitValueX timed out twice and queue.Wait … did not complete within 5000 ms 4 times. The NVIDIA driver logged six TDRs (System log, nvlddmkm event 153, the screen went black for a moment). The run ended with a command list's Close → 0x8007000e and then 0x80000003 in the title at +0x72ac (rax = 0x8007000e), presumably the device lost after the TDRs (not confirmed).
  • 20000: the per-frame budget still runs out: single compute pipelines took 11 s and more to build, and once a frame's budget is spent its later binds are skipped too. Same pattern of unsatisfied GPU waits ~12 s after the first skip.
  • 0: nothing skipped, no GPU wait timeout, no TDR. The title submitted until ~84 s (6 097 dispatches in that interval), then waited on pipelines with almost no submits, and its watchdog fired ~28 s later – the stop described in #505.

So on this machine the skip path trades the watchdog for a GPU hang: a skipped dispatch or ExecuteIndirect appears to leave GPU-side waits that depend on its results unsatisfied. With 0, the only remaining problem was how long the builds take. That suggests a default that does not skip (or skips only work no GPU wait depends on), with the build time itself addressed by building compute pipelines ahead (#889) and a warm driver cache. Note that main now has XCL_PSO_WAIT_MS (5fab112, 8cada26), unset meaning "wait until built", which overlaps with this PR's budget; this PR no longer applies cleanly on main.

Together with #889, one of this PR's tests fails: bounded_compute_wait_returns_real_when_build_finishes_in_time requires the build to run on an xcl-pso-compute-* thread, but #889 queues every compute pipeline for the preload workers when it is made, and an xcl-pso-pre-* thread can take the job first (got "xcl-pso-pre-1"). Accepting both prefixes keeps what the test guards (the binding thread does not build):

assert!(
    worker_name.starts_with("xcl-pso-compute-") || worker_name.starts_with("xcl-pso-pre-"),
    "compute pipelines must be built off the binding thread, got {worker_name:?}"
);

Before that change, cargo test --release --workspace --no-fail-fast -- --test-threads=4 on this build gave 725 passed, 5 failed, 41 ignored: this test, plus 4 GPU tests (title_textures / vram / readback_routing) that pass with --test-threads=1. With it, cargo test --release -p xcl --lib -- pso_async: 8 passed, 0 failed, in four runs. On the same changes rebased onto main 47efa2e (XCL_PSO_WAIT_MS conflict resolved by keeping both), the full suite: 749 passed, 0 failed, 41 ignored.

No game data, logs only. AI use: Claude Code (Claude Opus 5.5) merged the PRs, ran the builds and the three runs.

**@⁠T0ns1** on GitHub · 2026-11-24 12:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/533#issuecomment-7131000595) **On a 32-lane NVIDIA GPU, the skipped compute work this PR falls back to hung the GPU; with skipping off there was no GPU hang, only the title's watchdog.** Three runs of the retail title (1.0.2.1) into world loading, same build, differing only in `XCL_COMPUTE_PSO_WAIT_MS`. **Setup:** RTX 5070 Ti 16 GB (driver 32.0.16.2101), Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 MSVC, DXC 1.9.2609. Release build of `main` 077ce40 + #905 + #889 + this PR (cherry-picked; the one conflict, in `submit_as`, resolved by keeping `enqueue(&p)` and #889's `|| compute`), plus two local list-slot changes unrelated to pipelines. `XCL_NETWORK=0 XCL_ACTIVITY=1`, menus walked with `XCL_PRESS_A_AT`. About 225 compute pipelines were in the driver cache from a partial `xcl shaders --precompile --pipelines`. | `XCL_COMPUTE_PSO_WAIT_MS` | skipped dispatches / ExecuteIndirect | `still building after` | `would close a GPU cycle` | `queue.Wait … did not complete within 5000 ms` | end | |---|---|---|---|---|---| | 4000 (default) | yes, from ~100 s | 16 | 2 | 4 (~141 s) | TDR (below) | | 20000 | yes, from ~94 s | 3 (one after 11 441 ms) | 2 | 11 (from ~106 s) | stopped by hand at ~112 s, before a TDR | | 0 | **0** | 0 | 0 | **0** | the title's watchdog, `+0x23cf683` at 112.6 s | - **4000:** once the first stand-ins were used, the title went on submitting (thousands of dispatches per 2 s until ~138 s) – it got past the stop that `main` hits. Then GPU waits stopped completing; `Wait64BitValueX timed out` twice and `queue.Wait … did not complete within 5000 ms` 4 times. The NVIDIA driver logged six TDRs (System log, `nvlddmkm` event 153, the screen went black for a moment). The run ended with a command list's `Close → 0x8007000e` and then `0x80000003` in the title at `+0x72ac` (rax = 0x8007000e), presumably the device lost after the TDRs (not confirmed). - **20000:** the per-frame budget still runs out: single compute pipelines took 11 s and more to build, and once a frame's budget is spent its later binds are skipped too. Same pattern of unsatisfied GPU waits ~12 s after the first skip. - **0:** nothing skipped, no GPU wait timeout, no TDR. The title submitted until ~84 s (6 097 dispatches in that interval), then waited on pipelines with almost no submits, and its watchdog fired ~28 s later – the stop described in #505. So on this machine the skip path trades the watchdog for a GPU hang: a skipped dispatch or ExecuteIndirect appears to leave GPU-side waits that depend on its results unsatisfied. With 0, the only remaining problem was how long the builds take. That suggests a default that does not skip (or skips only work no GPU wait depends on), with the build time itself addressed by building compute pipelines ahead (#889) and a warm driver cache. Note that `main` now has `XCL_PSO_WAIT_MS` (5fab112, 8cada26), unset meaning "wait until built", which overlaps with this PR's budget; this PR no longer applies cleanly on `main`. **Together with #889, one of this PR's tests fails:** `bounded_compute_wait_returns_real_when_build_finishes_in_time` requires the build to run on an `xcl-pso-compute-*` thread, but #889 queues every compute pipeline for the preload workers when it is made, and an `xcl-pso-pre-*` thread can take the job first (`got "xcl-pso-pre-1"`). Accepting both prefixes keeps what the test guards (the binding thread does not build): ```rust assert!( worker_name.starts_with("xcl-pso-compute-") || worker_name.starts_with("xcl-pso-pre-"), "compute pipelines must be built off the binding thread, got {worker_name:?}" ); ``` Before that change, `cargo test --release --workspace --no-fail-fast -- --test-threads=4` on this build gave 725 passed, 5 failed, 41 ignored: this test, plus 4 GPU tests (title_textures / vram / readback_routing) that pass with `--test-threads=1`. With it, `cargo test --release -p xcl --lib -- pso_async`: 8 passed, 0 failed, in four runs. On the same changes rebased onto `main` 47efa2e (`XCL_PSO_WAIT_MS` conflict resolved by keeping both), the full suite: 749 passed, 0 failed, 41 ignored. No game data, logs only. AI use: Claude Code (Claude Opus 5.5) merged the PRs, ran the builds and the three runs.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.