Skip to content

D3D12.X: a recorded draw's pipeline wait honours XCL_GFX_PSO_WAIT_MS again - #3318

Draft
Prime1997 wants to merge 5 commits into
xcl-dev:mainfrom
Prime1997:contrib/gfx-pso-wait-draws
Draft

Prime1997 wants to merge 5 commits into
xcl-dev:mainfrom
Prime1997:contrib/gfx-pso-wait-draws

Conversation

@Prime1997

@Prime1997 Prime1997 commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Prime

Since the pinned one-shot pipelines for draws (ed5e9e4), a recorded draw resolves its pipeline through resolve_retained_for_emission, which waited by XCL_PSO_WAIT_MS alone. The graphics budget (XCL_GFX_PSO_WAIT_MS, a thread's share of each second) and the compute budget (XCL_CS_PSO_WAIT_MS) were read only by resolve_wait, which no draw reaches any more: with only XCL_GFX_PSO_WAIT_MS set, draws again waited until their pipeline was built.

Both paths now choose their budget in resolve_pending_budgets. With no budget set nothing changes: a draw still waits until its pipeline is built.

The second commit does the same for the binds and indirect draws that pin their pipeline, which still waited by XCL_PSO_WAIT_MS alone (unset by default: until the pipeline was built): resolve_and_pin_pending (in Wait mode, and in ForBind mode for a compute pipeline), resolve_wait_bound_and_pin and resolve_for_indirect. In a GTA VI session on the PC below with XCL_GFX_PSO_WAIT_MS=100 and the first commit, threads still waited up to 103 s for graphics pipelines (161 waits of 1 s or more).

The fourth commit keeps a pinned dispatch on XCL_PSO_WAIT_MS alone, as before (pinned_wait_budgets): bounding it by XCL_CS_PSO_WAIT_MS too, as the second commit first did, skipped 300-315 compute passes a session in a retail world on that PC (2-12 before), and one of two runs ended in a GPU hang (0x887A0005, no page fault, no breadcrumbs). The native compute bind (select_for_native_bind) is unchanged. The third and fifth commits change the budget test only. The third to fifth commits correct the second and are to be squashed into it before review.

What is in it

  • crates/xcl/src/hle/d3d12x/pso_async.rs (first commit): resolve_pending_budgets (the budget choice of resolve_wait_budgets for a Pending already in hand), called by resolve_wait_budgets and by resolve_retained_for_emission; the budget test in used_tests also checks a retained draw (not waited for past the graphics budget) and a retained dispatch (waited for)
  • crates/xcl/src/hle/d3d12x/pso_async.rs (second and fourth commits): WaitBudgets and pinned_wait_budgets (a graphics pipeline: the XCL_GFX_PSO_WAIT_MS share; a compute one: XCL_PSO_WAIT_MS only), used by resolve_and_pin_pending_budgets (called by resolve_and_pin_pending), resolve_wait_bound_and_pin and resolve_for_indirect; the budget test also checks a pinned bind (not waited for past the graphics budget) and that a pinned dispatch gets no compute budget
  • crates/xcl/src/hle/d3d12x/pso_async.rs (third and fifth commits, test only): the budget test no longer pins a fake compute result, and waits (at most 10 s) for each fake build to end before releasing it: either had crashed the library test process

Tested

  • RTX 3060 Ti 8 GB (driver 32.0.16.1714), Intel Core i5-10400, 32 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0; the suite in debug, the smoke on a release build of the head commit
  • cargo test --workspace --no-fail-fast -- --test-threads=4 with the three uma_driver tests below skipped, on f549647: 2605 passed, 0 failed, 49 ignored (SKIPPED GPU tests: 28 lines: 21 no wave64 (this card runs wave32), 3 a wave32 per-lane form refused by the translator (gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426), 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1), 1 no dxc.exe, 1 cannot disable the driver cache (needs Windows Developer Mode))
  • the three skipped tests on their own (cargo test -p xcl --lib -- --test-threads=1 uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment uma_driver::tests::failed_restore_stops_before_importing_an_unbacked_window): 3 passed, 0 failed. They are left out of the whole run because on this PC's driver they can end the library test process (exit 0x7c10003, "coherent window could not be restored"), on main too
  • the library harness twice more (cargo test -p xcl --lib -- --test-threads=4, same skips): 2466 passed, 0 failed; 2466 passed, 0 failed
  • the same whole run on main fa20459: 2605 passed, 0 failed, 49 ignored, 28 SKIPPED lines (own-prs-20261129 run, same command)
  • retail title (60 s scripts/smoke.ps1, no input, copied profile and shader cache): blocks below
  • world-load runs of GTA VI (420 s on a hidden desktop, copied profile and shader cache, no input; XCL_GFX_PSO_WAIT_MS=100 XCL_CS_PSO_WAIT_MS=100) of a batch of this branch with ten other changes: with the second commit (batch 49f78cb) 300 "its dispatches are skipped" lines and a GPU hang at 362 s; with the fourth commit (batch e686362) 3-13 such lines and no device removal in 3 of 3 runs, but no drawn world, because a pinned dispatch still waits until its pipeline is built (16-141 s at a time) when XCL_PSO_WAIT_MS is unset; with XCL_PSO_WAIT_MS=2000 the world ran (69 frames, 0 device removals, 72 such lines)

Regression run

xcl-smoke v1
commit: fa204595a488c60c6c5f905244f0172072c9c2a9
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 1334 (PresentX 1334)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 15272 MB
xcl-smoke v1
commit: f54964792b965e2de7ba002753a70ddd52bddeda
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 1354 (PresentX 1354)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 15297 MB

Not tested

  • AMD GPUs (this is an NVIDIA wave32 card)
  • the retail title's world: the 60 s runs end on the title's start-up screens
  • The 60 s smoke runs use the defaults (no XCL_GFX_PSO_WAIT_MS), so they do not reach the changed budget path. The world-load runs under Tested set the budgets but are of a batch with ten other changes, not of this branch alone.

AI use

  • Claude Code wrote the change and the test lines, wrote this description, and ran the tests and the smoke runs on this PC. The model is not named here: this session cannot tell which model served each turn.

Optional temporary Discord for coordinating contributor work, testing and comparing results.

🤖 Generated with Claude Code

…again

Since the pinned one-shot pipelines for draws (ed5e9e4), a draw resolves its pipeline
through resolve_retained_for_emission, which waited by XCL_PSO_WAIT_MS alone. The graphics
budget (XCL_GFX_PSO_WAIT_MS, a thread's share of a second) and the compute budget
(XCL_CS_PSO_WAIT_MS) were only read by resolve_wait, which no draw reaches any more: with
only XCL_GFX_PSO_WAIT_MS set, draws again waited until every pipeline was built.

resolve_pending_budgets is resolve_wait_budgets for a Pending in hand; both paths use it.
Defaults are unchanged: with no budget set, a draw still waits until its pipeline is built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaZV7vMq866ni7pGnJC2Ew
@Prime1997 Prime1997 self-assigned this Nov 29, 2026
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:shaders Shader cache, PSO compilation, pipeline libraries, precompilation gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Nov 29, 2026
@andrewDoing

Copy link
Copy Markdown
Contributor

One useful bound to document for the restored graphics path: XCL_GFX_PSO_WAIT_MS is a per-thread refill rate with an initial full bucket. It is not a rolling-window cap, and time spent blocked itself refills the bucket. With 500 ms configured, one newly started recording thread can spend almost the entire first second waiting on distinct cold draws, even without any other work between them.

I exercised the exact resolve_pending_budgets, gfx_wait_left/spent and budget_for logic from ca7fa01 with a deterministic monotonic clock and a wait backend that either returned ready immediately or consumed precisely the offered timeout. Eight consecutive distinct graphics timeouts received 500, 250, 125, 62.5, 31.25, 15.625, 7.812, 3.906 ms: 996.093 ms total, versus 4,000 ms for eight independent full allowances. Eight ready graphics pipelines consumed zero simulated time. With the same graphics setting, a 30 ms compute override and a 700 ms general fallback, eight distinct compute timeouts consumed 240 ms, confirming the separate per-dispatch bound. A fresh recording thread starts its own bucket.

This is consistent with restoring the existing token bucket; it matters for interpreting first-frame or per-present wait totals. I'd spell out initial burst plus refill when documenting the switch. These are offered-budget controls, not native driver timings, and worker/admission priority in #3307/#3284 is separate. OpenAI Codex prepared and ran the CPU control and drafted this note.

@Aniseto

Aniseto commented Nov 29, 2026

Copy link
Copy Markdown

Ran the graphics-budget selection test at ca7fa013 on an NVIDIA Blackwell desktop part:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=NVIDIA cargo test -p xcl --lib the_graphics_budget_is_a_threads_for_a_second -- --test-threads=1
1 passed; 0 failed; 0 ignored; 0 measured; 2497 filtered out      (exit 0)

The test passes: a retained draw is not waited for past the graphics budget while a retained dispatch still uses the compute budget. The PR is a draft and its thread has only a note about the budget's initial refill; this adds a Blackwell datapoint on driver 32.0.16.2140. It is a CPU-side budget-selection test, not a title wait measurement.

Not tested: a retail title, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

… too

With XCL_GFX_PSO_WAIT_MS=100 and XCL_CS_PSO_WAIT_MS=100, GTA VI's threads on an RTX 3060 Ti
still waited for pipelines up to 103 s (161 waits over 1 s, median 2.9 s): besides the draw
path fixed in the previous commit, a bind that pins its pipeline (resolve_and_pin_pending, in
Wait mode and for a compute pipeline in ForBind mode), an ExecuteIndirect pipeline
(resolve_for_indirect) and a native compute bind (select_for_native_bind) waited by
XCL_PSO_WAIT_MS alone, which is unset by default: until the pipeline was built. They all go
through resolve_pending_budgets now (the native bind only waits for compute: by
XCL_CS_PSO_WAIT_MS, else XCL_PSO_WAIT_MS). Defaults are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaZV7vMq866ni7pGnJC2Ew
@Aniseto

Aniseto commented Nov 29, 2026

Copy link
Copy Markdown

Re-ran the graphics-budget test at ad569ed5 after the head moved from ca7fa013; this is a new response in the same thread, not an edit of my earlier report: #3318 (comment)

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=NVIDIA cargo test -p xcl --lib the_graphics_budget_is_a_threads_for_a_second -- --test-threads=1
1 passed; 0 failed; 0 ignored; 0 measured; 2497 filtered out      (exit 0)

The test still passes at the new head: a retained draw is not waited for past the graphics budget while a retained dispatch still uses the compute budget. This adds the new head and driver 32.0.16.2140 as dimensions; it is a CPU-side budget test, not a title wait measurement.

Not tested: a retail title, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

ad569ed's test waited for a compute pipeline whose fake build result (0x6A6A) was then pinned
as a real one (pin_one_shot AddRefs it), so the library harness died with a misaligned
pointer dereference at 0x6a6a on the RTX 3060 Ti, 2 runs of 2. The dispatch now gets a compute
budget and comes back as its stand-in, which is not pinned: the same bound ad569ed adds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaZV7vMq866ni7pGnJC2Ew
@Aniseto

Aniseto commented Nov 29, 2026

Copy link
Copy Markdown

Re-ran the graphics-budget test at 665d4e25 after the head moved from ad569ed5; this is a new response in the same thread, not an edit of my earlier report: #3318 (comment)

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=NVIDIA cargo test -p xcl --lib the_graphics_budget_is_a_threads_for_a_second -- --test-threads=1
1 passed; 0 failed; 0 ignored; 0 measured; 2497 filtered out      (exit 0)

The test still passes at the new head, which only changes a test fixture so it never pins a fake pipeline. This adds the new head and driver 32.0.16.2140 as dimensions. CPU-side budget test, not a title wait measurement.

Not tested: a retail title, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

ad569ed also bounded pinned compute binds by XCL_CS_PSO_WAIT_MS. In a retail world on an
RTX 3060 Ti, "its dispatches are skipped" then came 300-315 times a session (2-12 on the
build before), and one of two runs ended in a GPU hang (0x887A0005, no page fault, no
breadcrumbs): a skipped pass can leave work a later pass waits on. The long waits that change
was for were all on graphics pipelines, so a pinned dispatch goes back to XCL_PSO_WAIT_MS
alone (pinned_wait_budgets) and only graphics binds and indirect draws keep the
XCL_GFX_PSO_WAIT_MS share. The native compute bind is back as it was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaZV7vMq866ni7pGnJC2Ew
@Aniseto

Aniseto commented Nov 29, 2026

Copy link
Copy Markdown

Re-ran the graphics-budget test at 559ff553 after the head moved from 665d4e25; this is a new response in the same thread, not an edit of my earlier report: #3318 (comment)

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=NVIDIA cargo test -p xcl --lib the_graphics_budget_is_a_threads_for_a_second -- --test-threads=1
1 passed; 0 failed; 0 ignored; 0 measured; 2497 filtered out      (exit 0)

The test still passes at the new head, whose commit restores the previous behaviour for a pinned dispatch. The test also asserts that a retained draw stays within the graphics budget and a retained dispatch uses the compute budget. This adds the new head and driver 32.0.16.2140 as dimensions. CPU-side test, not a title wait measurement.

Not tested: a retail title, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

A build released before it ends is orphaned, and its worker then releases
the result. The fake results in this test are not real objects, so the
worker's release crashed the library test process. Wait (bounded) for each
build to finish before releasing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaZV7vMq866ni7pGnJC2Ew
@Aniseto

Aniseto commented Nov 29, 2026

Copy link
Copy Markdown

Re-ran the graphics-budget test at f5496479 after the head moved from 559ff553; this is a new response in the same thread, not an edit of my earlier report: #3318 (comment)

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=NVIDIA cargo test -p xcl --lib the_graphics_budget_is_a_threads_for_a_second -- --test-threads=1
1 passed; 0 failed; 0 ignored; 0 measured; 2497 filtered out      (exit 0)

The test still passes at the new head, which only changes how the test waits for its fake builds before releasing them. This adds the new head and driver 32.0.16.2140 as dimensions. CPU-side budget test, not a title wait measurement.

Not tested: a retail title, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

@minimalhipster990

Copy link
Copy Markdown

Retail run with XCL_GFX_PSO_WAIT_MS=50 on RTX 4090: at the current head f5496479 the title reaches its world in 2 of 2 runs. On main it reached it in 0 of 8. This covers the case the description lists as not measured.

Setup

  • RTX 4090, NVIDIA 621.40, Windows 11 build 26300, Rust 1.99.1. Release builds with --locked:
    • main 7a649b0e7341c1daf1bcf2f3101e9518a8a8c16f.
    • The current head f54964792b965e2de7ba002753a70ddd52bddeda merged onto that main (clean merge, git diff --check clean), giving local merge commit 27853b44.
    • The earlier head ad569ed57e8b2bec41817a53dae312a49105887b merged the same way (ce8c60cf), run before the head moved.
  • cargo test --release --locked -p xcl --lib -- the_graphics_budget_is_a_threads_for_a_second --test-threads=1: 1 passed, 0 failed on each merged tree.
  • Retail title (Series X profile), the same save and inputs, 600 s per run, XCL_GFX_PSO_WAIT_MS=50 XCL_CS_PSO_WAIT_MS=200 XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_COHERENT_HEAPS=sparse XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=3990 XCL_TWO_PASS_MB=3072. XCL_PSO_WAIT_MS and XCL_DIRECT_DXIL were unset.
  • Every run below started from a verified copy of the same warm XCL cache (from an earlier main run). The NVIDIA driver cache was left to the driver. The main and ad569ed5 runs were run in ABBA order. The two f5496479 runs came after them, back to back.

Results

"World" means the first 2 s XCL_ACTIVITY interval with 10,000 or more draws. The budget line (still being built after … ms) is logged for the first 16 events and then at powers of two, so the line count is a sample. The last counter value is in brackets.

run world at after it budget lines graphics waits over 1 s compute programs skipped end
main A – (last present 134.6 s) – 0 23 (51.4 s in all) 0 device removed at 143.7 s
ad569ed5 A 209.5 s 2.9 presents/s, ~4,800 draws per present 21 (257) 0 193 device removed at 566.2 s
ad569ed5 B 168.7 s 0.8 presents/s, ~3,300 draws per present 22 (513) 0 102 device removed at 189.7 s
main B – (last present 126.5 s) – 0 8 (31.1 s in all) 0 device removed at 133.4 s
f5496479 A 320.5 s 0.9 presents/s, ~5,000 draws per present 21 (257) 0 15 device removed at 417.0 s (the process then hung and was stopped by the harness)
f5496479 B 239.6 s 1.2 presents/s, ~5,100 draws per present 20 (129) 0 2 device removed at 256.8 s

"Compute programs skipped" counts the compute pipeline of record … not built after 200 ms: its dispatches are skipped lines (one per program).

  • At ad569ed5 a pinned dispatch also stopped waiting after XCL_CS_PSO_WAIT_MS. So those two runs skipped 102–193 compute programs, against 0 on main, and do not isolate the graphics budget.
  • At f5496479 pinned dispatches wait as before: 15 and 2 programs skipped. Those runs logged 17 and 15 compute pipeline waits (214 s and 65 s in all) and reached the world later, but still with no graphics wait over 1 s.

With the same budget, six earlier main runs never reached the world either, whether XCL_DIRECT_DXIL was unset or 1. Each had 0 budget lines and 3–197 graphics waits over 1 s. The captured frames show an interior (a figure at a window) with the PR, and loading artwork on main.

Device removals. These are not caused by this PR, as far as I can tell. All 6 removals in this table, and 3 of the 6 earlier main runs, ended with system commit almost exhausted: 1.2–5.4 GB left at removal (53.8–58.3 GB in use). DRED had no breadcrumbs. Process commit was 42–46 GB at the last memory report, 33–36 GB of it in other. The PR runs last longer, so they reach the same memory limit later in the world.

Not tested: the full workspace suite (only the budget test above), AMD, the XCL_PSO_REBUILD_RECIPES / pressure-policy paths this PR also changes, and runs without XCL_GFX_PSO_WAIT_MS. With that variable unset the PR's description says nothing changes, and I did not check it. Two runs per tree, so the arrival times are rough: they vary a lot from run to run.

AI use: Claude Code (Claude Opus 5.5) built the trees, ran the tests and the replays, and wrote this report. The person running these tests asked for it.

@KOLESNiii KOLESNiii 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.

Static review of 665d4e25 for the stack in the #3041 comparison.

A compute-only wait budget can bring back command-list splitting in the measured revision. With only XCL_CS_PSO_WAIT_MS set, native compute bind can time out and leave an initial pipeline pending. The retained deferral guard still checks only XCL_PSO_WAIT_MS. With allocator pooling enabled, repeated dispatches can split the recording while that build remains pending. The guard's comment records prior command-list memory exhaustion from repeated splitting under short budgets. This concerns 665d4e25, before the later pinned-dispatch fixes described in the PR. Native bind ?? Deferral guard

Review assisted by Codex (GPT-6, exact variant unavailable). No new build or GPU run for this review.

@bmjask bmjask 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.

Critical review of current head f5496479. The latest changes preserve unbounded waiting for pinned compute while applying the graphics budget to retained draws and indirect graphics binds; that addresses the prior missing-dispatch regression. I found no current-head code blocker in the budget routing. Please keep the GPU-world regression as a merge gate: with XCL_GFX_PSO_WAIT_MS=50, count skipped graphics draws, pinned-compute omissions, device removals, and frame time over the same scripted scene. The RTX 4090 result is encouraging but covers two runs. No local Windows run.

@Foniass

Foniass commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Review (head f549647, diff read, not a merge-check; draft, so not built or run):

  • Direct and indirect compute now use different budgets. resolve_retained_for_emission now passes cs_wait_budget() (pso_async.rs ~12428), so a direct or submit-replayed Dispatch is skipped once XCL_CS_PSO_WAIT_MS runs out (what dispatches did before 056fc43, which the description doesn't mention). But pinned_wait_budgets (~12318) keeps ExecuteIndirect and DispatchMesh compute on XCL_PSO_WAIT_MS, and the PR's fourth commit gives the reason: the CS cutoff skipped about 300 compute passes and hung the GPU. Either make the two paths consistent or explain why direct dispatches are safe, and test a dispatch with a compute budget set (the test at ~10528 passes cs = None).
  • With only XCL_CS_PSO_WAIT_MS set, put-off dispatches can be dropped again. On main a dispatch is only put off when XCL_PSO_WAIT_MS is unset (79b1994 records it at once with the bounded wait otherwise), and the submit replay is safe because resolve_retained_for_emission waits with wait_budget(), which is None then. If it now also honours cs_wait_budget(), a run with only XCL_CS_PSO_WAIT_MS set still puts dispatches off but gives the submit wait a limit, so a put-off dispatch can be skipped at the submit, the case D3D12.X: with XCL_PSO_WAIT_MS set, a put-off dispatch waits for its pipeline at the submit instead of being dropped #2547 was about. (Added after reviewing D3D12.X: with XCL_PSO_WAIT_MS set, a put-off dispatch waits for its pipeline at the submit instead of being dropped #2547.)
  • The test doesn't fail without the fix. It calls resolve_pending_budgets directly, and ~10552 compares pinned_wait_budgets() with its own definition, so it would pass even if resolve_retained_for_emission kept wait_budget().
  • resolve_wait_bound_and_pin (~12409) is #[cfg(test)], but the description lists it among the changed bind paths.
  • CI's build-and-test fails in tests outside pso_async (main's CI at 3b6a91e failed the same geometry tests that day), so it needs a rebase and rerun. Commits 3-5 are fixups to squash, and AI use names no model.

Fine: with no budget variable set nothing changes. resolve_pending_budgets picks the budget exactly as main's resolve_wait_budgets, and each path counts one use of the pipeline. A recorded draw past its budget is skipped, as on main with XCL_PSO_WAIT_MS. "Again" checks out: ed5e9e4 moved draws off the graphics budget. No overlap with #3306 / #3307 (worker and compile-gate priority).

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Test report (not a merge-check: draft)
base: b2b1f10
head: f549647
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2901 passed, 1 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: hle::d3d12x::uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment
review: not repeated here; my review of this same head is at #3318 (comment), and its findings stand. This run adds what reading couldn't: whether the change merges, builds and passes the whole suite on current main.
performance: no smoke run. The first run of this merge lost the lib test binary to the known uma_driver coherent-window abort; this is the rerun.
assessment: 1 test failed in this run: uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment ("remake_mixed: segment 0 (64 MB CUSTOM): Map gave

, wanted "). This PR doesn't touch heaps or the mixed window, and the same intermittent failure hit other PR runs on this machine today while two full runs of main passed, so it is most likely not this PR. The rest of the suite passes, and the findings in my review stand
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

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

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:shaders Shader cache, PSO compilation, pipeline libraries, precompilation gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants