Skip to content

D3D12.X: a build a submit waits for is wanted from the moment its call is put off - #2579

Open
Royalflamejlh wants to merge 1 commit into
xcl-dev:mainfrom
Royalflamejlh:fix/submit-wanted
Open

Royalflamejlh wants to merge 1 commit into
xcl-dev:mainfrom
Royalflamejlh:fix/submit-wanted

Conversation

@Royalflamejlh

@Royalflamejlh Royalflamejlh commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

A pipeline that a put-off call needs (#2118) is wanted from the moment the call is put off, not from the moment the submit reaches it. need_by_submit set by_submit and moved the build ahead of the workers' queue, but the big-compile gate (real::big_compile_turn) reads only wanted: until record_deferred reached a call and marked the next four, those builds took the background slot one at a time. Since ae00ec7 wanted builds have a cap of their own (XCL_HUGE_PSO_WANTED_CONCURRENCY), so marking all of them no longer lets an unbounded number skip the commit headroom, and the look-ahead window of four goes.

What is in it

  • pso_async.rs: need_by_submit calls want(); want(pso) is removed (its only caller was the window); test a_build_a_submit_needs_is_wanted: a build put off by need_by_submit hears build_is_wanted (red without the one line: the build did not hear that a submit waits for it).
  • list_x.rs: record_deferred no longer marks the next four (WANTED_AT_ONCE removed).
  • bind.rs: want_bound removed.

Tested

pair without with this
1 1,079 s over 48 builds 161 s over 67 builds
2 1,064 s over 46 builds 342 s over 64 builds
3 stopped at 125 s with 3 GB of memory available; not counted 219 s over 66 builds
  • No run drew a frame after its world-start burst within 300 s: the cold builds last longer than that on this card in all of them. No error line, no queue.Wait timeout, no device removal in any.
  • The least available system memory: 12, 7 and 8 GB with the change, 13 and 13 GB without (and the third run without, above). More builds run at once with it, each without the commit headroom, as a wanted build had before.

Regression run
Under Wine on Linux (RTX 4060 Ti; scripts/smoke.ps1 unchanged, run by PowerShell 7 with xcl.exe started through Wine: "peak commit" reads 0 MB there, exit: 0x89 is the wrapper ending Wine after XCL's own process ends, and RTX 4060 Ti 8GB is the name vkd3d-proton gives this 16 GB card).

main:

xcl-smoke v1
commit: 08db8020d323bf478964fcc586152cce54959cfc
gpu: NVIDIA GeForce RTX 4060 Ti 8GB
title: 1253b9d5
seconds: 60
exit: 0x89
frames shown: 1328 (PresentX 1328)
presents per 2 s (last 3): 60 59 60
device removals: 0
crashes: 0
peak commit: 0 MB

PR:

xcl-smoke v1
commit: 93445592be144d697a0ba2323112a028502e8213
gpu: NVIDIA GeForce RTX 4060 Ti 8GB
title: 1253b9d5
seconds: 60
exit: 0x89
frames shown: 1578 (PresentX 1578)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

Not tested

  • A run in which this change lets the first world frame out sooner: in our runs the first frame needs more than 300 s of builds either way.
  • AMD, Intel; the 16 GB Windows card; the whole suite on Windows.
  • XCL_HUGE_PSO_WANTED_CONCURRENCY at its default (2): the runs used 6.
  • nvidia-dev: this does not apply there, as nvidia-dev (c044dc6d) does not have D3D12.X: a dispatch waits for its pipeline at the submit, not in the bind #2118, which this follows.

AI use

  • Claude Code (Claude Opus 5.5) wrote the change, the test and this description, and made the runs. Another Claude Code session (Bench E) found the cause in the gate waits.

…l is put off

need_by_submit marked a put-off call's pipeline by_submit and moved it
ahead of the workers' queue, but not wanted, and the big-compile gate
reads only wanted: until record_deferred reached the call and marked the
next four, those builds went through the gate one at a time, behind the
background slot. In a retail title's world start on Linux (RTX 4060 Ti,
with xcl-dev#2404 and xcl-dev#2333) the put-off builds spent 3,153 s waiting at the
gate against 320 s in the driver.

Since ae00ec7 wanted builds have a hard cap of their own
(XCL_HUGE_PSO_WANTED_CONCURRENCY), so marking them all at once no longer
lets an unbounded number skip the commit headroom; the look-ahead window
of four in record_deferred, and want/want_bound behind it, go.

Found by reading the gate waits of Bench E's runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Royalflamejlh
Royalflamejlh marked this pull request as ready for review November 26, 2026 00:02
@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 26 ignored.

Thanks!

— Devin

gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 26, 2026
…ixes

Integrates upstream amd-dev 61121fe/xcl-dev#2569 (DirectStorage ordered completion
wakeups) plus open PRs xcl-dev#2577 (skip AMD cache-reference driver blobs on disk,
xcl-dev#2512), xcl-dev#2578 (clear LAST_CONTENT on placed texture unmap/remap, xcl-dev#2460),
xcl-dev#2579 (mark put-off builds wanted immediately), xcl-dev#2556 (NULL-ppv
CreateDescriptorHeap test), xcl-dev#2550 (skipped ExecuteIndirect occlusion query),
xcl-dev#2549 (reused spare keeps in-flight deferred allocator, with Wine raw fences
and UnadoptGuard), and xcl-dev#2548 (Reset/KickoffX/CreateCommandList do not wait on
building compute pipelines).

Assisted-by: Antigravity (Gemini 4 Neon)
@oni-swr

oni-swr commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Test report for 93445592be144d697a0ba2323112a028502e8213, with its exact parent 08db8020d323bf478964fcc586152cce54959cfc as the control. Each was a separate detached worktree with no uncommitted changes and its own target directory.

Tested

  • AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Ryzen 7 5700X3D, 64 GB, Windows 11 build 26200, rustc / cargo 1.100.0, debug. XCL_ADAPTER=radeon and XCL_REQUIRE_GPU=wave64,mesh were set.
  • cargo build --workspace -j 4: exit 0 on both.
  • cargo test --workspace -j 4 --no-fail-fast -- --test-threads=4:
    • head: 1428 passed, 2 failed, 47 ignored (lib 1304 / 1 / 27)
    • parent: 1427 passed, 2 failed, 47 ignored (lib 1303 / 1 / 27)
    • The +1 is the new test. Every other binary has the same counts on both.
  • The same two tests fail on both, with the same messages:
  • SKIPPED: 6 lines, the same on both. They are the f16_programs_on_the_gpu / f32_programs_on_the_gpu per-lane forms refused for V_MUL_F16, V_PK_MUL_F16 and V_CVT_F16_F32 (gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics), in wave32 and wave64.
  • Focused run, cargo test -j 4 -p xcl --lib -- pso_async:: list_x:: bind:: --test-threads=4: head 63 passed, parent 62 passed, 0 failed on both.
  • a_build_a_submit_needs_is_wanted on head: passed in 5 of 5 separate runs.
  • The parent with only that test added (the test hunk of pso_async.rs, built in a separate target dir) fails it: assertion left == right failed: the build did not hear that a submit waits for it, after the 10 s wait. So the test is red without the one-line change on this adapter.

Not tested

  • scripts/smoke.ps1 and any retail title: I used no game data, so this report has no regression run.
  • Release builds, the default XCL_HUGE_PSO_WANTED_CONCURRENCY, and timing of the big-compile gate.

AI use

  • Claude Code (Claude Opus 5.5) made the runs and wrote this report; Codex (gpt-6.2-sol) coordinated the run.

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