Skip to content

D3D12.X: the window title counts driver pipeline builds too - #2670

Open
Kalmarv wants to merge 1 commit into
xcl-dev:mainfrom
Kalmarv:titlebar-driver-count
Open

Kalmarv wants to merge 1 commit into
xcl-dev:mainfrom
Kalmarv:titlebar-driver-count

Conversation

@Kalmarv

@Kalmarv Kalmarv commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

The window title's "compiling shaders: N running, M done" counts only XCL's DXC compiles. While the NVIDIA driver built cold pipelines (2 - 5 s each, some on the title's own thread, some waiting for the huge-compile slot) it read "0 running", which looked like a hang. This PR also counts the driver's pipeline builds in the title, and logs the slow ones that were only visible with XCL_PSO_TRACE=1.

Part of #2088.

The driver counter idea comes from #214, but there the counter sits inside a ~380-line driver-concurrency change that no longer merges into main. This PR is only the title and log part, on main's own huge-compile gating. #214's author is welcome to take it into their PR instead.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: driver_pso makes every Create*PipelineState call XCL makes, on a worker or on a title thread. It now counts each build while it runs and once it is done. driver_compile_identified counts the huge ones waiting for their slot. A call given a driver blob of an earlier build is a load and is not counted. A driver compile below the huge size that takes 1 s or more now logs slow driver compile #N: <kind> PSO, <bytes> B DXIL[, record …, driver blob …], <ms> ms on <thread> without XCL_PSO_TRACE=1. Two tests: the counter itself, and that a call through driver_pso is counted while a blob load is not.
  • crates/xcl/src/hle/d3d12x/present.rs: the title reads compiling shaders: DXC N running, M done | driver N building[ (W waiting for a slot)], D done[, Q pipelines queued][, F failed]. It stays up while driver builds run or wait, as well as for DXC compiles. One test of the text.

Tested

  • Ryzen 9 9950X, RTX 5070 Ti (NVIDIA 610.74), Windows 11 build 26200, rustc 1.99.0, DXC 1.9.2609.
  • cargo test -p xcl --lib -- hle::d3d12x::real::big_compile_tests hle::d3d12x::present::tests --test-threads=4 (debug): 20 passed, 0 failed, 0 ignored.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 (debug) on ca6a0cc0: 1426 passed, 0 failed, 46 ignored. SKIPPED: 21 for no wave64 on this adapter, 1 for no heap windows (heap_window_out_of_memory_falls_back_to_the_switch_form), and 3 per-lane f16/f32 forms that the translator refuses (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32, gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426).

Tested by others

  • @sage-sage on ca6a0cc0 as it is (not merged onto current main): RTX 4080 SUPER (driver 621.40), Ryzen 5 7600X, Windows 11 build 26300, rustc 1.100.0, DXC 1.9.2602.17, debug: cargo test --workspace -- --test-threads=4: 1426 passed, 0 failed, 46 ignored; the 3 new tests pass; the SKIPPED tests are the same as on main on that machine (report). Thanks!

Regression run

scripts/smoke.ps1 -Seconds 60, the same retail title, both from release builds of clean trees, run back to back in one queue job on the machine above, beside other GPU-queue work. A CPU-bound shader precompile ran on the same machine beside the head side for all of its run, and beside the main side from partway through (it started during that run), so the head side ran under at least as much load as main's.

main e1d84b7d (this PR's base):

xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 644 (PresentX 644)
presents per 2 s (last 3): 59 60 60
device removals: 0
crashes: 0
peak commit: 15189 MB

This PR's head ca6a0cc0:

xcl-smoke v1
commit: ca6a0cc0e8f5bed2a3f7f96c23429674961a02ae
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 611 (PresentX 611)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15074 MB

Not tested

  • AMD and Intel GPUs.
  • The title text in a full play session: the smoke runs do not record the window title.
  • Whether "slow driver compile" lines come at a rate that matters in a long session. They come only for compiles of 1 s or more.

AI use

  • Claude Code with Claude Opus 5.5 wrote the code, the tests and this description, and ran the tests and the regression run on the hardware above.

🤖 Generated with Claude Code

The title's "compiling shaders: N running, M done" counted only XCL's DXC
compiles. While the driver built cold pipelines (2 - 5 s each on NVIDIA,
some on the title's own thread, some waiting for the huge-compile slot) it
read "0 running", so it looked as if nothing was happening.

Every Create*PipelineState call XCL makes goes through driver_pso; it now
counts the build while it runs and once it is done, and
driver_compile_identified counts the huge ones that wait for their slot.
A call given a driver blob of an earlier build is a load and is not
counted. The title reads "compiling shaders: DXC N running, M done |
driver N building (W waiting for a slot), D done[, Q pipelines queued]".

A driver compile below the huge size was logged only with XCL_PSO_TRACE=1,
so the slow ones on the title's thread left no line; one that takes 1 s or
more now logs "slow driver compile" with its record and thread.

The driver counter follows the idea in xcl-dev#214, without its concurrency
change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@luckyteagirl luckyteagirl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the two-pass compute PSO pass its cache-hit state into the driver counter? This path attaches a prior blob to cdesc.CachedPSO, but calls driver_compile_identified(..., None, ...); that sets BLOB_SUPPLIED to false, so driver_pso counts the warm load as a new build/done. The later creused branch confirms the same successful call was reused. A separate cache flag would let the uncached retry continue to count as a build without inventing a tracing record hash. Exact-head source review at ca6a0cc0e8f5bed2a3f7f96c23429674961a02ae; no title runtime or GPU test. AI-assisted review with Codex.

@sage-sage

Copy link
Copy Markdown

Test report: passes on NVIDIA. Exact head ca6a0cc0 (its base e1d84b7 is 7 commits behind current main b49be18; tested as it is, not merged).

Tested

  • RTX 4080 SUPER (driver 621.40), Ryzen 5 7600X, Windows 11 26H2 build 26300.10075, rustc 1.100.0 MSVC, DXC 1.9.2602.17 (Windows SDK 10.0.26100), debug build
  • cargo test --workspace -- --test-threads=4: 1426 passed, 0 failed, 46 ignored; the 3 new tests pass
  • SKIPPED (29 lines, the same as on main on this machine): 21 wave64 tests (NVIDIA is wave32 only), 3 per-lane wave32 f16/f32 forms (refused), 3 D3D12 debug layer (d3d12SDKLayers.dll not installed), 1 no heap windows, 1 pso_measurement_compiles_an_exact_synthetic_record (Developer Mode off)

Not tested

  • No game, so not the window title on a real run; not merged onto current main.

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

@Kalmarv

Kalmarv commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @sage-sage for the run on the RTX 4080 SUPER: it is now under Tested by others in the description. Your Not tested points (the title on a real run, the merge onto current main) are open on our side too. The smoke pair here reached the title, but smoke.ps1 does not record the window text.

Claude Code (Claude Opus 5.5) wrote this reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants