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

Open
github-bot wants to merge 1 commit from github-bot/gh-2579 into main AGit
Owner

@⁠Royalflamejlh on GitHub · 2026-11-25 23:52 UTC · original
Royalflamejlh:fix/submit-wanted → main · +26 −20 · 3 files · 1 commits · open

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

  • Linux through Wine: NVIDIA GeForce RTX 4060 Ti 16 GB (driver 615.71.09), Ryzen 9 9950X3D, 62 GB RAM, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175, rustc 1.98.0, release, x86_64-pc-windows-gnu.
  • cargo test --workspace --release --target x86_64-pc-windows-gnu --no-fail-fast -- --test-threads=4: lib 1300 passed, 3 failed, 27 ignored on this head against 1299, 3, 27 on main 08db802; the other binaries 122 passed, 3 failed, 20 ignored on both. The same six fail on both (directed_reference_basics, f64_programs_on_the_gpu, gpu_promoted_uav_clear_values_pass_create_committed_resource, disk_free_space_ex_reports_pls_quota, set_predication_buffer_state_and_kickoff, test_title_runs_and_game_folder_is_untouched). Two lib tests are skipped as they hang under Wine (#1706).
  • Native Windows, NVIDIA GeForce RTX 2070 SUPER 8 GB, Windows 11: cargo test --workspace -- pso_async:: list_x:: title_list:: bind:: alloc_pool:: dispatch_chain --test-threads=4 in debug, 80 passed, 0 failed; scripts/smoke.ps1: 745 frames against 770 on main 08db802, both exit 0x0, 0 device removals, 0 crashes.
  • The retail title, 300 s, 1 run per cell, A pressed when the title takes it, XCL_DIRECT_DXIL=1 XCL_HUGE_PSO_WANTED_CONCURRENCY=6 XCL_PSO_DISK_CACHE=0 XCL_DXC_THREADS=4, no XCL_PSO_WAIT_MS. The tree is a local merge of main e0d93c8 with #684, #751, #2082, #1860, #1599, #1798, #2404 and #2333 (so the split ExecuteIndirects are chained, not built on the title's thread), with and without this change. Each run starts from its own copy of one NVIDIA shader-cache folder (filled by one earlier run). Time the compute builds spent waiting at the big-compile gate after the first #101, summed from the driver compile finish lines:
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 #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.
**@⁠Royalflamejlh** on GitHub · 2026-11-25 23:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/2579) `Royalflamejlh:fix/submit-wanted` → `main` · +26 −20 · 3 files · 1 commits · open 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** - Linux through Wine: NVIDIA GeForce RTX 4060 Ti 16 GB (driver 615.71.09), Ryzen 9 9950X3D, 62 GB RAM, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175, rustc 1.98.0, release, `x86_64-pc-windows-gnu`. - `cargo test --workspace --release --target x86_64-pc-windows-gnu --no-fail-fast -- --test-threads=4`: lib 1300 passed, 3 failed, 27 ignored on this head against 1299, 3, 27 on `main` `08db802`; the other binaries 122 passed, 3 failed, 20 ignored on both. The same six fail on both (`directed_reference_basics`, `f64_programs_on_the_gpu`, `gpu_promoted_uav_clear_values_pass_create_committed_resource`, `disk_free_space_ex_reports_pls_quota`, `set_predication_buffer_state_and_kickoff`, `test_title_runs_and_game_folder_is_untouched`). Two lib tests are skipped as they hang under Wine (#1706). - Native Windows, NVIDIA GeForce RTX 2070 SUPER 8 GB, Windows 11: `cargo test --workspace -- pso_async:: list_x:: title_list:: bind:: alloc_pool:: dispatch_chain --test-threads=4` in debug, 80 passed, 0 failed; `scripts/smoke.ps1`: 745 frames against 770 on `main` `08db802`, both exit 0x0, 0 device removals, 0 crashes. - The retail title, 300 s, 1 run per cell, A pressed when the title takes it, `XCL_DIRECT_DXIL=1 XCL_HUGE_PSO_WANTED_CONCURRENCY=6 XCL_PSO_DISK_CACHE=0 XCL_DXC_THREADS=4`, no `XCL_PSO_WAIT_MS`. The tree is a local merge of `main` `e0d93c8` with #684, #751, #2082, #1860, #1599, #1798, #2404 and #2333 (so the split `ExecuteIndirect`s are chained, not built on the title's thread), with and without this change. Each run starts from its own copy of one NVIDIA shader-cache folder (filled by one earlier run). Time the compute builds spent waiting at the big-compile gate after the first `#101`, summed from the `driver compile finish` lines: | 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 #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.
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 #2404 and #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 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:34:18 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 00:08 UTC · original

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

**@⁠DavidM1911** on GitHub · 2026-11-26 00:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/2579#issuecomment-7178431897) 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
Author
Owner

@⁠oni-swr on GitHub · 2026-11-26 02:36 UTC · original

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:
    • gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: seed 722: res[30] = 0x1, CPU 0x7fffffff, on 3 of 3 reruns on each commit (#2115).
    • heap_window_out_of_memory_falls_back_to_the_switch_form (gpu_compute_e2e): no heap windows, but XCL_REQUIRE_GPU=wave64,mesh (#1651). Without XCL_REQUIRE_GPU, it prints SKIPPED …: no heap windows and gpu_compute_e2e is 6 passed, 0 failed on both.
  • 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 (#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.
**@⁠oni-swr** on GitHub · 2026-11-26 02:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/2579#issuecomment-7180964978) 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: - `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: `seed 722: res[30] = 0x1, CPU 0x7fffffff`, on 3 of 3 reruns on each commit (#2115). - `heap_window_out_of_memory_falls_back_to_the_switch_form` (`gpu_compute_e2e`): `no heap windows, but XCL_REQUIRE_GPU=wave64,mesh` (#1651). Without `XCL_REQUIRE_GPU`, it prints `SKIPPED …: no heap windows` and `gpu_compute_e2e` is 6 passed, 0 failed on both. - `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 (#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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2579/head:github-bot/gh-2579'
git switch 'github-bot/gh-2579'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2579'
git switch 'github-bot/gh-2579'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2579'
git switch 'github-bot/gh-2579'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2579'
git switch 'main'
git merge --squash 'github-bot/gh-2579'
git switch 'main'
git merge --ff-only 'github-bot/gh-2579'
git switch 'main'
git merge 'github-bot/gh-2579'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.