Skip to content

[upstream #899] D3D12.X: log how long a bind waits for a pipeline still being built - #183

Closed
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/899
Closed

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/899

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 24, 2026

Copy link
Copy Markdown
Owner

A bind of a pipeline that is not built yet waits in resolve_wait, and builds it itself when no worker has started it – until it is built unless XCL_PSO_WAIT_MS sets a limit (xcl-dev#891), and with no trace in the log. On an NVIDIA GPU the retail title of xcl-dev#505 had its threads sit there for 3 – 23 s at a time in the driver's compiler; it took a profiler of the title's threads to see it, and the title's hang watchdog ended the run (xcl-dev#505, xcl-dev#675). This counts those waits and logs them, so a run's log says whether pipeline builds held the title up. Nothing else changes. Part of xcl-dev#505.

What is in it

  • crates/xcl/src/hle/d3d12x/pso_async.rs: resolve_wait counts the calls that found their pipeline not built, graphics and compute apart – how many, their total and longest time, how many built it in the call (blocked()). Logged at every power of two: pipelines waited for at a bind so far: N graphics (… ms, longest … ms, … built in the call), M compute (…); each wait of a second or more is logged on its own (the first 32). Tests: a_wait_that_builds_the_pipeline_is_counted_with_its_time, a_bounded_wait_is_counted_with_the_time_it_waited.
  • Rebased onto main with D3D12.X: XCL_PSO_WAIT_MS bounds how long a bind waits for a pipeline being built (retail world renders) xcl-dev/xcl#891: a wait with XCL_PSO_WAIT_MS is counted with the time it waited; the later binds of a late pipeline, which do not wait, are not.

Tested

Regression run
Both with XCL_COHERENT_MB=4095 (without it the window is 512 MB or 4 GB depending on the commit free at the start, #284), one after the other. main's run stood still at its end (0 presents in its last 6 s), with a higher peak commit; I did not look into why (likely cold shader compiles for that build, not checked). This change only counts and logs: it is not expected to make the title faster, and the PR's run shows it does not slow it down.

main:

xcl-smoke v1
commit: 6efdabcdaac93ce5cc123a85e85deba5d49cb294
gpu: NVIDIA GeForce RTX 5080
title: WALKING_SIM
seconds: 90
exit: 0x0
frames shown: 1644 (PresentX 1644)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 31451 MB

PR:

xcl-smoke v1
commit: f3b7dd6c36eb6faef589c27cd754e12566e2319f
gpu: NVIDIA GeForce RTX 5080
title: WALKING_SIM
seconds: 90
exit: 0x0
frames shown: 2502 (PresentX 2502)
presents per 2 s (last 3): 60 58 61
device removals: 0
crashes: 0
peak commit: 19462 MB

Not tested

  • AMD and Intel GPUs; other titles
  • The 90 s regression runs stay in the title's menus, where no bind waited: the counts and lines above come from the 240 s runs
  • A run with XCL_PSO_WAIT_MS set (the bounded path is covered by the test only)

AI use

  • Claude Code with Claude Opus 5.5: wrote the change and the tests, did the rebase, ran the tests and the runs, and wrote this description.

Mirror of xcl-dev#899 (auto-synced, do not edit).

A bind of a pipeline that is not built yet waits in resolve_wait, and
builds it itself when no worker has started it - until it is built unless
XCL_PSO_WAIT_MS sets a limit (xcl-dev#891), and with no trace in the log. On an
NVIDIA GPU a retail title's threads sat there for 3 - 23 s at a time in
the driver's compiler; it took a profiler of the title's threads to see
it, and the title's hang watchdog ended the run (xcl-dev#505, xcl-dev#675).

resolve_wait now counts the calls that found their pipeline not built,
for graphics and compute apart: how many, their total and longest time,
and how many built it in the call. A wait with a limit is counted with
the time it waited; a late pipeline's later binds, which do not wait, are
not. The counts are logged at every power of two, and each wait of a
second or more is logged (the first 32). Nothing else changes.

Measured with it on that title (RTX 5080, XCL_NETWORK=0, 240 s): 16
compute binds built their pipeline in the call, 92.7 s in all, the
longest 22.7 s; no graphics bind waited.

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

ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Upstream PR xcl-dev#899 was closed or merged.

@ufoptg ufoptg closed this Nov 25, 2026
@ufoptg
ufoptg deleted the upstream-pr/899 branch November 25, 2026 00:07
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.

2 participants