D3D12.X: a slow graphics pipeline waits at most 4 s once per build (#232) #267

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

@⁠heretic1321 on GitHub · 2026-11-23 22:08 UTC · original
heretic1321:fix/retail-null-write-232 → main · +310 −6 · 3 files · 1 commits · closed without merging

Part of #232. Rebased cleanly onto upstream/main (6bac4b4, head ef98154), integrating #574 and #690 and addressing @Kalmarv's and @qinrxx's review findings.

Root cause & change

  • On main, graphics pipelines created lazily are sent to xcl-pso workers at SetPipelineState, and bind::graphics_bound / execute_indirect then call pso_async::resolve_wait, holding the title's recording thread without limit (and compiling on the title thread itself if no worker has taken the job yet). On NVIDIA GPUs where big translated shaders can take > 10 s, that stalls watched threads long enough to trip the title's watchdog (title+0x2215c35, *(int *)0 = 0, #232).
  • What is in it:
    • crates/xcl/src/hle/d3d12x/pso_async.rs:
      • resolve_for_draw / resolve_within with XCL_PSO_WAIT_MS (parse_wait_limit, default 4000 ms as a safety margin under #156's 23 s one-call watchdog trigger; 0 = unbounded).
      • Per-pipeline timeout latch (Pending::late): once one draw times out waiting for a graphics pipeline still building on a worker, p.late is set so subsequent draws of that pipeline while it is still building return the stand-in immediately (incrementing STANDIN_DRAWS) instead of holding a thread for N * limit.
      • p.note_use() is called in resolve_within so #690 tracks used graphics pipelines, and resolve_wait logs waits >= 2 s.
      • Updated draw_wait_tests (a_graphics_pipeline_waits_at_most_once_up_to_the_limit_and_never_builds_on_the_title_thread, compute_pipelines_and_no_limit_wait_as_before, wait_limit_parses_env_values).
    • crates/xcl/src/hle/d3d12x/bind.rs:
      • Routes execute_indirect and graphics_bound through pso_async::resolve_for_draw (keeping #574's is_pending skip in execute_indirect and rs_gfx root-signature binding for failed/PC pipelines, and using pso_async::resolve inside trace_frame).
      • Keeps execute_indirect_with_a_stand_in_binds_the_titles_root_signature_first and adds execute_indirect_skips_when_a_still_building_graphics_pipeline_times_out covering a timed-out pending graphics stand-in.
    • crates/xcl/src/hle/d3d12x/real.rs:
      • Adds standin_draws: usize to D3d12Stats (report.json → d3d12.standin_draws).

Overlaps

  • #891 (Sr-0w) implements opt-in XCL_PSO_WAIT_MS across both compute and graphics binds via Pending::late, and #533 (XaviFortes) bounds compute waits. @imnicho's RTX 5080 retail run on 043d1f7 showed compute pipeline binds can also trip #232's watchdog when graphics waits stay under 4 s. Keeping this PR cleanly rebased and review-complete for the graphics-only path (where draws are safe to drop without corrupting compute state) unless maintainers prefer #891/#533.

Tested

  • Linux host (no Windows, no GPU), Rust 1.95.0, head ef98154 on upstream/main 6bac4b4:
    • AR_x86_64_pc_windows_msvc=llvm-ar cargo check --release --workspace --target x86_64-pc-windows-msvc — exit 0 (15.16s, 0 errors, 0 warnings).
    • AR_x86_64_pc_windows_msvc=llvm-ar cargo check --tests --workspace --target x86_64-pc-windows-msvc — exit 0 (17.72s, 0 errors, 0 warnings).
    • python3 scripts/pr_check.py --local verified all required sections and asset/model checks (failing only on the missing Windows xcl-smoke blocks for ef98154).
  • Earlier community runs (on older commits b5c9057 / 043d1f7, NOT covering ef98154):
    • @qinrxx tested 043d1f7 merged onto 2997c9a on RTX 5080 (d3d12x:: 90/0/1; scripts/smoke.ps1 -Seconds 300: 5116 vs 5099 frames, 14991 vs 15011 MB; menus/pre-world only, 0 standin_draws).
    • @Chrysana tested 043d1f7 on RX 9070 XT (cargo test --workspace: 655/0/40, plus 60 s smoke.ps1 merged onto 9ce2070: 1526 vs 1536 frames).
    • @imnicho tested 043d1f7 merged onto 508a0c7 on RTX 5080 (standin_draws: 0 at 190 s watchdog; 4 title threads waiting in resolve_wait for compute).
    • @woreksami tested 043d1f7 on RTX 3060 (together with #214, plus conflict resolution onto 6025201).
    • @Kalmarv reviewed b5c9057 and 043d1f7 on RTX 5070 Ti and WARP.

Regression run

  • Missing for head ef98154 (no Windows GPU host here; earlier 043d1f7 smoke blocks from @qinrxx and @Chrysana do not cover ef98154).

Not tested

  • Windows MSVC link, cargo test --workspace execution, GPU tests, and scripts/smoke.ps1 / retail title runs on ef98154.

AI use

  • Antigravity with Claude Opus 5.5: wrote the original change, initial tests, and root-cause notes.
  • T3 Code / Antigravity, Orchestrator (Neon) / gemini-pro-orchestrator-neon: rebased onto upstream/main (6bac4b4), added the Pending::late per-pipeline latch, execute_indirect timeout test, parse_wait_limit test, p.note_use() call in resolve_within, and ran Linux-to-x86_64-pc-windows-msvc cargo check and scripts/pr_check.py --local.
**@⁠heretic1321** on GitHub · 2026-11-23 22:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/267) `heretic1321:fix/retail-null-write-232` → `main` · +310 −6 · 3 files · 1 commits · closed without merging Part of #232. Rebased cleanly onto `upstream/main` (`6bac4b4`, head `ef98154`), integrating `#574` and `#690` and addressing `@Kalmarv`'s and `@qinrxx`'s review findings. **Root cause & change** - On `main`, graphics pipelines created lazily are sent to `xcl-pso` workers at `SetPipelineState`, and `bind::graphics_bound` / `execute_indirect` then call `pso_async::resolve_wait`, holding the title's recording thread without limit (and compiling on the title thread itself if no worker has taken the job yet). On NVIDIA GPUs where big translated shaders can take > 10 s, that stalls watched threads long enough to trip the title's watchdog (`title+0x2215c35`, `*(int *)0 = 0`, #232). - **What is in it:** - `crates/xcl/src/hle/d3d12x/pso_async.rs`: - `resolve_for_draw` / `resolve_within` with `XCL_PSO_WAIT_MS` (`parse_wait_limit`, default `4000` ms as a safety margin under #156's 23 s one-call watchdog trigger; `0` = unbounded). - **Per-pipeline timeout latch (`Pending::late`)**: once one draw times out waiting for a graphics pipeline still building on a worker, `p.late` is set so subsequent draws of that pipeline while it is still building return the stand-in immediately (incrementing `STANDIN_DRAWS`) instead of holding a thread for `N * limit`. - `p.note_use()` is called in `resolve_within` so `#690` tracks used graphics pipelines, and `resolve_wait` logs waits `>= 2 s`. - Updated `draw_wait_tests` (`a_graphics_pipeline_waits_at_most_once_up_to_the_limit_and_never_builds_on_the_title_thread`, `compute_pipelines_and_no_limit_wait_as_before`, `wait_limit_parses_env_values`). - `crates/xcl/src/hle/d3d12x/bind.rs`: - Routes `execute_indirect` and `graphics_bound` through `pso_async::resolve_for_draw` (keeping `#574`'s `is_pending` skip in `execute_indirect` and `rs_gfx` root-signature binding for failed/PC pipelines, and using `pso_async::resolve` inside `trace_frame`). - Keeps `execute_indirect_with_a_stand_in_binds_the_titles_root_signature_first` and adds `execute_indirect_skips_when_a_still_building_graphics_pipeline_times_out` covering a timed-out pending graphics stand-in. - `crates/xcl/src/hle/d3d12x/real.rs`: - Adds `standin_draws: usize` to `D3d12Stats` (`report.json → d3d12.standin_draws`). **Overlaps** - `#891` (`Sr-0w`) implements opt-in `XCL_PSO_WAIT_MS` across both compute and graphics binds via `Pending::late`, and `#533` (`XaviFortes`) bounds compute waits. `@imnicho`'s RTX 5080 retail run on `043d1f7` showed compute pipeline binds can also trip `#232`'s watchdog when graphics waits stay under 4 s. Keeping this PR cleanly rebased and review-complete for the graphics-only path (where draws are safe to drop without corrupting compute state) unless maintainers prefer `#891`/`#533`. **Tested** - Linux host (no Windows, no GPU), Rust `1.95.0`, head `ef98154` on `upstream/main` `6bac4b4`: - `AR_x86_64_pc_windows_msvc=llvm-ar cargo check --release --workspace --target x86_64-pc-windows-msvc` — exit 0 (`15.16s`, 0 errors, 0 warnings). - `AR_x86_64_pc_windows_msvc=llvm-ar cargo check --tests --workspace --target x86_64-pc-windows-msvc` — exit 0 (`17.72s`, 0 errors, 0 warnings). - `python3 scripts/pr_check.py --local` verified all required sections and asset/model checks (failing only on the missing Windows `xcl-smoke` blocks for `ef98154`). - Earlier community runs (on older commits `b5c9057` / `043d1f7`, NOT covering `ef98154`): - `@qinrxx` tested `043d1f7` merged onto `2997c9a` on RTX 5080 (`d3d12x::` 90/0/1; `scripts/smoke.ps1 -Seconds 300`: 5116 vs 5099 frames, 14991 vs 15011 MB; menus/pre-world only, 0 `standin_draws`). - `@Chrysana` tested `043d1f7` on RX 9070 XT (`cargo test --workspace`: 655/0/40, plus 60 s `smoke.ps1` merged onto `9ce2070`: 1526 vs 1536 frames). - `@imnicho` tested `043d1f7` merged onto `508a0c7` on RTX 5080 (`standin_draws: 0` at 190 s watchdog; 4 title threads waiting in `resolve_wait` for compute). - `@woreksami` tested `043d1f7` on RTX 3060 (together with `#214`, plus conflict resolution onto `6025201`). - `@Kalmarv` reviewed `b5c9057` and `043d1f7` on RTX 5070 Ti and WARP. **Regression run** - Missing for head `ef98154` (no Windows GPU host here; earlier `043d1f7` smoke blocks from `@qinrxx` and `@Chrysana` do not cover `ef98154`). **Not tested** - Windows MSVC link, `cargo test --workspace` execution, GPU tests, and `scripts/smoke.ps1` / retail title runs on `ef98154`. **AI use** - `Antigravity with Claude Opus 5.5`: wrote the original change, initial tests, and root-cause notes. - `T3 Code / Antigravity, Orchestrator (Neon) / gemini-pro-orchestrator-neon`: rebased onto `upstream/main` (`6bac4b4`), added the `Pending::late` per-pipeline latch, `execute_indirect` timeout test, `parse_wait_limit` test, `p.note_use()` call in `resolve_within`, and ran Linux-to-`x86_64-pc-windows-msvc` `cargo check` and `scripts/pr_check.py --local`.
Part of #232. Bounds graphics pipeline waits at draws/ExecuteIndirect to XCL_PSO_WAIT_MS (default 4000 ms, 0 = no limit) and runs builds on workers rather than the title thread. Latches each timed-out pipeline as late so later draws while it is still building return the stand-in immediately instead of waiting N * limit, counts skipped draws in report.json (d3d12.standin_draws), composes with #574's pending ExecuteIndirect skip, and adds unit tests for the per-pipeline latch, timed-out ExecuteIndirect, and env parsing.

Assisted-by: Antigravity (Claude Opus 5.5) and T3 Code / Antigravity (gemini-pro-orchestrator-neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:18:06 +00:00
github-bot closed this pull request 2026-11-26 04:18:06 +00:00
Author
Owner

@⁠vladbondarenko97 on GitHub · 2026-11-23 22:57 UTC · original

Tested on an NVIDIA RTX 3080 Ti (Windows 11 10.0.26300, driver 32.0.16.2124, DXC 1.9.2602.17, package 1.0.2.1 verified by hash). Built this branch on top of 9ab7d76 (merge clean, -X theirs; both commits applied) and ran with XCL_NETWORK=0, XCL_ACTIVITY=1, lazy pipelines (default), frame dumps on.

Result: the run still dies at the early assert before any frame — this PR does not change it here.

  • report.json: presents: 0, frame_boundaries: 0, shaders.unique: 0, translated_pipelines: 0, failed_pipelines: 0, called_stubs: []
  • Crash: unhandled exception 0x80000003 in game_scarlett_master.exe+0x2237178, rax=0 rbx=0 rcx=0 rdx=0x66 r8=0x7efefefefefefeff r9=0x7f656f712d2f6073, vtable game+0x677c997; stack +0x677c997, +0x579105c, +0x700b71d, +0x53ec0f0, +0x4fac3d7
  • Same signature as plain 9ab7d76 and 60565c4 on this card, and the same first-chance exception under an unrelated clean-room layer (already reported in #301). So on this host the failure predates any pipeline build this PR could wait on.

Two data points that may matter for the hypothesis:

  • With all 17 package DLLs present the crash moved from 5.8 s to 15.6 s but stayed the same assert — so it tracks some init-phase progress, not draw time.
  • An RTX 3060 reportedly completes the whole first-boot flow with #203 + #187 (comment in #203); that combination is what I'm testing next on the same machine. If that changes the outcome, the trigger is in the init/memory path rather than in draw-time pipeline waits.

Happy to run any revision of this PR on the 3080 Ti and return reports/traces. AI-assisted (Claude Code CLI via a model proxy).

**@⁠vladbondarenko97** on GitHub · 2026-11-23 22:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/267#issuecomment-7116384190) Tested on an NVIDIA RTX 3080 Ti (Windows 11 10.0.26300, driver 32.0.16.2124, DXC 1.9.2602.17, package 1.0.2.1 verified by hash). Built this branch on top of `9ab7d76` (merge clean, `-X theirs`; both commits applied) and ran with `XCL_NETWORK=0`, `XCL_ACTIVITY=1`, lazy pipelines (default), frame dumps on. **Result: the run still dies at the early assert before any frame — this PR does not change it here.** - `report.json`: `presents: 0`, `frame_boundaries: 0`, `shaders.unique: 0`, `translated_pipelines: 0`, `failed_pipelines: 0`, `called_stubs: []` - Crash: `unhandled exception 0x80000003 in game_scarlett_master.exe+0x2237178`, `rax=0 rbx=0 rcx=0 rdx=0x66 r8=0x7efefefefefefeff r9=0x7f656f712d2f6073`, vtable `game+0x677c997`; stack `+0x677c997, +0x579105c, +0x700b71d, +0x53ec0f0, +0x4fac3d7` - Same signature as plain `9ab7d76` and `60565c4` on this card, and the same first-chance exception under an unrelated clean-room layer (already reported in #301). So on this host the failure predates any pipeline build this PR could wait on. Two data points that may matter for the hypothesis: - With all 17 package DLLs present the crash moved from 5.8 s to 15.6 s but stayed the same assert — so it tracks some init-phase progress, not draw time. - An RTX 3060 reportedly completes the whole first-boot flow with #203 + #187 (comment in #203); that combination is what I'm testing next on the same machine. If that changes the outcome, the trigger is in the init/memory path rather than in draw-time pipeline waits. Happy to run any revision of this PR on the 3080 Ti and return reports/traces. AI-assisted (Claude Code CLI via a model proxy).
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-23 22:40 UTC · original · edited 2026-11-23 23:20 UTC

Review of b5c9057 against main 9ab7d76. The limit does what the description says in a synthetic frame (numbers below). Five things I would change or settle before it goes in.

1. The 4 s default is not tied to a known threshold.

  • The commit message says the watchdog fires after "~30 s per #214". The 30 s I can find in #214 is that PR's own bound on wait_for_commit, not a figure for the watchdog.
  • What is public: one call of more than 23 s set it off (#156). The decode in #232 has it wake once a second and compare registered timestamps against a constant 300.0 behind a random gate. Its author reads that as 300 ms and found every timestamp zero in a healthy run.
  • If 300 ms is right, a 4 s wait is 13 times over and only a limit near zero helps. XCL_PSO_WAIT_MS=1 is the only way to ask for that, because 0 means no limit. If the threshold is tens of seconds, 4 s is under it.
  • So I would add an XCL_PSO_WAIT_MS=1 run to the reporter's steps, and the breakpoint from #232 (which slot is stale says whether a draw wait is what the watchdog saw at all).
  • At 043d1f7 (2026-11-23): addressed as far as it can be without a run. The commit message and the code no longer cite #214; they call 4 s a margin under #156's 23 s, not a measured threshold. The reporter's steps now have the XCL_PSO_WAIT_MS=1 run and the breakpoint.

2. ExecuteIndirect past the limit goes to D3D12 without the title's root signature.

  • execute_indirect returns pc(…) as soon as the pipeline is not a translated one (bind.rs:220). graphics_bound binds rs_gfx first in the same situation (bind.rs:389), with the comment that a draw without a root signature is invalid and faults on WARP. set_graphics_root_signature only records it.
  • On main an indirect draw reaches that branch with a stand-in only when its build failed. With this PR every indirect draw past the limit does.
  • This is from reading. I did not run an indirect draw.
  • At 043d1f7 (2026-11-23): fixed. The branch binds rs_gfx before pc(…). The new execute_indirect_with_a_stand_in_binds_the_titles_root_signature_first passes on Windows, and fails with the binding taken out (only ExecuteIndirect is recorded).

3. Merged with #214 (f007d4a) the tests do not compile.

  • git merges the two without a conflict and the library builds. cargo check --tests fails with E0428: both PRs add a #[cfg(test)] mod tests to pso_async.rs.
  • resolve_within sends the build itself (p.sent.swap + send). #214 moves that into enqueue, which also counts the pipeline in QUEUED. A pipeline first sent by a draw would be missing from the third number of background_pipelines.
  • The description's account of #214 (queued, a send() helper, xcl-pso-urgent in resolve_wait) is of an older head. f007d4a does not change resolve_wait.
  • Order: both merge onto main cleanly today. Whichever lands second needs the two test modules joined and enqueue(p.clone()) in resolve_within. #187 (c74b03a) merges with this PR cleanly too; its one line in bind.rs is elsewhere.
  • At 043d1f7 (2026-11-23), with #214 at 960162e: the clash is gone, the module is now draw_wait_tests. Merged, the lib tests build and the new tests of both PRs pass. The enqueue point stands for the merged tree: resolve_within still does its own sent.swap + send, so a pipeline first sent by a draw is not counted in QUEUED. The description says so and leaves it to whichever lands second.

4. The limit is one budget per present interval for the whole process, not per draw or per thread.

  • A draw reads what is left before it waits and adds what it used afterwards. Draws on several threads that start before the first one returns each get the whole remainder, so a frame can be held for up to twice the limit (from the code, not run).
  • The budget refills only at PresentX. Everything drawn before the first present shares one 4 s. A thread that records while another thread keeps presenting gets a new 4 s after every present, so it can still be held for 4 s per unbuilt pipeline, back to back (also from the code).
  • A build shorter than the limit can still lose, because the second draw of a frame only gets what the first left. In the last row of the table the second pipeline needed 2 s and had 2 s left: it was built in time on the RTX 5070 Ti and drawn with its stand-in in the same run on WARP.
  • At 043d1f7 (2026-11-23): the shared budget is gone, so the three bullets above no longer apply: every draw call now waits up to the limit on its own. That makes the limit per draw call, not per pipeline or per frame. Draws on one unbuilt pipeline wait one after another until it is built, so a frame with a few draws per pipeline is held as long as on main. Same synthetic frame, two 10 s builds, on WARP: with 1 draw per pipeline the draws take 4.01 s and 4.01 s and the frame 8.03 s; with 4 draws per pipeline they take 4.00, 4.01, 1.99, 0.00 s for each pipeline and the frame 20.01 s, which is main's time in the table below. With XCL_PSO_WAIT_MS=1 the same 8 draws take 0.12 s in all. Remembering per pipeline that its wait was used up would keep the hold at one limit per pipeline.

5. A draw past the limit is lost, not delayed.

  • It is issued with the stand-in (title's root signature bound, counted as DRAWS_PC) and draws nothing. Nothing replays it when the pipeline arrives. Later draws use the real pipeline.
  • The description says this. Two things it does not say: report.json cannot tell these draws from draws with PC pipelines (only the log lines can), and a graphics build is no longer taken by the thread that needs it, so it waits its turn behind everything queued at SetPipelineState. With a deep queue, or #214's two driver slots on NVIDIA, the budget buys less than 4 s of progress on the pipeline being drawn.
  • At 043d1f7 (2026-11-23): these draws are now counted on their own (report.json → d3d12.standin_draws) and the log line says the draw is lost. The remark about queue order is unchanged, and the description now states it.

Tested

Synthetic frame, the same test on both trees (bind::tests, local, not in the PR): two graphics pipelines whose builds take a fixed time (the job sleeps, then hands over a pipeline made beforehand) are first drawn in one frame through set_pipeline_state / draw_instanced on a title list of a real D3D12 device. Times are the two draw calls and the whole frame (record, execute, fence).

Tree Builds XCL_PSO_WAIT_MS Draw 1 Draw 2 Frame
main 9ab7d76 10 s – 10.00 s 10.00 s 20.01 s
b5c9057 10 s default 4.01 s 0.00 s 4.01 s
b5c9057 10 s 0 10.00 s 10.00 s 20.00 s
b5c9057 10 s 1000 1.01 s 0.00 s 1.01 s
b5c9057 2 s default 2.00 s 2.00 s 4.00 s
  • The table is from an RTX 5070 Ti (NVIDIA 610.74). The same five runs on WARP gave the same times to 0.01 s; the only difference is the last row (above).
  • In the 10 s rows with a limit, both pipelines were still building when the frame ended and its centre pixel is the clear colour (the stand-ins drew nothing). A second frame after both builds finished draws the real pipeline (red), on both trees and both adapters.
  • The PR's two unit tests on Windows (pso_async::tests, release build of b5c9057): 2 passed, 0 failed.
  • Library suite on the RTX 5070 Ti, 4 threads, each tree with the one local test above added: main 9ab7d76 612 passed, 0 failed, 20 ignored; b5c9057 614 passed, 0 failed, 20 ignored. SKIPPED on this card on both: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64). Lib tests only: the integration tests in crates/xcl/tests were not run.
  • b5c9057 merged with #214 at f007d4a: cargo check --release -p xcl --lib exit 0, --lib --tests exit 101 (E0428, above). In-memory merges of b5c9057 with f007d4a and with #187 at c74b03a: no conflicts.
  • At 043d1f7 (2026-11-23): Windows 11 26200, Ryzen 9 9950X, debug, CPU only. 043d1f7 merged with #214 at 960162e (no conflicts): cargo test -p xcl --lib --no-run builds; draw_wait_tests 2 passed, 0 failed; execute_indirect_with_a_stand_in_binds_the_titles_root_signature_first 1 passed, and 0 passed, 1 failed with the binding removed; #214's dormant_lazy_pipelines_are_not_counted_as_queued 1 passed. The frame times for 043d1f7 under point 4 are from WARP with the same local test, each draw repeated; nothing at this head ran on the RTX 5070 Ti, and the whole suite was not rerun.

Not tested

  • The retail game, on any card. Whether a draw wait is what stalls its frames is still the PR's hypothesis.
  • The watchdog's threshold: I read the public threads only.
  • Translated pipelines: the test's real pipeline is a PC one, so the next frame gets it through SetPipelineState. The rebind in bind_abi after a stand-in draw in the same list is from reading.
  • ExecuteIndirect, mesh and two-pass pipelines, more than one drawing thread.
  • A real slow driver build (the delay is a sleep), a deep worker queue, and this PR together with #214's driver slots.
  • AMD and Intel.

🤖 Claude Fable 5.2

**@⁠Kalmarv** on GitHub · 2026-11-23 22:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/267#issuecomment-7116044083) · edited 2026-11-23 23:20 UTC Review of b5c9057 against main 9ab7d76. The limit does what the description says in a synthetic frame (numbers below). Five things I would change or settle before it goes in. **1. The 4 s default is not tied to a known threshold.** - The commit message says the watchdog fires after "~30 s per #214". The 30 s I can find in #214 is that PR's own bound on `wait_for_commit`, not a figure for the watchdog. - What is public: one call of more than 23 s set it off (#156). The decode in #232 has it wake once a second and compare registered timestamps against a constant `300.0` behind a random gate. Its author reads that as 300 ms and found every timestamp zero in a healthy run. - If 300 ms is right, a 4 s wait is 13 times over and only a limit near zero helps. `XCL_PSO_WAIT_MS=1` is the only way to ask for that, because `0` means no limit. If the threshold is tens of seconds, 4 s is under it. - So I would add an `XCL_PSO_WAIT_MS=1` run to the reporter's steps, and the breakpoint from #232 (which slot is stale says whether a draw wait is what the watchdog saw at all). - **At 043d1f7 (2026-11-23):** addressed as far as it can be without a run. The commit message and the code no longer cite #214; they call 4 s a margin under #156's 23 s, not a measured threshold. The reporter's steps now have the `XCL_PSO_WAIT_MS=1` run and the breakpoint. **2. `ExecuteIndirect` past the limit goes to D3D12 without the title's root signature.** - `execute_indirect` returns `pc(…)` as soon as the pipeline is not a translated one (`bind.rs:220`). `graphics_bound` binds `rs_gfx` first in the same situation (`bind.rs:389`), with the comment that a draw without a root signature is invalid and faults on WARP. `set_graphics_root_signature` only records it. - On main an indirect draw reaches that branch with a stand-in only when its build failed. With this PR every indirect draw past the limit does. - This is from reading. I did not run an indirect draw. - **At 043d1f7 (2026-11-23):** fixed. The branch binds `rs_gfx` before `pc(…)`. The new `execute_indirect_with_a_stand_in_binds_the_titles_root_signature_first` passes on Windows, and fails with the binding taken out (only `ExecuteIndirect` is recorded). **3. Merged with #214 (f007d4a) the tests do not compile.** - git merges the two without a conflict and the library builds. `cargo check --tests` fails with E0428: both PRs add a `#[cfg(test)] mod tests` to `pso_async.rs`. - `resolve_within` sends the build itself (`p.sent.swap` + `send`). #214 moves that into `enqueue`, which also counts the pipeline in `QUEUED`. A pipeline first sent by a draw would be missing from the third number of `background_pipelines`. - The description's account of #214 (`queued`, a `send()` helper, `xcl-pso-urgent` in `resolve_wait`) is of an older head. f007d4a does not change `resolve_wait`. - Order: both merge onto main cleanly today. Whichever lands second needs the two test modules joined and `enqueue(p.clone())` in `resolve_within`. #187 (c74b03a) merges with this PR cleanly too; its one line in `bind.rs` is elsewhere. - **At 043d1f7 (2026-11-23), with #214 at 960162e:** the clash is gone, the module is now `draw_wait_tests`. Merged, the lib tests build and the new tests of both PRs pass. The `enqueue` point stands for the merged tree: `resolve_within` still does its own `sent.swap` + `send`, so a pipeline first sent by a draw is not counted in `QUEUED`. The description says so and leaves it to whichever lands second. **4. The limit is one budget per present interval for the whole process, not per draw or per thread.** - A draw reads what is left before it waits and adds what it used afterwards. Draws on several threads that start before the first one returns each get the whole remainder, so a frame can be held for up to twice the limit (from the code, not run). - The budget refills only at `PresentX`. Everything drawn before the first present shares one 4 s. A thread that records while another thread keeps presenting gets a new 4 s after every present, so it can still be held for 4 s per unbuilt pipeline, back to back (also from the code). - A build shorter than the limit can still lose, because the second draw of a frame only gets what the first left. In the last row of the table the second pipeline needed 2 s and had 2 s left: it was built in time on the RTX 5070 Ti and drawn with its stand-in in the same run on WARP. - **At 043d1f7 (2026-11-23):** the shared budget is gone, so the three bullets above no longer apply: every draw call now waits up to the limit on its own. That makes the limit per draw call, not per pipeline or per frame. Draws on one unbuilt pipeline wait one after another until it is built, so a frame with a few draws per pipeline is held as long as on main. Same synthetic frame, two 10 s builds, on WARP: with 1 draw per pipeline the draws take 4.01 s and 4.01 s and the frame 8.03 s; with 4 draws per pipeline they take 4.00, 4.01, 1.99, 0.00 s for each pipeline and the frame 20.01 s, which is main's time in the table below. With `XCL_PSO_WAIT_MS=1` the same 8 draws take 0.12 s in all. Remembering per pipeline that its wait was used up would keep the hold at one limit per pipeline. **5. A draw past the limit is lost, not delayed.** - It is issued with the stand-in (title's root signature bound, counted as `DRAWS_PC`) and draws nothing. Nothing replays it when the pipeline arrives. Later draws use the real pipeline. - The description says this. Two things it does not say: `report.json` cannot tell these draws from draws with PC pipelines (only the log lines can), and a graphics build is no longer taken by the thread that needs it, so it waits its turn behind everything queued at `SetPipelineState`. With a deep queue, or #214's two driver slots on NVIDIA, the budget buys less than 4 s of progress on the pipeline being drawn. - **At 043d1f7 (2026-11-23):** these draws are now counted on their own (`report.json → d3d12.standin_draws`) and the log line says the draw is lost. The remark about queue order is unchanged, and the description now states it. **Tested** Synthetic frame, the same test on both trees (`bind::tests`, local, not in the PR): two graphics pipelines whose builds take a fixed time (the job sleeps, then hands over a pipeline made beforehand) are first drawn in one frame through `set_pipeline_state` / `draw_instanced` on a title list of a real D3D12 device. Times are the two draw calls and the whole frame (record, execute, fence). | Tree | Builds | `XCL_PSO_WAIT_MS` | Draw 1 | Draw 2 | Frame | |---|---|---|---|---|---| | main 9ab7d76 | 10 s | – | 10.00 s | 10.00 s | 20.01 s | | b5c9057 | 10 s | default | 4.01 s | 0.00 s | 4.01 s | | b5c9057 | 10 s | 0 | 10.00 s | 10.00 s | 20.00 s | | b5c9057 | 10 s | 1000 | 1.01 s | 0.00 s | 1.01 s | | b5c9057 | 2 s | default | 2.00 s | 2.00 s | 4.00 s | - The table is from an RTX 5070 Ti (NVIDIA 610.74). The same five runs on WARP gave the same times to 0.01 s; the only difference is the last row (above). - In the 10 s rows with a limit, both pipelines were still building when the frame ended and its centre pixel is the clear colour (the stand-ins drew nothing). A second frame after both builds finished draws the real pipeline (red), on both trees and both adapters. - The PR's two unit tests on Windows (`pso_async::tests`, release build of b5c9057): 2 passed, 0 failed. - Library suite on the RTX 5070 Ti, 4 threads, each tree with the one local test above added: main 9ab7d76 612 passed, 0 failed, 20 ignored; b5c9057 614 passed, 0 failed, 20 ignored. SKIPPED on this card on both: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64). Lib tests only: the integration tests in `crates/xcl/tests` were not run. - b5c9057 merged with #214 at f007d4a: `cargo check --release -p xcl --lib` exit 0, `--lib --tests` exit 101 (E0428, above). In-memory merges of b5c9057 with f007d4a and with #187 at c74b03a: no conflicts. - **At 043d1f7 (2026-11-23):** Windows 11 26200, Ryzen 9 9950X, debug, CPU only. 043d1f7 merged with #214 at 960162e (no conflicts): `cargo test -p xcl --lib --no-run` builds; `draw_wait_tests` 2 passed, 0 failed; `execute_indirect_with_a_stand_in_binds_the_titles_root_signature_first` 1 passed, and 0 passed, 1 failed with the binding removed; #214's `dormant_lazy_pipelines_are_not_counted_as_queued` 1 passed. The frame times for 043d1f7 under point 4 are from WARP with the same local test, each draw repeated; nothing at this head ran on the RTX 5070 Ti, and the whole suite was not rerun. **Not tested** - The retail game, on any card. Whether a draw wait is what stalls its frames is still the PR's hypothesis. - The watchdog's threshold: I read the public threads only. - Translated pipelines: the test's real pipeline is a PC one, so the next frame gets it through `SetPipelineState`. The rebind in `bind_abi` after a stand-in draw in the same list is from reading. - `ExecuteIndirect`, mesh and two-pass pipelines, more than one drawing thread. - A real slow driver build (the delay is a sleep), a deep worker queue, and this PR together with #214's driver slots. - AMD and Intel. 🤖 Claude Fable 5.2
Author
Owner

@⁠heretic1321 on GitHub · 2026-11-23 23:58 UTC · original

All five review points are addressed at 043d1f7, and the PR is now ready for review.

  • ExecuteIndirect: binds the title's graphics root signature before any stand-in indirect draw (also covers a failed build and a plain PC pipeline), with a regression test that fails without it.
  • The wait budget is per draw, not a shared per-present remainder. Trade-off documented: N slow pipelines on one thread cost N × limit; XCL_PSO_WAIT_MS=1 collapses it.
  • The 4 s default is now described as a safety margin, not a measured threshold, with the decode's unit ambiguity (300 ms vs 300 s) spelled out and XCL_PSO_WAIT_MS=1 added to the reporter steps.
  • Test module renamed to draw_wait_tests; a real merged-tree build with #214 at f007d4a passes cargo check --release -p xcl --lib --tests, so the collision is gone. If #214 lands first, resolve_within should call enqueue(p.clone()).
  • Skipped stand-in draws are now counted in report.json → d3d12.standin_draws instead of being log-only.

What is still missing to merge: the two xcl-smoke blocks from scripts/smoke.ps1 (one from main, one from 043d1f7) — I don't have a Windows host. The 4090 and 5070 Ti runs earlier were build/suite and synthetic only.

@⁠Kalmarv @⁠vladbondarenko97 @⁠yous0serious — would one of you run the smoke pair on 043d1f7 against plain main with the same package and the same duration, and paste both blocks under Regression run? Note this branch is intended to be measured together with #214, so if the smoke shows the crash it can help to also run once with XCL_PSO_WAIT_MS=1.

**@⁠heretic1321** on GitHub · 2026-11-23 23:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/267#issuecomment-7117560963) All five review points are addressed at `043d1f7`, and the PR is now ready for review. - `ExecuteIndirect`: binds the title's graphics root signature before any stand-in indirect draw (also covers a failed build and a plain PC pipeline), with a regression test that fails without it. - The wait budget is per draw, not a shared per-present remainder. Trade-off documented: N slow pipelines on one thread cost N × limit; `XCL_PSO_WAIT_MS=1` collapses it. - The 4 s default is now described as a safety margin, not a measured threshold, with the decode's unit ambiguity (300 ms vs 300 s) spelled out and `XCL_PSO_WAIT_MS=1` added to the reporter steps. - Test module renamed to `draw_wait_tests`; a real merged-tree build with #214 at `f007d4a` passes `cargo check --release -p xcl --lib --tests`, so the collision is gone. If #214 lands first, `resolve_within` should call `enqueue(p.clone())`. - Skipped stand-in draws are now counted in `report.json → d3d12.standin_draws` instead of being log-only. **What is still missing to merge:** the two `xcl-smoke` blocks from `scripts/smoke.ps1` (one from `main`, one from `043d1f7`) — I don't have a Windows host. The 4090 and 5070 Ti runs earlier were build/suite and synthetic only. @⁠Kalmarv @⁠vladbondarenko97 @⁠yous0serious — would one of you run the smoke pair on `043d1f7` against plain `main` with the same package and the same duration, and paste both blocks under Regression run? Note this branch is intended to be measured together with #214, so if the smoke shows the crash it can help to also run once with `XCL_PSO_WAIT_MS=1`.
Author
Owner

@⁠woreksami on GitHub · 2026-11-24 01:39 UTC · original

Test report on NVIDIA, together with #214 (the stall it times out needs #214 to drain at all on this card).

Tested

  • Same machine as my #214 report: RTX 3060 8 GB, driver 610.88, i9-14900K, 32 GB, Windows 11 (26200), release build, XCL_NETWORK=0, the newer retail title from the README.
  • main a6f5f7a + #214 (960162e) + this PR (043d1f7), default limit (4 s): 24 draws hit the limit (not built after 4.0 s), and the title still reached #232's watchdog at ~303 s.
  • Same tree with XCL_PSO_WAIT_MS=150 and XCL_DXC_THREADS=4: no watchdog in ~370 s; the run was ended by my RAM watcher, not by XCL. 0 draws hit the 150 ms limit in that run, so I can't tell whether the shorter limit or the fewer compile threads kept the watchdog away: two things changed at once.
  • cargo test --release -p xcl --lib on the merged tree: 642 passed, 0 failed, 21 ignored.

Not tested

  • 150 ms without the thread cap, and the thread cap without this PR; the workspace suite; scripts/smoke.ps1; AMD.

AI use

  • Claude Code with Claude Opus 5.5: built the branch, ran the title, read the logs and wrote this report from those runs.
**@⁠woreksami** on GitHub · 2026-11-24 01:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/267#issuecomment-7119311828) Test report on NVIDIA, together with #214 (the stall it times out needs #214 to drain at all on this card). **Tested** - Same machine as my #214 report: RTX 3060 8 GB, driver 610.88, i9-14900K, 32 GB, Windows 11 (26200), release build, `XCL_NETWORK=0`, the newer retail title from the README. - `main` a6f5f7a + #214 (960162e) + this PR (043d1f7), default limit (4 s): 24 draws hit the limit (`not built after 4.0 s`), and the title still reached #232's watchdog at ~303 s. - Same tree with `XCL_PSO_WAIT_MS=150` and `XCL_DXC_THREADS=4`: no watchdog in ~370 s; the run was ended by my RAM watcher, not by XCL. 0 draws hit the 150 ms limit in that run, so I can't tell whether the shorter limit or the fewer compile threads kept the watchdog away: two things changed at once. - `cargo test --release -p xcl --lib` on the merged tree: 642 passed, 0 failed, 21 ignored. **Not tested** - 150 ms without the thread cap, and the thread cap without this PR; the workspace suite; `scripts/smoke.ps1`; AMD. **AI use** - Claude Code with Claude Opus 5.5: built the branch, ran the title, read the logs and wrote this report from those runs.
Author
Owner

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

@⁠heretic1321 we have a Windows host with an RTX 5080 and the retail title, and we'll run the smoke pair for 043d1f7 tonight. That saves the others asking.

  • PR side: 043d1f7 merged into main 2997c9a (no conflicts, nothing else in the tree, #214 not included), scripts/smoke.ps1 -Seconds 300.
  • main side: the block from our own regression run on 2997c9a, same package, same duration and same presses. We're running it anyway for a related change we're preparing for #232 (compute pipelines built on the workers when made).
  • If the PR run ends at the watchdog, we'll also run it once with XCL_PSO_WAIT_MS=1, as you suggested.

We'll post the blocks here with the stand-in draw counts and long-wait lines from the logs.

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

**@⁠qinrxx** on GitHub · 2026-11-24 02:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/267#issuecomment-7119702912) @⁠heretic1321 we have a Windows host with an RTX 5080 and the retail title, and we'll run the smoke pair for `043d1f7` tonight. That saves the others asking. - PR side: `043d1f7` merged into `main` `2997c9a` (no conflicts, nothing else in the tree, #214 not included), `scripts/smoke.ps1 -Seconds 300`. - `main` side: the block from our own regression run on `2997c9a`, same package, same duration and same presses. We're running it anyway for a related change we're preparing for #232 (compute pipelines built on the workers when made). - If the PR run ends at the watchdog, we'll also run it once with `XCL_PSO_WAIT_MS=1`, as you suggested. We'll post the blocks here with the stand-in draw counts and long-wait lines from the logs. AI use: Claude Code (Claude Opus 5.5) drafted this comment.
Author
Owner

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

Test report on the retail title and an NVIDIA card – the run listed under What the reporter must verify. 043d1f7 merged onto main 508a0c7, release; #334, #266, #435, #490 and the CopyFromSubresource fix (as in #539) are merged as well (this PC needs them to get as far as the world's graphics set-up).

Machine: Intel Core i7-7700K (4 cores / 8 threads), 16 GB RAM, NVIDIA GeForce RTX 5080 16 GB (driver 610.47, 32-lane waves), Windows 10 22H2 (19045), rustc 1.100.0. XCL_NETWORK=0, a pad script (XCL_PRESS_AT), default XCL_PSO_WAIT_MS.

With this PR the title still ends by its null write (#232; at 190 s, 29 s after its last frame) – but not in a draw:

  • report.json → d3d12.standin_draws: 0, and no "not built after" line: the graphics waits this PR bounds were not what held the title in that run.
  • At the null write 4 title threads were in pso_async::resolve_wait under resolve_for_bind ← bind::set_pipeline_state – waiting for a compute pipeline at its bind – and a fifth title thread was inside nvgpucomp64.dll, building that pipeline (a 316 KB translated compute program) for those 29 s. All xcl-pso and xcl-dxc workers were idle.
  • So on this card it is the compute side, which the description says this PR leaves as it is (step 2 of the list). #533 and #539 are about that side; neither is in this build.

How long those compute builds are – the same build with the title's null write stepped over (a local change, not a fix, so that the compiles finish and the run goes on), cold driver cache for these programs, 4 title threads building at once from ~165 s:

DXIL of the compute program builds in a title thread among the first 32 waits of 2 s and more (what gets logged) median longest
under 100 KB 11 3.6 s 4.4 s
100 – 200 KB 12 8.8 s 14.6 s
200 – 400 KB 5 26.9 s 33.9 s

In that 15-minute run: 318 compute pipelines built (24.4 MB of DXIL), 438 DXC compiles (the DXIL cache had none of the world's programs), 39 stand-in draws (this PR at work, with the "not built after 4.0 s" lines), and no frame after about 150 s. For its last nine minutes mostly one title thread built compute pipelines one after another – 125 KB to 222 KB of DXIL each, DXC and then the driver, 4 to 8 a minute – with the other cores and the xcl-pso workers idle. The run before it had left three such programs (153 KB – 390 KB, 6 s – 22 s) in the driver's cache; this one did not wait for them again.

Not tested: AMD; XCL_PSO_WAIT_MS=1 and =0; a second run on the driver cache this one filled; the draws in the world (not reached yet).

AI use: Claude Code with Claude Fable 5.2 ran the builds and runs and wrote this report; every number is from a run on the machine named. No game files are attached.

**@⁠imnicho** on GitHub · 2026-11-24 02:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/267#issuecomment-7119743727) Test report on the retail title and an NVIDIA card – the run listed under **What the reporter must verify**. `043d1f7` merged onto `main` `508a0c7`, release; #334, #266, #435, #490 and the `CopyFromSubresource` fix (as in #539) are merged as well (this PC needs them to get as far as the world's graphics set-up). Machine: Intel Core i7-7700K (4 cores / 8 threads), 16 GB RAM, NVIDIA GeForce RTX 5080 16 GB (driver 610.47, 32-lane waves), Windows 10 22H2 (19045), rustc 1.100.0. `XCL_NETWORK=0`, a pad script (`XCL_PRESS_AT`), default `XCL_PSO_WAIT_MS`. **With this PR the title still ends by its null write** (#232; at 190 s, 29 s after its last frame) – but not in a draw: - `report.json → d3d12.standin_draws`: 0, and no "not built after" line: the graphics waits this PR bounds were not what held the title in that run. - At the null write 4 title threads were in `pso_async::resolve_wait` under `resolve_for_bind` ← `bind::set_pipeline_state` – waiting for a **compute** pipeline at its bind – and a fifth title thread was inside `nvgpucomp64.dll`, building that pipeline (a 316 KB translated compute program) for those 29 s. All `xcl-pso` and `xcl-dxc` workers were idle. - So on this card it is the compute side, which the description says this PR leaves as it is (step 2 of the list). #533 and #539 are about that side; neither is in this build. **How long those compute builds are** – the same build with the title's null write stepped over (a local change, not a fix, so that the compiles finish and the run goes on), cold driver cache for these programs, 4 title threads building at once from ~165 s: | DXIL of the compute program | builds in a title thread among the first 32 waits of 2 s and more (what gets logged) | median | longest | |---|---|---|---| | under 100 KB | 11 | 3.6 s | 4.4 s | | 100 – 200 KB | 12 | 8.8 s | 14.6 s | | 200 – 400 KB | 5 | 26.9 s | 33.9 s | In that 15-minute run: 318 compute pipelines built (24.4 MB of DXIL), 438 DXC compiles (the DXIL cache had none of the world's programs), 39 stand-in draws (this PR at work, with the "not built after 4.0 s" lines), and no frame after about 150 s. For its last nine minutes mostly one title thread built compute pipelines one after another – 125 KB to 222 KB of DXIL each, DXC and then the driver, 4 to 8 a minute – with the other cores and the `xcl-pso` workers idle. The run before it had left three such programs (153 KB – 390 KB, 6 s – 22 s) in the driver's cache; this one did not wait for them again. **Not tested:** AMD; `XCL_PSO_WAIT_MS=1` and `=0`; a second run on the driver cache this one filled; the draws in the world (not reached yet). AI use: Claude Code with Claude Fable 5.2 ran the builds and runs and wrote this report; every number is from a run on the machine named. No game files are attached.
Author
Owner

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

Test report for 043d1f7 on AMD RDNA4, which Not tested lists. On this card the new limit is never reached: no draw waited on a pipeline in any run, and the title runs as on main.

Setup: AMD Radeon RX 9070 XT 16 GB, driver 32.0.32015.2008, Ryzen 7 9800X3D, 31 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.0 x86_64-pc-windows-msvc, DXC 1.9.2602.17. Retail title 1.0.2.1. Debug build for the tests, release builds for the runs.

Tests: cargo test --workspace --no-fail-fast -- --test-threads=4 at 043d1f7: 655 passed, 0 failed, 40 ignored. SKIPPED: the two debug-layer tests (the D3D12 debug layer isn't installed here).

Title runs: scripts/smoke.ps1 -Game <folder> -Seconds 60 with XCL_PRESS_A_AT=14,17,21, same saved state. 043d1f7 is 52 commits behind main, so it was also merged onto main 9ce2070 (clean, local merge b0fca42, not pushed):

build frames peak commit
main 9ce2070 1507, 1536 15685, 16054 MB
043d1f7 merged onto 9ce2070 1526, 1542 16145, 16016 MB
043d1f7 (its own base 4017f8f, which plays the intro video slowly) 1077 16137 MB
  • No waited … s for … pipeline and no not built after line in any of the three runs, so the stall this PR limits didn't occur on this card within 60 s.
  • No crash or device removal in any run.

Regression run (the PR merged onto main, since its own base is far behind):

main:

xcl-smoke v1
commit: 9ce2070eccf436d7bd38601c90407da447df34f3
gpu: AMD Radeon RX 9070 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1536 (PresentX 1536)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16054 MB

PR merged onto main:

xcl-smoke v1
commit: b0fca42d65aff37a4f2b90f2e0d253dd7ecf5670
gpu: AMD Radeon RX 9070 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1526 (PresentX 1526)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16145 MB

PR head:

xcl-smoke v1
commit: 043d1f7767367423660f688595b0c619662fdd1b
gpu: AMD Radeon RX 9070 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1077 (PresentX 1077)
presents per 2 s (last 3): 27 25 24
device removals: 0
crashes: 0
peak commit: 16137 MB

Not tested: the limit itself (nothing reached it here); gameplay past the intro; runs longer than 60 s; with #214.

AI use: Claude Code with Claude Opus 5.5 built the commits, ran the tests and the title runs, read the logs, and wrote this report. The runs were made on my machine.

**@⁠Chrysana** on GitHub · 2026-11-24 02:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/267#issuecomment-7120492899) Test report for `043d1f7` on **AMD RDNA4**, which **Not tested** lists. On this card the new limit is never reached: no draw waited on a pipeline in any run, and the title runs as on `main`. **Setup:** AMD Radeon RX 9070 XT 16 GB, driver 32.0.32015.2008, Ryzen 7 9800X3D, 31 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.0 `x86_64-pc-windows-msvc`, DXC 1.9.2602.17. Retail title 1.0.2.1. Debug build for the tests, release builds for the runs. **Tests:** `cargo test --workspace --no-fail-fast -- --test-threads=4` at `043d1f7`: 655 passed, 0 failed, 40 ignored. `SKIPPED`: the two debug-layer tests (the D3D12 debug layer isn't installed here). **Title runs:** `scripts/smoke.ps1 -Game <folder> -Seconds 60` with `XCL_PRESS_A_AT=14,17,21`, same saved state. `043d1f7` is 52 commits behind `main`, so it was also merged onto `main` `9ce2070` (clean, local merge `b0fca42`, not pushed): | build | frames | peak commit | |---|---|---| | `main` `9ce2070` | 1507, 1536 | 15685, 16054 MB | | **`043d1f7` merged onto `9ce2070`** | **1526, 1542** | 16145, 16016 MB | | `043d1f7` (its own base `4017f8f`, which plays the intro video slowly) | 1077 | 16137 MB | - No `waited … s for … pipeline` and no `not built after` line in any of the three runs, so the stall this PR limits didn't occur on this card within 60 s. - No crash or device removal in any run. **Regression run** (the PR merged onto `main`, since its own base is far behind): `main`: ``` xcl-smoke v1 commit: 9ce2070eccf436d7bd38601c90407da447df34f3 gpu: AMD Radeon RX 9070 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 1536 (PresentX 1536) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16054 MB ``` PR merged onto `main`: ``` xcl-smoke v1 commit: b0fca42d65aff37a4f2b90f2e0d253dd7ecf5670 gpu: AMD Radeon RX 9070 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 1526 (PresentX 1526) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16145 MB ``` PR head: ``` xcl-smoke v1 commit: 043d1f7767367423660f688595b0c619662fdd1b gpu: AMD Radeon RX 9070 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 1077 (PresentX 1077) presents per 2 s (last 3): 27 25 24 device removals: 0 crashes: 0 peak commit: 16137 MB ``` **Not tested:** the limit itself (nothing reached it here); gameplay past the intro; runs longer than 60 s; with #214. **AI use:** Claude Code with Claude Opus 5.5 built the commits, ran the tests and the title runs, read the logs, and wrote this report. The runs were made on my machine.
Author
Owner

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

Smoke pair for 043d1f7, as offered above. Windows host, retail title, the same package and duration for both runs.

Setup: NVIDIA GeForce RTX 5080 16 GB, driver 32.0.16.2124; AMD Ryzen 7 9800X3D; 31.6 GB RAM; Windows 11 Pro 26200; rustc 1.100.0; release builds; title 1.0.2.1.

  • main: 2997c9a, no local changes.
  • This PR: 043d1f7 merged into main 2997c9a. That's local merge commit 83be934, with no conflicts and nothing else in the tree (#214 not included).
  • scripts/smoke.ps1 -Seconds 300 (it sets XCL_NETWORK=0, XCL_ACTIVITY=1), A pressed at 14 / 17 / 21 s through XCL_PRESS_A_AT in both runs. Default XCL_PSO_WAIT_MS (4 s).

Regression run

xcl-smoke v1
commit: 2997c9aca6ebf4577fed34ebdb3cb0a77dd9ec21
gpu: NVIDIA GeForce RTX 5080
title: GTA6.Xbox.v1.0.2.1-CYBERLEEK
seconds: 300
exit: 0x0
frames shown: 5099 (PresentX 5099)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15011 MB
xcl-smoke v1
commit: 83be934fd100dee8d519efd1131412326fae8cfa
gpu: NVIDIA GeForce RTX 5080
title: GTA6.Xbox.v1.0.2.1-CYBERLEEK
seconds: 300
exit: 0x0
frames shown: 5116 (PresentX 5116)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 14991 MB

Against main: 100.3 % of its frames, 99.9 % of its peak commit. No crash and no device removal in either run. The PR run did not end at the watchdog, so the XCL_PSO_WAIT_MS=1 run was not needed.

From the PR run's logs:

  • d3d12.standin_draws: 0. No not built after line, and no waited … for … pipeline line (no wait of 2 s or more).
  • Pipelines: background_pipelines [13, 0, 57810], 3 compute pipelines built.

What it does not cover: neither run got to world loading, where #232 stops.

  • 126 BCPack refusals in total, against ~2,000 in the stall reports.
  • Commit flat at ~15 GB.
  • Presents at 60 per 2 s to the end.

So this is a regression check of the menus and loading before the world (nothing broke there). It doesn't test the draw waits this PR bounds: none reached the limit, or even 2 s.

Not tested: together with #214; world loading; AMD; other cards; a cold DXIL cache.

AI use: Runs: OpenCode with GLM (Z.ai) GLM-5.3, which executed the runs on the hardware above and extracted the numbers. Drafts: Claude Code (Claude Opus 5.5), which built XCL (both trees), checked the figures against the logs and report.json, and wrote this comment. A human (Qinrxx) reviewed it before posting.

**@⁠qinrxx** on GitHub · 2026-11-24 03:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/267#issuecomment-7121247648) Smoke pair for `043d1f7`, as offered above. Windows host, retail title, the same package and duration for both runs. **Setup:** NVIDIA GeForce RTX 5080 16 GB, driver 32.0.16.2124; AMD Ryzen 7 9800X3D; 31.6 GB RAM; Windows 11 Pro 26200; rustc 1.100.0; release builds; title 1.0.2.1. - `main`: `2997c9a`, no local changes. - This PR: `043d1f7` merged into `main` `2997c9a`. That's local merge commit `83be934`, with no conflicts and nothing else in the tree (#214 not included). - `scripts/smoke.ps1 -Seconds 300` (it sets `XCL_NETWORK=0`, `XCL_ACTIVITY=1`), A pressed at 14 / 17 / 21 s through `XCL_PRESS_A_AT` in both runs. Default `XCL_PSO_WAIT_MS` (4 s). **Regression run** ``` xcl-smoke v1 commit: 2997c9aca6ebf4577fed34ebdb3cb0a77dd9ec21 gpu: NVIDIA GeForce RTX 5080 title: GTA6.Xbox.v1.0.2.1-CYBERLEEK seconds: 300 exit: 0x0 frames shown: 5099 (PresentX 5099) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15011 MB ``` ``` xcl-smoke v1 commit: 83be934fd100dee8d519efd1131412326fae8cfa gpu: NVIDIA GeForce RTX 5080 title: GTA6.Xbox.v1.0.2.1-CYBERLEEK seconds: 300 exit: 0x0 frames shown: 5116 (PresentX 5116) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 14991 MB ``` Against `main`: 100.3 % of its frames, 99.9 % of its peak commit. No crash and no device removal in either run. The PR run did not end at the watchdog, so the `XCL_PSO_WAIT_MS=1` run was not needed. **From the PR run's logs:** - `d3d12.standin_draws`: 0. No `not built after` line, and no `waited … for … pipeline` line (no wait of 2 s or more). - Pipelines: `background_pipelines` `[13, 0, 57810]`, 3 compute pipelines built. **What it does not cover:** neither run got to world loading, where #232 stops. - 126 BCPack refusals in total, against ~2,000 in the stall reports. - Commit flat at ~15 GB. - Presents at 60 per 2 s to the end. So this is a regression check of the menus and loading before the world (nothing broke there). It doesn't test the draw waits this PR bounds: none reached the limit, or even 2 s. **Not tested:** together with #214; world loading; AMD; other cards; a cold DXIL cache. AI use: Runs: OpenCode with GLM (Z.ai) GLM-5.3, which executed the runs on the hardware above and extracted the numbers. Drafts: Claude Code (Claude Opus 5.5), which built XCL (both trees), checked the figures against the logs and `report.json`, and wrote this comment. A human (Qinrxx) reviewed it before posting.
Author
Owner

@⁠woreksami on GitHub · 2026-11-24 05:14 UTC · original

@⁠heretic1321 this now conflicts with main (#574's ExecuteIndirect skip in bind.rs, #690's note_use and submit_lazy(…, key) in pso_async.rs). In case it saves you time, here is a resolution I tested; nothing is pushed anywhere.

What it does

  • bind.rs: keeps main's skip of an ExecuteIndirect whose pipeline is still being built (#574); this PR's side there only changed the comment above the root-signature bind.
  • pso_async.rs resolve_wait: keeps both p.note_use(); (#690) and this PR's let start = Instant::now();.
  • draw_wait_tests: the three submit_lazy calls get #690's new key argument (0).

Tested

  • main 6025201 + this PR (043d1f7), merged as below: cargo test --release -p xcl --lib: 666 passed, 0 failed, 21 ignored; both draw_wait_tests pass.
  • Windows 11 (26200), RTX 3060 8 GB, driver 610.88, i9-14900K, 32 GB.
  • Earlier today, the same resolution in a tree with #214, #456, #468, #503 and #572 as well ran the newer retail title from the README at 29.8 fps after 26 s with XCL_PSO_WAIT_MS=150 and no crash.

Not tested

  • This merge alone with the title, scripts/smoke.ps1, the workspace suite.
Resolution (git show --remerge-diff of the merge)
diff --git a/crates/xcl/src/hle/d3d12x/bind.rs b/crates/xcl/src/hle/d3d12x/bind.rs
remerge CONFLICT (content): Merge conflict in crates/xcl/src/hle/d3d12x/bind.rs
index 20b1ce8..7b70f0c 100644
--- a/crates/xcl/src/hle/d3d12x/bind.rs
+++ b/crates/xcl/src/hle/d3d12x/bind.rs
@@ -218,7 +218,6 @@ pub(super) unsafe extern "system" fn execute_indirect(this: *mut c_void, sig: us
     let (gfx, compute) = (super::real::is_translated_graphics(pso), super::real::is_translated_compute(pso));
     let (args_off, count_off) = (args_off + super::real::buffer_delta(args), count_off + super::real::buffer_delta(count_buf));
     if !gfx && !compute {
-<<<<<<< 6025201 (Merge pull request #771 from gefydev/readme/discord-invite)
         // A pipeline still being built (or whose build failed): its stand-in draws nothing, and
         // the list may hold XCL's ABI root signature from a translated draw before it – the PC
         // call with that pair is invalid (debug layer 953, "the currently set Root Signature
@@ -233,10 +232,6 @@ pub(super) unsafe extern "system" fn execute_indirect(this: *mut c_void, sig: us
             return;
         }
         // a PC pipeline: the title's root signature, as for a draw (`graphics_bound`)
-=======
-        // a PC pipeline (also a stand-in whose build is not done within the limit or failed):
-        // the title's root signature first, as in `graphics_bound` (nothing else binds it)
->>>>>>> 043d1f7 (D3D12.X: a draw waits at most 4 s for a pipeline still building)
         let rs = with(this, |s| s.rs_gfx) as *mut c_void;
         if let (Some(list), Some(r)) = (ID3D12GraphicsCommandList::from_raw_borrowed(&this), ID3D12RootSignature::from_raw_borrowed(&rs)) {
             list.SetGraphicsRootSignature(r);
diff --git a/crates/xcl/src/hle/d3d12x/pso_async.rs b/crates/xcl/src/hle/d3d12x/pso_async.rs
remerge CONFLICT (content): Merge conflict in crates/xcl/src/hle/d3d12x/pso_async.rs
index 3662af0..4d30ea3 100644
--- a/crates/xcl/src/hle/d3d12x/pso_async.rs
+++ b/crates/xcl/src/hle/d3d12x/pso_async.rs
@@ -345,11 +345,8 @@ pub fn resolve(pso: usize) -> usize {
 /// it yet (a queue of a title's hundreds of pipelines must not hold up the one it binds now).
 pub fn resolve_wait(pso: usize) -> usize {
     let Some(p) = entry(pso) else { return pso };
-<<<<<<< 6025201 (Merge pull request #771 from gefydev/readme/discord-invite)
     p.note_use();
-=======
     let start = Instant::now();
->>>>>>> 043d1f7 (D3D12.X: a draw waits at most 4 s for a pipeline still building)
     let job = p.job.lock().unwrap().take();
     let here = job.is_some();
     if let Some(job) = job {
@@ -513,6 +510,7 @@ mod draw_wait_tests {
                 let _ = go_rx.recv();
                 real
             }),
+            0,
         );
         let limit = Some(Duration::from_millis(300));
         let lost = standin_draws();
@@ -546,10 +544,11 @@ mod draw_wait_tests {
                 std::thread::sleep(Duration::from_millis(100));
                 c_real
             }),
+            0,
         );
         assert_eq!(resolve_within(c, Some(Duration::ZERO)), c_real);
         let (g, g_real) = (0x7410_0021usize, 0x7410_0022usize);
-        submit_lazy(g, false, Box::new(move || g_real));
+        submit_lazy(g, false, Box::new(move || g_real), 0);
         assert_eq!(resolve_within(g, None), g_real);
         assert_eq!(resolve_within(0x7410_0031, Some(Duration::ZERO)), 0x7410_0031, "not a stand-in");
         let _ = released(c);

AI use: Claude Code with Claude Opus 5.5 resolved the conflicts, ran the tests and wrote this comment.

**@⁠woreksami** on GitHub · 2026-11-24 05:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/267#issuecomment-7122762757) @⁠heretic1321 this now conflicts with `main` (#574's ExecuteIndirect skip in `bind.rs`, #690's `note_use` and `submit_lazy(…, key)` in `pso_async.rs`). In case it saves you time, here is a resolution I tested; nothing is pushed anywhere. **What it does** - `bind.rs`: keeps `main`'s skip of an ExecuteIndirect whose pipeline is still being built (#574); this PR's side there only changed the comment above the root-signature bind. - `pso_async.rs` `resolve_wait`: keeps both `p.note_use();` (#690) and this PR's `let start = Instant::now();`. - `draw_wait_tests`: the three `submit_lazy` calls get #690's new `key` argument (`0`). **Tested** - `main` 6025201 + this PR (043d1f7), merged as below: `cargo test --release -p xcl --lib`: 666 passed, 0 failed, 21 ignored; both `draw_wait_tests` pass. - Windows 11 (26200), RTX 3060 8 GB, driver 610.88, i9-14900K, 32 GB. - Earlier today, the same resolution in a tree with #214, #456, #468, #503 and #572 as well ran the newer retail title from the README at 29.8 fps after 26 s with `XCL_PSO_WAIT_MS=150` and no crash. **Not tested** - This merge alone with the title, `scripts/smoke.ps1`, the workspace suite. <details><summary>Resolution (<code>git show --remerge-diff</code> of the merge)</summary> ```diff diff --git a/crates/xcl/src/hle/d3d12x/bind.rs b/crates/xcl/src/hle/d3d12x/bind.rs remerge CONFLICT (content): Merge conflict in crates/xcl/src/hle/d3d12x/bind.rs index 20b1ce8..7b70f0c 100644 --- a/crates/xcl/src/hle/d3d12x/bind.rs +++ b/crates/xcl/src/hle/d3d12x/bind.rs @@ -218,7 +218,6 @@ pub(super) unsafe extern "system" fn execute_indirect(this: *mut c_void, sig: us let (gfx, compute) = (super::real::is_translated_graphics(pso), super::real::is_translated_compute(pso)); let (args_off, count_off) = (args_off + super::real::buffer_delta(args), count_off + super::real::buffer_delta(count_buf)); if !gfx && !compute { -<<<<<<< 6025201 (Merge pull request #771 from gefydev/readme/discord-invite) // A pipeline still being built (or whose build failed): its stand-in draws nothing, and // the list may hold XCL's ABI root signature from a translated draw before it – the PC // call with that pair is invalid (debug layer 953, "the currently set Root Signature @@ -233,10 +232,6 @@ pub(super) unsafe extern "system" fn execute_indirect(this: *mut c_void, sig: us return; } // a PC pipeline: the title's root signature, as for a draw (`graphics_bound`) -======= - // a PC pipeline (also a stand-in whose build is not done within the limit or failed): - // the title's root signature first, as in `graphics_bound` (nothing else binds it) ->>>>>>> 043d1f7 (D3D12.X: a draw waits at most 4 s for a pipeline still building) let rs = with(this, |s| s.rs_gfx) as *mut c_void; if let (Some(list), Some(r)) = (ID3D12GraphicsCommandList::from_raw_borrowed(&this), ID3D12RootSignature::from_raw_borrowed(&rs)) { list.SetGraphicsRootSignature(r); diff --git a/crates/xcl/src/hle/d3d12x/pso_async.rs b/crates/xcl/src/hle/d3d12x/pso_async.rs remerge CONFLICT (content): Merge conflict in crates/xcl/src/hle/d3d12x/pso_async.rs index 3662af0..4d30ea3 100644 --- a/crates/xcl/src/hle/d3d12x/pso_async.rs +++ b/crates/xcl/src/hle/d3d12x/pso_async.rs @@ -345,11 +345,8 @@ pub fn resolve(pso: usize) -> usize { /// it yet (a queue of a title's hundreds of pipelines must not hold up the one it binds now). pub fn resolve_wait(pso: usize) -> usize { let Some(p) = entry(pso) else { return pso }; -<<<<<<< 6025201 (Merge pull request #771 from gefydev/readme/discord-invite) p.note_use(); -======= let start = Instant::now(); ->>>>>>> 043d1f7 (D3D12.X: a draw waits at most 4 s for a pipeline still building) let job = p.job.lock().unwrap().take(); let here = job.is_some(); if let Some(job) = job { @@ -513,6 +510,7 @@ mod draw_wait_tests { let _ = go_rx.recv(); real }), + 0, ); let limit = Some(Duration::from_millis(300)); let lost = standin_draws(); @@ -546,10 +544,11 @@ mod draw_wait_tests { std::thread::sleep(Duration::from_millis(100)); c_real }), + 0, ); assert_eq!(resolve_within(c, Some(Duration::ZERO)), c_real); let (g, g_real) = (0x7410_0021usize, 0x7410_0022usize); - submit_lazy(g, false, Box::new(move || g_real)); + submit_lazy(g, false, Box::new(move || g_real), 0); assert_eq!(resolve_within(g, None), g_real); assert_eq!(resolve_within(0x7410_0031, Some(Duration::ZERO)), 0x7410_0031, "not a stand-in"); let _ = released(c); ``` </details> AI use: Claude Code with Claude Opus 5.5 resolved the conflicts, ran the tests and wrote this comment.
Author
Owner

@⁠heretic1321 on GitHub · 2026-11-24 09:46 UTC · original

Rebased onto upstream/main (6bac4b4) at ef98154fe389c94736d241997c83bccb755c65bb (0 errors, 0 warnings on AR_x86_64_pc_windows_msvc=llvm-ar cargo check --release --workspace and --tests).

Thank you @⁠qinrxx, @⁠Chrysana, @⁠imnicho, @⁠woreksami, and @⁠Kalmarv for all the reviews, test runs, and conflict notes!

Review points addressed in ef98154:

  1. Per-pipeline timeout latch (Pending::late) (@⁠Kalmarv point 4, @⁠qinrxx point 1): Once one draw times out waiting for a graphics pipeline still building on a worker, p.late is latched so subsequent draws of that pipeline return the stand-in immediately (and increment standin_draws) instead of waiting N * limit. Updated draw_wait_tests to assert the second draw returns immediately (< 100 ms).
  2. Timed-out execute_indirect test (@⁠qinrxx point 2): Added bind::tests::execute_indirect_skips_when_a_still_building_graphics_pipeline_times_out covering a blocked graphics build after late is tripped, verifying #574's pending skip runs without waiting another limit and without calling PC ExecuteIndirect.
  3. Env var parsing test (@⁠qinrxx point 3): Factored parse_wait_limit and added draw_wait_tests::wait_limit_parses_env_values.
  4. Conflict resolution (#574 + #690) (@⁠woreksami): Preserved #574's pending ExecuteIndirect skip and #690's p.note_use() / submit_lazy(..., key) (and called p.note_use() in resolve_within so #690 records used graphics pipelines).

Note on overlap with #891 / #533:
@⁠imnicho's RTX 5080 run on 043d1f7 showed that compute pipeline waits in resolve_wait also hit #232's watchdog when graphics waits stayed under the limit (0 standin_draws at the 190 s abort), and #891 (with XCL_PSO_WAIT_MS opt-in across compute + graphics) / #533 address that side. This PR stays focused on the safe-by-default 4 s graphics-only bound (since dropping graphics draws does not corrupt compute state); happy to close if maintainers prefer #891 alone, or ask for a fresh xcl-smoke pair on ef98154 if the default graphics bound is still wanted independently.

**@⁠heretic1321** on GitHub · 2026-11-24 09:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/267#issuecomment-7127871653) Rebased onto `upstream/main` (`6bac4b4`) at `ef98154fe389c94736d241997c83bccb755c65bb` (0 errors, 0 warnings on `AR_x86_64_pc_windows_msvc=llvm-ar cargo check --release --workspace` and `--tests`). Thank you @⁠qinrxx, @⁠Chrysana, @⁠imnicho, @⁠woreksami, and @⁠Kalmarv for all the reviews, test runs, and conflict notes! **Review points addressed in `ef98154`:** 1. **Per-pipeline timeout latch (`Pending::late`)** (@⁠Kalmarv point 4, @⁠qinrxx point 1): Once one draw times out waiting for a graphics pipeline still building on a worker, `p.late` is latched so subsequent draws of that pipeline return the stand-in immediately (and increment `standin_draws`) instead of waiting `N * limit`. Updated `draw_wait_tests` to assert the second draw returns immediately (`< 100 ms`). 2. **Timed-out `execute_indirect` test** (@⁠qinrxx point 2): Added `bind::tests::execute_indirect_skips_when_a_still_building_graphics_pipeline_times_out` covering a blocked graphics build after `late` is tripped, verifying `#574`'s pending skip runs without waiting another limit and without calling PC `ExecuteIndirect`. 3. **Env var parsing test** (@⁠qinrxx point 3): Factored `parse_wait_limit` and added `draw_wait_tests::wait_limit_parses_env_values`. 4. **Conflict resolution (`#574` + `#690`)** (@⁠woreksami): Preserved `#574`'s pending `ExecuteIndirect` skip and `#690`'s `p.note_use()` / `submit_lazy(..., key)` (and called `p.note_use()` in `resolve_within` so `#690` records used graphics pipelines). **Note on overlap with `#891` / `#533`:** @⁠imnicho's RTX 5080 run on `043d1f7` showed that compute pipeline waits in `resolve_wait` also hit `#232`'s watchdog when graphics waits stayed under the limit (`0` `standin_draws` at the 190 s abort), and `#891` (with `XCL_PSO_WAIT_MS` opt-in across compute + graphics) / `#533` address that side. This PR stays focused on the safe-by-default 4 s graphics-only bound (since dropping graphics draws does not corrupt compute state); happy to close if maintainers prefer `#891` alone, or ask for a fresh `xcl-smoke` pair on `ef98154` if the default graphics bound is still wanted independently.
Author
Owner

@⁠heretic1321 on GitHub · 2026-11-24 10:07 UTC · original

Closing as superseded by #891 (5fab112 / 8cada26), which merged XCL_PSO_WAIT_MS (with 0 / unset waiting indefinitely) and the Pending::late latch directly into pso_async::resolve_wait, covering both compute binds and graphics draws.

Thanks to @⁠qinrxx, @⁠Chrysana, @⁠imnicho, @⁠woreksami, and @⁠Kalmarv for all the reviews and Windows/GPU test runs.

**@⁠heretic1321** on GitHub · 2026-11-24 10:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/267#issuecomment-7128358312) Closing as superseded by #891 (`5fab112` / `8cada26`), which merged `XCL_PSO_WAIT_MS` (with `0` / unset waiting indefinitely) and the `Pending::late` latch directly into `pso_async::resolve_wait`, covering both compute binds and graphics draws. Thanks to @⁠qinrxx, @⁠Chrysana, @⁠imnicho, @⁠woreksami, and @⁠Kalmarv for all the reviews and Windows/GPU test runs.
Author
Owner

@⁠qinrxx on GitHub · 2026-11-24 01:14 UTC · original · reviewed

Review of 043d1f7, on correctness and tests only. The diff was read against main 2997c9a.

What I ran: cargo test -p xcl --lib d3d12x:: -- --test-threads=4

  • on the PR head (base 4017f8f): 81 passed, 0 failed, 1 ignored;
  • on the PR head merged into main 2997c9a (merges without conflicts): 90 passed, 0 failed, 1 ignored. The three new tests pass.
  • Not run: the whole workspace suite, any GPU test beyond this filter, the retail title.

1. The limit applies per draw, so a thread that records several draws is still held for about the whole build.
resolve_within gives every draw the full XCL_PSO_WAIT_MS, and each_draw_waits_… asserts exactly that ("every draw gets the whole limit"). Take a 17 s NVIDIA build (#156) and a thread that records 5 draws with that pipeline: the draws wait 4 + 4 + 4 + 4 + 1 s, so the thread is held about 17 s, much the same as with resolve_wait. The limit only shortens the hold when each draw of a still-building pipeline comes from a different recording. Would a budget per pipeline work better? Once one draw has given up on a pipeline, later draws of it would not wait (resolve) until it is built. The test would then assert that the second draw returns at once.

2. The new execute_indirect path is tested only with a failed build, not one that timed out.
execute_indirect_with_a_stand_in_binds_the_titles_root_signature_first uses submit(standin, false, Box::new(|| 0)), so the pipeline is done and has failed, and the 4 s limit is never reached. A test with a build that is still running and a short limit would cover the case the PR is for: the stand-in returned at the deadline, then the root signature, then ExecuteIndirect. graphics_bound past the limit has no test either. (From the code, the bind test would fail on main, whose path doesn't bind the root signature, so it does cover that half. I didn't run it there.)

3. XCL_PSO_WAIT_MS is read once into a OnceLock.
The tests get around this by calling resolve_within directly, which is fine. Parsing the variable (0 = no limit, junk = the default) has no test. That's minor and could stay as it is.

Overlap with a change I'm preparing (for #232, compute pipelines):

  • I plan to send lazy compute pipelines to the xcl-pso workers when the title creates them, so that the first bind usually finds them built. This PR keeps compute on resolve_wait, and nothing here would change.
  • The workers have one FIFO queue. With compute builds sent when they are made, a graphics pipeline sent at its first draw can sit behind them, and under this PR's limit its draws would time out and be lost more often. My change will have to handle that (for example graphics ahead in the queue). I'm noting it here so the two PRs are not judged separately on it.
  • Both PRs change the module doc of pso_async.rs (lines 3–8), and mine also changes the lazy() doc. Whichever lands second rebases. Mine changes submit_as, which this PR doesn't touch.

AI use: Claude Code (Claude Opus 5.5) read the diff, ran the tests above and wrote this review. I checked each point myself before posting.

**@⁠qinrxx** on GitHub · 2026-11-24 01:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/267#pullrequestreview-6032138328) · **reviewed** Review of 043d1f7, on correctness and tests only. The diff was read against `main` 2997c9a. **What I ran:** `cargo test -p xcl --lib d3d12x:: -- --test-threads=4` - on the PR head (base 4017f8f): 81 passed, 0 failed, 1 ignored; - on the PR head merged into `main` 2997c9a (merges without conflicts): 90 passed, 0 failed, 1 ignored. The three new tests pass. - Not run: the whole workspace suite, any GPU test beyond this filter, the retail title. **1. The limit applies per draw, so a thread that records several draws is still held for about the whole build.** `resolve_within` gives every draw the full `XCL_PSO_WAIT_MS`, and `each_draw_waits_…` asserts exactly that ("every draw gets the whole limit"). Take a 17 s NVIDIA build (#156) and a thread that records 5 draws with that pipeline: the draws wait 4 + 4 + 4 + 4 + 1 s, so the thread is held about 17 s, much the same as with `resolve_wait`. The limit only shortens the hold when each draw of a still-building pipeline comes from a different recording. Would a budget per pipeline work better? Once one draw has given up on a pipeline, later draws of it would not wait (`resolve`) until it is built. The test would then assert that the second draw returns at once. **2. The new `execute_indirect` path is tested only with a failed build, not one that timed out.** `execute_indirect_with_a_stand_in_binds_the_titles_root_signature_first` uses `submit(standin, false, Box::new(|| 0))`, so the pipeline is done and has failed, and the 4 s limit is never reached. A test with a build that is still running and a short limit would cover the case the PR is for: the stand-in returned at the deadline, then the root signature, then `ExecuteIndirect`. `graphics_bound` past the limit has no test either. (From the code, the bind test would fail on `main`, whose path doesn't bind the root signature, so it does cover that half. I didn't run it there.) **3. `XCL_PSO_WAIT_MS` is read once into a `OnceLock`.** The tests get around this by calling `resolve_within` directly, which is fine. Parsing the variable (`0` = no limit, junk = the default) has no test. That's minor and could stay as it is. **Overlap with a change I'm preparing (for #232, compute pipelines):** - I plan to send lazy **compute** pipelines to the `xcl-pso` workers when the title creates them, so that the first bind usually finds them built. This PR keeps compute on `resolve_wait`, and nothing here would change. - The workers have one FIFO queue. With compute builds sent when they are made, a graphics pipeline sent at its first draw can sit behind them, and under this PR's limit its draws would time out and be lost more often. My change will have to handle that (for example graphics ahead in the queue). I'm noting it here so the two PRs are not judged separately on it. - Both PRs change the module doc of `pso_async.rs` (lines 3–8), and mine also changes the `lazy()` doc. Whichever lands second rebases. Mine changes `submit_as`, which this PR doesn't touch. AI use: Claude Code (Claude Opus 5.5) read the diff, ran the tests above and wrote this review. I checked each point myself before posting.
Author
Owner

@⁠qinrxx on GitHub · 2026-11-24 01:15 UTC · original · reviewed

Review of 043d1f7, on correctness and tests only. The diff was read against main 2997c9a.

What I ran: cargo test -p xcl --lib d3d12x:: -- --test-threads=4

  • on the PR head (base 4017f8f): 81 passed, 0 failed, 1 ignored;
  • on the PR head merged into main 2997c9a (merges without conflicts): 90 passed, 0 failed, 1 ignored. The three new tests pass.
  • Not run: the whole workspace suite, any GPU test beyond this filter, the retail title.

1. The limit applies per draw, so a thread that records several draws is still held for about the whole build.
resolve_within gives every draw the full XCL_PSO_WAIT_MS, and each_draw_waits_… asserts exactly that ("every draw gets the whole limit"). Take a 17 s NVIDIA build (#156) and a thread that records 5 draws with that pipeline: the draws wait 4 + 4 + 4 + 4 + 1 s, so the thread is held about 17 s, much the same as with resolve_wait. The limit only shortens the hold when each draw of a still-building pipeline comes from a different recording. Would a budget per pipeline work better? Once one draw has given up on a pipeline, later draws of it would not wait (resolve) until it is built. The test would then assert that the second draw returns at once.

2. The new execute_indirect path is tested only with a failed build, not one that timed out.
execute_indirect_with_a_stand_in_binds_the_titles_root_signature_first uses submit(standin, false, Box::new(|| 0)), so the pipeline is done and has failed, and the 4 s limit is never reached. A test with a build that is still running and a short limit would cover the case the PR is for: the stand-in returned at the deadline, then the root signature, then ExecuteIndirect. graphics_bound past the limit has no test either. (From the code, the bind test would fail on main, whose path doesn't bind the root signature, so it does cover that half. I didn't run it there.)

3. XCL_PSO_WAIT_MS is read once into a OnceLock.
The tests get around this by calling resolve_within directly, which is fine. Parsing the variable (0 = no limit, junk = the default) has no test. That's minor and could stay as it is.

Overlap with a change I'm preparing (for #232, compute pipelines):

  • I plan to send lazy compute pipelines to the xcl-pso workers when the title creates them, so that the first bind usually finds them built. This PR keeps compute on resolve_wait, and nothing here would change.
  • The workers have one FIFO queue. With compute builds sent when they are made, a graphics pipeline sent at its first draw can sit behind them, and under this PR's limit its draws would time out and be lost more often. My change will have to handle that (for example graphics ahead in the queue). I'm noting it here so the two PRs are not judged separately on it.
  • Both PRs change the module doc of pso_async.rs (lines 3–8), and mine also changes the lazy() doc. Whichever lands second rebases. Mine changes submit_as, which this PR doesn't touch.

AI use: Claude Code (Claude Opus 5.5) read the diff, ran the tests above and wrote this review. I checked each point myself before posting.

**@⁠qinrxx** on GitHub · 2026-11-24 01:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/267#pullrequestreview-6032150597) · **reviewed** Review of 043d1f7, on correctness and tests only. The diff was read against `main` 2997c9a. **What I ran:** `cargo test -p xcl --lib d3d12x:: -- --test-threads=4` - on the PR head (base 4017f8f): 81 passed, 0 failed, 1 ignored; - on the PR head merged into `main` 2997c9a (merges without conflicts): 90 passed, 0 failed, 1 ignored. The three new tests pass. - Not run: the whole workspace suite, any GPU test beyond this filter, the retail title. **1. The limit applies per draw, so a thread that records several draws is still held for about the whole build.** `resolve_within` gives every draw the full `XCL_PSO_WAIT_MS`, and `each_draw_waits_…` asserts exactly that ("every draw gets the whole limit"). Take a 17 s NVIDIA build (#156) and a thread that records 5 draws with that pipeline: the draws wait 4 + 4 + 4 + 4 + 1 s, so the thread is held about 17 s, much the same as with `resolve_wait`. The limit only shortens the hold when each draw of a still-building pipeline comes from a different recording. Would a budget per pipeline work better? Once one draw has given up on a pipeline, later draws of it would not wait (`resolve`) until it is built. The test would then assert that the second draw returns at once. **2. The new `execute_indirect` path is tested only with a failed build, not one that timed out.** `execute_indirect_with_a_stand_in_binds_the_titles_root_signature_first` uses `submit(standin, false, Box::new(|| 0))`, so the pipeline is done and has failed, and the 4 s limit is never reached. A test with a build that is still running and a short limit would cover the case the PR is for: the stand-in returned at the deadline, then the root signature, then `ExecuteIndirect`. `graphics_bound` past the limit has no test either. (From the code, the bind test would fail on `main`, whose path doesn't bind the root signature, so it does cover that half. I didn't run it there.) **3. `XCL_PSO_WAIT_MS` is read once into a `OnceLock`.** The tests get around this by calling `resolve_within` directly, which is fine. Parsing the variable (`0` = no limit, junk = the default) has no test. That's minor and could stay as it is. **Overlap with a change I'm preparing (for #232, compute pipelines):** - I plan to send lazy **compute** pipelines to the `xcl-pso` workers when the title creates them, so that the first bind usually finds them built. This PR keeps compute on `resolve_wait`, and nothing here would change. - The workers have one FIFO queue. With compute builds sent when they are made, a graphics pipeline sent at its first draw can sit behind them, and under this PR's limit its draws would time out and be lost more often. My change will have to handle that (for example graphics ahead in the queue). I'm noting it here so the two PRs are not judged separately on it. - Both PRs change the module doc of `pso_async.rs` (lines 3–8), and mine also changes the `lazy()` doc. Whichever lands second rebases. Mine changes `submit_as`, which this PR doesn't touch. AI use: Claude Code (Claude Opus 5.5) read the diff, ran the tests above and wrote this review. I checked each point myself before posting.

Pull request closed

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