D3D12.X: with bounded pipeline waits, dispatches are not put off to the submit #2581

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

@⁠brothernog on GitHub · 2026-11-26 00:02 UTC · original
brothernog:bounded-wait-no-putoff → main · +13 −0 · 2 files · 1 commits · open

With XCL_PSO_WAIT_MS set, a dispatch whose pipeline is still being built is recorded at once instead of being put off to the submit (#2118). On an RTX 3050 with XCL_PSO_WAIT_MS=1, main lost the device in 2 of 2 runs right after the retail title's world start; with this change the title presented to the end of every 240 s run (4 runs, 0 device removals). The runs that led here and what they show about the stop after the world start are in a comment on #2088: #2088

What changes

  • list_x::defer returns false when pso_async::waits_bounded(), so Dispatch and a dispatching ExecuteIndirect with an unbuilt pipeline take the path they took before #2118: the bind waits at most XCL_PSO_WAIT_MS, then the call is skipped as a stand-in's.
  • Why: the submit's wait for a put-off call is bounded by the same XCL_PSO_WAIT_MS, so with a bound the put-off only moves the wait, and it costs a segment (a PC command list) per call. With XCL_PSO_WAIT_MS=1 the title's world start put off thousands of calls (the log's counter passed 8,192 in one run; up to 1,024 extra segments per list), the lists' Close returned E_OUTOFMEMORY (then E_FAIL), and the device was removed (0x887a0001, "invalid call").
  • The cost: with a large budget the title's thread waits again, which #2118 moved off it. Measured only with XCL_PSO_WAIT_MS=1.
  • Unset (the default): nothing changes. A default run put off over 1,024 calls with no Close failure.

Files

  • hle/d3d12x/pso_async.rs: waits_bounded().
  • hle/d3d12x/list_x.rs: the check at the top of defer.

Tested

  • RTX 3050 8 GB (desktop, Ryzen 7 5800XT, 32 GB), NVIDIA 610.88, Windows 11 build 26300, Rust 1.100.0 MSVC, DXC 1.9.2602.17.
  • On main 08db802 + this PR (d5d694b):
    • cargo test --release -p xcl --lib -- --test-threads=4: 1304 passed, 0 failed, 27 ignored.
    • cargo clippy --release -p xcl --all-targets: 838 warnings on 08db802 and on this branch.
  • In the title (A pressed at 25 s, 240 s per run, XCL_NETWORK=0 XCL_PAGE_BUDGET_MB=4096; XCL and NVIDIA caches warm from earlier runs):
tree XCL_PSO_WAIT_MS runs last present device removals
main e1d84b7 unset 1 136 s (0 presents after) 0
main e1d84b7 1 2 132 / 138 s 2 (0x887a0001, after Close → E_OUTOFMEMORY)
this change on e1d84b7 (0a3d310, with a second change switched off by XCL_SKIPPED_COMPUTE_GUARD=0) 1 2 238 / 238 s (end of run) 0
this change on e1d84b7 (0a3d310), unset, after all the runs above unset 1 112 s (0 presents after) 0
this PR (d5d694b) 1 2 238 / 236 s (end of run) 0 (no put-offs, no Close failure)

The default control was repeated last because driver blobs kept piling up over the runs: the title still stops with warm caches. Past that point, with XCL_PSO_WAIT_MS=1, the title records 1,000–10,000 dispatches per 2 s but presents only about every 2 s; that slow phase is not explained here.

Regression run
Default settings (XCL_PSO_WAIT_MS unset, where this PR changes nothing), back to back, main first, one run each; frame counts vary from run to run:

main 08db802:

xcl-smoke v1
commit: 08db8020d323bf478964fcc586152cce54959cfc
gpu: NVIDIA GeForce RTX 3050
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1544 (PresentX 1545)

This PR (d5d694b):

xcl-smoke v1
commit: d5d694b04b3e26abdef656af21c03d30a5027d9b
gpu: NVIDIA GeForce RTX 3050
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1559 (PresentX 1559)

Overlap

  • #2118 (merged) is the put-off this turns off when waits are bounded.
  • #2114 makes waits bounded by default while a title runs (250 ms per pipeline, 2 s per frame); #2001 and #1931 add a per-frame budget. With #2114 as it stands, the put-off and bounded waits meet in every default run. Whichever lands second should make waits_bounded() follow the new default.
  • #1652 also bounds waits per frame and skips pending calls; it conflicts with main now.

Not tested

  • XCL_PSO_WAIT_MS values other than 1; what the title draws with skipped dispatches; runs longer than 240 s.
  • AMD, Intel; Linux/Proton; cold caches.

AI use

  • Claude Code (Claude Opus 5.5): the runs, the change, the tests and this description. I checked the diff and the runs.

AI-assisted.

**@⁠brothernog** on GitHub · 2026-11-26 00:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/2581) `brothernog:bounded-wait-no-putoff` → `main` · +13 −0 · 2 files · 1 commits · open With `XCL_PSO_WAIT_MS` set, a dispatch whose pipeline is still being built is recorded at once instead of being put off to the submit (#2118). On an RTX 3050 with `XCL_PSO_WAIT_MS=1`, `main` lost the device in 2 of 2 runs right after the retail title's world start; with this change the title presented to the end of every 240 s run (4 runs, 0 device removals). The runs that led here and what they show about the stop after the world start are in a comment on #2088: https://git.gtahub.st/github/xcl-dev--xcl/issues/2088 **What changes** - `list_x::defer` returns `false` when `pso_async::waits_bounded()`, so `Dispatch` and a dispatching `ExecuteIndirect` with an unbuilt pipeline take the path they took before #2118: the bind waits at most `XCL_PSO_WAIT_MS`, then the call is skipped as a stand-in's. - Why: the submit's wait for a put-off call is bounded by the same `XCL_PSO_WAIT_MS`, so with a bound the put-off only moves the wait, and it costs a segment (a PC command list) per call. With `XCL_PSO_WAIT_MS=1` the title's world start put off thousands of calls (the log's counter passed 8,192 in one run; up to 1,024 extra segments per list), the lists' `Close` returned `E_OUTOFMEMORY` (then `E_FAIL`), and the device was removed (0x887a0001, "invalid call"). - The cost: with a large budget the title's thread waits again, which #2118 moved off it. Measured only with `XCL_PSO_WAIT_MS=1`. - Unset (the default): nothing changes. A default run put off over 1,024 calls with no `Close` failure. **Files** - `hle/d3d12x/pso_async.rs`: `waits_bounded()`. - `hle/d3d12x/list_x.rs`: the check at the top of `defer`. **Tested** - RTX 3050 8 GB (desktop, Ryzen 7 5800XT, 32 GB), NVIDIA 610.88, Windows 11 build 26300, Rust 1.100.0 MSVC, DXC 1.9.2602.17. - On `main` `08db802` + this PR (`d5d694b`): - `cargo test --release -p xcl --lib -- --test-threads=4`: 1304 passed, 0 failed, 27 ignored. - `cargo clippy --release -p xcl --all-targets`: 838 warnings on `08db802` and on this branch. - In the title (A pressed at 25 s, 240 s per run, `XCL_NETWORK=0 XCL_PAGE_BUDGET_MB=4096`; XCL and NVIDIA caches warm from earlier runs): | tree | `XCL_PSO_WAIT_MS` | runs | last present | device removals | |---|---|---|---|---| | `main` `e1d84b7` | unset | 1 | 136 s (0 presents after) | 0 | | `main` `e1d84b7` | 1 | 2 | 132 / 138 s | 2 (0x887a0001, after `Close` → `E_OUTOFMEMORY`) | | this change on `e1d84b7` (`0a3d310`, with a second change switched off by `XCL_SKIPPED_COMPUTE_GUARD=0`) | 1 | 2 | 238 / 238 s (end of run) | 0 | | this change on `e1d84b7` (`0a3d310`), unset, after all the runs above | unset | 1 | 112 s (0 presents after) | 0 | | this PR (`d5d694b`) | 1 | 2 | 238 / 236 s (end of run) | 0 (no put-offs, no `Close` failure) | The default control was repeated last because driver blobs kept piling up over the runs: the title still stops with warm caches. Past that point, with `XCL_PSO_WAIT_MS=1`, the title records 1,000–10,000 dispatches per 2 s but presents only about every 2 s; that slow phase is not explained here. **Regression run** Default settings (`XCL_PSO_WAIT_MS` unset, where this PR changes nothing), back to back, `main` first, one run each; frame counts vary from run to run: `main` `08db802`: ``` xcl-smoke v1 commit: 08db8020d323bf478964fcc586152cce54959cfc gpu: NVIDIA GeForce RTX 3050 title: retail-title seconds: 60 exit: 0x0 frames shown: 1544 (PresentX 1545) ``` This PR (`d5d694b`): ``` xcl-smoke v1 commit: d5d694b04b3e26abdef656af21c03d30a5027d9b gpu: NVIDIA GeForce RTX 3050 title: retail-title seconds: 60 exit: 0x0 frames shown: 1559 (PresentX 1559) ``` **Overlap** - #2118 (merged) is the put-off this turns off when waits are bounded. - #2114 makes waits bounded by default while a title runs (250 ms per pipeline, 2 s per frame); #2001 and #1931 add a per-frame budget. With #2114 as it stands, the put-off and bounded waits meet in every default run. Whichever lands second should make `waits_bounded()` follow the new default. - #1652 also bounds waits per frame and skips pending calls; it conflicts with `main` now. **Not tested** - `XCL_PSO_WAIT_MS` values other than 1; what the title draws with skipped dispatches; runs longer than 240 s. - AMD, Intel; Linux/Proton; cold caches. **AI use** - Claude Code (Claude Opus 5.5): the runs, the change, the tests and this description. I checked the diff and the runs. AI-assisted.
With XCL_PSO_WAIT_MS set, a dispatch whose pipeline is still being built
is recorded at once instead of being put off to the submit (#2118): its
bind waits at most XCL_PSO_WAIT_MS on the title's thread, as before. The
submit's wait has the same bound, so the put-off only moved it. With
XCL_PSO_WAIT_MS=1 a retail title's world start put off thousands of
calls, a segment each; its command lists ran out of memory (Close:
E_OUTOFMEMORY) and the device was removed (0x887a0001). Unset (the
default), nothing changes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:34:21 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 00:10 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:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/2581#issuecomment-7178477487) 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

@⁠itsSio on GitHub · 2026-11-26 04:45 UTC · original

Independent dual-PC NVIDIA full-workspace test report on clean head d5d694b04b3e26abdef656af21c03d30a5027d9b.

Tested

  • Machine 1: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200, rustc 1.97.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug build (XCL_ADAPTER=NVIDIA)
    • cargo build --workspace: exit 0
    • cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1429 passed, 0 failed, 47 ignored (all 14 existing pso_async/defer tests pass)
    • SKIPPED: 26 (wave64-only GPU tests, #1426 wave32 f16/cvt refusals, heap_window_out_of_memory_falls_back_to_the_switch_form, pso_measurement_compiles_an_exact_synthetic_record)
  • Machine 2: NVIDIA GeForce RTX 2080 SUPER (driver 32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200, rustc 1.99.1 (stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC 1.8.2502.11, debug build (XCL_ADAPTER=NVIDIA)
    • cargo build --workspace: exit 0
    • cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1429 passed, 0 failed, 47 ignored (all 14 existing pso_async/defer tests pass)
    • SKIPPED: 29 (same 26 as Machine 1 plus 3 requiring d3d12SDKLayers.dll)

Not tested

  • Retail title / scripts/smoke.ps1 runs (including bounded-wait behavior under XCL_PSO_WAIT_MS)
  • Release builds (--release)
  • AMD / Intel GPUs, native wave64, Linux / Wine / vkd3d-proton

AI use
Ran via Samaritan:

  • Google Antigravity CLI (Claude Opus 5.5 (High)): built the branch and ran the workspace test suite on both NVIDIA machines.
  • Google Antigravity CLI (Gemini 4 Neon (High)): coordinated the runs and wrote this test report.
**@⁠itsSio** on GitHub · 2026-11-26 04:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/2581#issuecomment-7182882304) Independent dual-PC NVIDIA full-workspace test report on clean head `d5d694b04b3e26abdef656af21c03d30a5027d9b`. **Tested** - **Machine 1:** NVIDIA GeForce RTX 5080 (driver `32.0.16.1088`), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200, `rustc 1.97.0` (`stable-x86_64-pc-windows-msvc`), DXC `1.9.2609.5`, debug build (`XCL_ADAPTER=NVIDIA`) - `cargo build --workspace`: exit 0 - `cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture`: **1429 passed, 0 failed, 47 ignored** (all 14 existing `pso_async`/defer tests pass) - `SKIPPED`: 26 (wave64-only GPU tests, `#1426` wave32 f16/cvt refusals, `heap_window_out_of_memory_falls_back_to_the_switch_form`, `pso_measurement_compiles_an_exact_synthetic_record`) - **Machine 2:** NVIDIA GeForce RTX 2080 SUPER (driver `32.0.16.1088`), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200, `rustc 1.99.1` (`stable-x86_64-pc-windows-msvc`), Windows SDK 10.0.26100 DXC `1.8.2502.11`, debug build (`XCL_ADAPTER=NVIDIA`) - `cargo build --workspace`: exit 0 - `cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture`: **1429 passed, 0 failed, 47 ignored** (all 14 existing `pso_async`/defer tests pass) - `SKIPPED`: 29 (same 26 as Machine 1 plus 3 requiring `d3d12SDKLayers.dll`) **Not tested** - Retail title / `scripts/smoke.ps1` runs (including bounded-wait behavior under `XCL_PSO_WAIT_MS`) - Release builds (`--release`) - AMD / Intel GPUs, native wave64, Linux / Wine / vkd3d-proton **AI use** Ran via Samaritan: - Google Antigravity CLI (Claude Opus 5.5 (High)): built the branch and ran the workspace test suite on both NVIDIA machines. - Google Antigravity CLI (Gemini 4 Neon (High)): coordinated the runs and wrote this test report.
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/2581/head:github-bot/gh-2581'
git switch 'github-bot/gh-2581'

Merge

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