Skip to content

D3D12.X: add opt-in gameplay graphics PSO frame budget, scale workers, and log slow compile hashes - #2988

Open
Saksukella wants to merge 270 commits into
xcl-dev:amd-devfrom
Saksukella:perf/pso-dynamic-frame-budget
Open

Saksukella wants to merge 270 commits into
xcl-dev:amd-devfrom
Saksukella:perf/pso-dynamic-frame-budget

Conversation

@Saksukella

Copy link
Copy Markdown
Contributor

Introduces a dynamic boot-to-gameplay graphics PSO frame wait budget, scales default PSO compile worker threads on high-core / high-RAM hosts, and logs shader record hashes for slow driver compiles (>= 500 ms).

Motivation & summary of changes

On AMD RDNA 4 (RX 9070 XT), world entry hits hundreds of uncached 3D graphics PSOs. Because DEFAULT_FRAME_BUDGET_MS was 12,000 ms across all frames, a single 3D gameplay frame hitting 10–13 unready graphics PSOs stalled the title thread for 5–6.5 seconds per frame (237.8 s total in a 240 s run) before falling back to stand-ins anyway. Meanwhile, pso_worker_threads() remained capped at 6 even on 16–24 thread / 32+ GiB systems, and slow driver compiles (>= 500 ms) did not log the shader record hash without XCL_PSO_TRACE=1.

  1. Dynamic gameplay graphics PSO frame budget (crates/xcl/src/hle/d3d12x/pso_async.rs):
    • Adds FrameBudgetPolicy::{Explicit, Dynamic} with GAMEPLAY_FRAME_BUDGET_MS = 32 starting at GAMEPLAY_FRAME_BUDGET_START_FRAME = 60.
    • Boot/menu frames (frame < 60) keep the existing 12,000 ms budget; once active rendering is flowing (frame >= 60), graphics PSO bind waits cap at 32 ms/frame while background workers finish compiling them in parallel.
    • Explicit XCL_PSO_FRAME_BUDGET_MS (or XCL_GFX_PSO_FRAME_BUDGET_MS) always overrides uniformly across all frames.
    • Producer compute pipelines (p.compute == true / wait_for_submit) are completely untouched (fcap = None).
  2. High-core / high-RAM PSO worker scaling (crates/xcl/src/hle/d3d12x/pso_async.rs):
    • Adds pso_worker_threads_for(logical_cpus, total_ram_gib): hosts with < 16 logical CPUs or < 24 GiB RAM keep the existing 2..=6 cap; hosts with >= 16 CPUs and >= 24 GiB RAM scale to (logical_cpus / 2).clamp(6, 10) (protected by 81c04142 commit-headroom gating). Explicit XCL_PSO_THREADS / XCL_DXC_THREADS always override.
  3. Slow-compile shader record hash logging (crates/xcl/src/hle/d3d12x/real.rs):
    • driver_compile_identified now logs any compile >= 500 ms with its 64-bit record hash and driver blob status without requiring XCL_PSO_TRACE=1, and finish_two_pass supplies the two-pass console shader hash on all 3 call sites.

Tested

  • Unit tests on amd-dev (bf7c82ee + dd0b65f1, --test-threads=1, 0 new warnings):
    • cargo test -p xcl --lib pso_async -- --test-threads=1: 38 passed; 0 failed, including new pure-CPU unit tests:
      • dynamic_frame_budget_transitions_after_boot_and_honors_explicit_override
      • pso_worker_threads_scales_with_cpus_and_ram
    • cargo test -p xcl --lib big_compile -- --test-threads=1: 15 passed (1 pre-existing unrelated failure giant_driver_compiles_have_their_own_lane on bf7c82ee base).

Not tested

  • Non-AMD GPUs (NVIDIA / Intel).
  • Systems with < 16 logical CPUs or < 24 GiB RAM (verified via pso_worker_threads_scales_with_cpus_and_ram unit test).

Regression run
Baseline (main, b49be183):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: AMD Radeon RX 9070 XT
title: b8db18c2
seconds: 60
exit: 0x0
frames shown: 1624 (PresentX 1624)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 19700 MB

This PR (dd0b65f1 on amd-dev bf7c82ee):

xcl-smoke v1
commit: dd0b65f13e28ed5015e00407ff3e04dafbd8ebcf
gpu: AMD Radeon RX 9070 XT
title: b8db18c2
seconds: 60
exit: 0x0
frames shown: 1616 (PresentX 1616)
presents per 2 s (last 3): 63 60 60
device removals: 0
crashes: 0
peak commit: 13014 MB

AI use

  • Profiling analysis, implementation, and unit tests were assisted by AI; all unit tests and the 60 s hardware smoke run were executed and verified locally on AMD Radeon RX 9070 XT.

madaraXor and others added 30 commits November 25, 2026 14:14
In a pixel shader EXEC holds helper lanes (s_wqm), and on a primitive's
edge the first lane of EXEC is often one. v_readfirstlane read that lane.
An RDNA2 driver (RX 6700 XT, 32.0.21045) gives 0 for everything a helper
lane holds once a WaveReadLaneAt ran inside a loop, quad reads included.
A loop whose state the console's compiler carries in a vector register
(v_mov v, s ... v_readfirstlane s, v) then read 0 back on each pass and
ran to the loop budget: a retail title's volumetric light pass took
seconds per draw at its world start and Windows reset the GPU (xcl-dev#675).

v_readfirstlane now reads the first lane of EXEC that is live
(ballot(true), per half in the wave32-in-64 form) when EXEC has one, and
the first lane of EXEC as before when it has none. The value is the same:
the console's compiler reads the first lane of a value equal in every
lane, or of a lane it then removes from EXEC (a waterfall loop).

The new GPU test draws that title's list-loop shape on two triangles
sharing a diagonal. Without the change, on the RX 6700 XT, 69 of 1024
pixels run the loop 65 536 times (the budget) with wrong results; with
it, none, and at most 16 passes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A retail game unmaps addresses while it streams its world with
XMemMapPhysicalPagesScatter(addresses, n, NULL); it checks the result
and runs into its own int3 when the call fails (+0xb18de7, then its
crash reporter). XCL refused a NULL page array with
ERROR_INVALID_PARAMETER. Page 0 already means "unmap this address" in a
scatter, so no array is taken as page 0 for every address.

Test scatter_without_pages_unmaps: two pages mapped and written, unmapped
with no array (the call succeeds, the addresses are no longer committed),
mapped again they read what was written. It fails without the change
("refused").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A retail title keeps its destination page lists in slots of its own
table and writes a slot's pages after EnqueueRequest. At enqueue such a
slot can still name the pages of the slot's previous request, and the
snapshot taken then is what execute() wrote to (xcl-dev#289 rereads only the
entries that are 0). Over 16 000 requests a run were written into pages
the title had since reused: its objects got garbage pointers and it
crashed about 20 s into world loading; when the old pages were freed,
the request failed with E_ACCESS_VIOLATION.

The console reads the list when it runs the request. execute() now
reads it again (through read_own, as the snapshot) and takes it when it
differs and every page in it is allocated (kernelx::physical_pages_live).
A list that was on the enqueuing thread's stack keeps the snapshot: that
memory is reused once the call returns, and a page ID written there
since can belong to another live allocation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…heir pages with their texels

A retail title places its streamed textures at full size and has memory behind
their levels only as it loads them, the small ones first. vram::place_pages
gives a sampled texture a 64 KiB page of video memory for every tile at once:
when that title's world is set up about 92 % of those pages have nothing behind
them (80 690 pages, 6 809 committed, on one card).

With the switch (off by default) a sampled 2D texture of one slice is placed
with no tile mapped. Its tiling is kept as groups of tiles, one for each level
with tiles of its own and one for the packed levels, and a group gets its pages
before the first upload that has texels for it - the same pages by address as
before, so textures placed at one address still share them. A texture the GPU
writes gets all its pages.

Part of xcl-dev#1773.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… done

When the GPU-wait watchdog releases a wait (xcl-dev#505), its lines say which
queues wait on which, but not what the GPU is running. With
XCL_GPU_CULPRIT=1 every dispatch XCL records (title lists,
console-recorded lists, ExecuteIndirect of a translated compute
pipeline) is wrapped in WriteBufferImmediate markers, in before and out
after, one pair of words per PC list in a readback buffer. At a release
the lists whose marker in is above their marker out are logged with the
dispatches between the two: console CS (fnv64 of the title's bytecode),
PC pipeline and groups.

On the retail title of xcl-dev#505 (RTX 5080) this named, at each stall, one
list with a run of 1-D dispatches of one CS whose first never finished;
not the same CS from run to run. DRED breadcrumbs were tried first: they
change the driver's pipeline cache keys, so every pipeline was built
again and the title never got past its start.

Off by default; without the variable nothing is recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ivall and others added 12 commits November 26, 2026 19:19
…load

Fixes, each run in a retail title's world on an AMD RX 9070 (16 GB):
- list_x: a wait an earlier signal of the same cell or fence already
  satisfies is not part of a cycle (nvidia-dev 4cdb71f, f98a1d6).
  Every pipelined frame (wait N armed, signal N+1 next) counted as one:
  16 false cycle breaks a run before, none after.
- dispatch_chain: whole_in_cooldown takes CHAINS with try_lock, and a
  replaced chain is dropped after the lock: title threads blocked there.
- bind: prelude job tables live in pooled 1 MiB persistently mapped
  blocks (64 kept) instead of a committed buffer per use: ~1 250
  CreateCommittedResource a second during the world load before.
  XCL_TWO_PASS_LIST_MB sizes a list's two-pass record buffer (32 MiB,
  as before).
- title_textures: a submit whose lists were all closed before the last
  write-watch look began, in the same frame, takes no look of its own
  (XCL_LOOK_SKIP=0: off). A quarter of the world's submits skip it.
- sparse, vram: a submit waits on the CPU (XCL_SPARSE_CPU_WAIT_MS, 1 s)
  for the tile mappings its queue needs, then on the GPU only if they
  are late; placements no longer signal the sparse queue one by one.
- pso_async: workers are throttled by the system's free commit, not
  its free RAM: the world load dropped free RAM to 1.3 GB with 12 GB of
  commit free, every worker idled and a bind waited 14 s for a compute
  pipeline.
- real: pipelines waiting to be built (pso_async::lazy) share their
  copies of console shaders (same address, same bytes): ~80 000 of them
  in the first minute held 318 MB of copies after this.

Diagnostics (XCL_ACTIVITY):
- prof: a "profile (2 s)" line, where the title's threads waited in
  XCL: pipeline waits, submits (write-watch, sparse copies, texture
  uploads, list segments, driver), placements, frame events, presents.
- flight: every queue XCL signals, with a stall warning after 1 s and,
  at a device removal or crash, the queues (the first stopped first)
  and the last 400 events; tile mappings and creations a line. After
  3 s without GPU progress its thread reports the GPU culprit
  (XCL_GPU_CULPRIT=1) and after 8 s dumps the threads
  (XCL_STALL_DUMP=1): in the activity thread they never came, its DXGI
  query blocked in the hung driver.
- memory_report (xcl-dev#2697): "memory by owner" against DXGI's
  budget, the title's committed resources alive by kind, and every
  10 s the address space walked.
- eh: thread dumps go 40 frames deep.

Not fixed: the device is still removed 60-110 s into the world. The
culprit report named an indirect compute dispatch in one run; in the
others no dispatch was in flight and every queue waited.
A driver device limit can end workers during startup. Retry their batches once after the other workers finish, and count only batches that still fail.

Assisted-by: Claude (exact model unknown), Codex (GPT-6 family, exact model unknown)
Port xcl-dev#2865 to keep per-region budgets in compute and kernel shaders. Charge more budget for longer loops so a compute dispatch cannot spend its full iteration budget in a large loop.

Assisted-by: Claude (exact model unknown), Codex (GPT-6 family, exact model unknown)
Port xcl-dev#2868. Use the pipeline workers' free-commit measure so low free RAM alone does not stall big compiles.

Assisted-by: Claude (exact model unknown), Codex (GPT-6 family, exact model unknown)
Port xcl-dev#2859. Keep a readable dword beyond the logical blob length for the driver.

Assisted-by: Claude (exact model unknown), Codex (GPT-6 family, exact model unknown)
Port xcl-dev#2842. Check the fence after each event wake-up and keep a timed-out staging job alive while the GPU can still write to it.

Assisted-by: Claude (exact model unknown), Codex (GPT-6 family, exact model unknown)
A shared fence could move backward as separate title queues completed out of order. Signal a separate fence on each source queue.

Assisted-by: Claude (exact model unknown), Codex (GPT-6 family, exact model unknown)
Port xcl-dev#2630. Smaller pools let more video memory return when a title frees runs of tiles and keeps the tiles between them.

Assisted-by: Claude (exact model unknown), Codex (GPT-6 family, exact model unknown)
Keep full read-write sparse pages GPU-only until the title touches them on the CPU. Preserve title-facing query and protection behavior for lazy pages.

Assisted-by: Claude (exact model unknown), Codex (GPT-6 family, exact model unknown)
Record the compute, graphics or mesh pipeline in the driver when compilation stops the process. Skip the recorded pipeline on later launches and retain the available shader diagnostics.

Assisted-by: Claude (exact model unknown), Codex (GPT-6 family, exact model unknown)
Track active profiling spans, queue waits and submissions, and report the dispatch associated with a device removal.

Assisted-by: Claude (exact model unknown), Codex (GPT-6 family, exact model unknown)
@thehollowedone

Copy link
Copy Markdown
Contributor

Independent check of #2988 head dd0b65f1 against its exact parent bf7c82ee on Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC:

  • cargo test --offline --locked -j 4 -p xcl --lib pso_async -- --test-threads=1 on head: 38 passed, 0 failed, 0 ignored. These are policy/queue tests, not GPU coverage.
  • With XCL_SAMPLE_RPF set to my locally owned shader pack and XCL_REQUIRE_GPU=1, cargo test --offline --locked -j 4 -p xcl --test gpu_pso_e2e -- --test-threads=1 on head: 3 passed, 4 failed, 0 ignored. The exact parent gives the same 3/4/0 result and the same failing test names. Three mesh pairs report “PSO without a compute pass”; later tests also hit the shared PSO-count assertion. An isolated VS/PS draw reads clear color at pixel (25,17) on both revisions. I cannot attribute these NVIDIA failures to this PR. No title executable was run.

One policy point: resolve_wait_for uses the count of successful Present calls, and frame_budget_for switches the default from 12 s to 32 ms at count 60. Menu and loading presents count too; at 30 FPS the threshold is reached about two seconds after the first presentation, even if world loading is still ahead. The new unit test proves the numeric threshold, but not the described boot/menu-to-gameplay transition. If the 12 s budget must protect loading menus, the 32 ms default needs an explicit phase signal; until then, an opt-in budget is the bounded option. A regression should present more than 60 loading/menu frames, bind a cold graphics PSO, and verify the intended wait while producer compute remains uncapped. If 60 presents is intentionally just a responsiveness heuristic, the description and a measured visual-correctness run should say so.

Not tested: full workspace suite, Intel/AMD hardware, or a paired title smoke run. AI use: Codex (GPT-6.2 Sol) ran the exact-head and exact-parent tests and traced the frame counter; Codex (GPT-6.2 Astra) reviewed the attribution and wait policy.

@thehollowedone

Copy link
Copy Markdown
Contributor

Follow-up to my earlier NVIDIA report: I isolated the two pack-backed failures on the exact amd-dev parent bf7c82ee, so they should not be read as mesh translation failures introduced by #2988.

On Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC, with XCL_SAMPLE_RPF set to my locally owned shader pack and XCL_REQUIRE_GPU=1, I ran each test in a separate process using cargo test --offline --locked -j 4 -p xcl --test gpu_pso_e2e <test> -- --exact --nocapture --test-threads=1:

  • retail_vs_ps_through_the_pso_hook_render_and_read_back: 1 passed, 0 failed, 0 ignored with XCL_HEAP_WINDOWS=0 on the parent. The parent defaults heap windows on. #1743 already addresses the graphics test runner's missing heap-window descriptors; this result supports handling that through the existing PR.
  • retail_mesh_pipelines_through_the_hook: 1 passed, 0 failed, 0 ignored, 7/7 MS+PS pairs with XCL_PSO_FRAME_BUDGET_MS=off on the parent (heap windows left at their default). With the default 12-second per-frame cap, later pairs instead receive stand-ins and the test reports missing compute passes. This synthetic test creates seven PSOs before any Present, so they share frame 0's budget. Disabling heap windows did not fix it: 0 passed, 1 failed, 0 ignored, 2/7 pairs.
  • On current main 83b00818, with its default settings, each isolated test passed (1/0/0; mesh 7/7). main and amd-dev have diverged, so this is a baseline comparison, not an attribution to D3D12.X: add opt-in gameplay graphics PSO frame budget, scale workers, and log slow compile hashes #2988.

The mesh test should give each synthetic PSO its own frame budget or explicitly disable the frame cap while measuring translation. That would distinguish a stand-in from an actual failure to build the two-pass PSO. No title executable was run; no full workspace suite or paired smoke run was done in this follow-up. AI use: Codex (GPT-6.2 Sol) traced the wait path and ran these GPU tests.

@Saksukella Saksukella changed the title D3D12.X: use dynamic gameplay graphics PSO frame budget, scale workers, and log slow compile hashes D3D12.X: add opt-in gameplay graphics PSO frame budget, scale workers, and log slow compile hashes Nov 27, 2026
@Saksukella

Copy link
Copy Markdown
Contributor Author

Thanks @thehollowedone for the thorough check and great policy catch!

You're right that switching from 12 s to 32 ms at Present count 60 triggers during menu/loading screens and can skip cold graphics PSOs on world entry. Pushed an update keeping the default graphics frame budget at \12_000 ms\ (identical to \�md-dev, zero premature draw skips), while making \XCL_GFX_PSO_FRAME_BUDGET_MS\ strictly opt-in (caps graphics-only bind waits from frame 60 onward while leaving producer compute uncapped, with \XCL_PSO_FRAME_BUDGET_MS\ overriding all frames). High-core/high-RAM worker scaling (\6 -> 10\ on >=16T / >=24GiB) and >= 500 ms\ slow-compile shader record hash logging remain enabled by default. Updated \ rame_budget_keeps_default_12s_and_honors_opt_in_gfx_and_explicit_overrides\ (\38/38\ passed in \pso_async).

@fromthemoonx

Copy link
Copy Markdown

Full suite on NVIDIA (listed under Not tested) on the new head 6f5e03c: no new failure compared with amd-dev itself. Every failure here also fails on bf7c82e, or is a parallel-only flake that passes alone on both.

Tested: 6f5e03c (its base is current amd-dev bf7c82e, so head = merged), and bf7c82e itself for comparison. RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X (16 threads), 16 GB RAM (GlobalMemoryStatusEx reads 15 GiB, so this host keeps the old 2..=6 worker cap and does not reach the new scaling), Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug.

result
cargo test --workspace --no-fail-fast -- --test-threads=4, 6f5e03c the lib binary aborted part-way; the other binaries: 121 passed, 6 failed, 20 ignored, 20 SKIPPED lines, the same 6 as on bf7c82e
lib binary, --test-threads=4, 2 more runs on 6f5e03c / 7 runs on bf7c82e one run completed: 1657 passed, 12 failed, 27 ignored; the other aborted with thread 'xcl-pso-0' panicked at … windows-core-0.62.2\src\interface.rs:41:18: null reference produced / non-unwinding panic. aborting., which bf7c82e does too (in 2 of its 7 runs, plus 1 segfault)
the 19 tests that failed in any run on 6f5e03c, compared with bf7c82e 17 fail on bf7c82e too (e.g. the 3 e2e title tests, giant_driver_compiles_have_their_own_lane)
compositor_releases_root_sig_and_rejects_invalid_planes (psos_for leaked root_sig COM refs) failed 1 of 3 runs here; flaky on bf7c82e too (1 of 7, same assertion)
hle::kernelx::guards::tests::writes_from_many_threads_are_all_caught_and_kept (guards.rs:411, caught pages differ) failed 1 of 3 runs here, passed in the 4 bf7c82e runs that reached it; alone, 10 of 10 on both. This PR does not touch guards.rs, so this looks like a parallel-only flake
hle::d3d12x::pso_async:: (38 tests), --test-threads=8 38 passed

From reading: total_physical_ram_gib rounds down (ullTotalPhys >> 30), and Windows reports a little less than the installed size (16 GB reads as 15 here). So a 24 GB machine would likely read 23 and stay on the old cap. If 24 GB hosts are meant to scale, the threshold could compare in MiB, or use 23.

Not tested: a title on NVIDIA with this branch, a 24 GB+ host with 16+ threads (the new worker scaling), a release build, Intel.

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.

@ettehn

ettehn commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

I compared parent bf7c82ee1b2685bb40417e09c4128177aa68d719 and head 6f5e03cf268b24e716b3f3438ae0bf435b7deb4b with a standalone probe of the extracted Rust functions (Rust 1.97.1 MSVC). On this Windows host, Rust sees 32 logical CPUs and GlobalMemoryStatusEx reports 31.8 GiB usable RAM. Each environment case ran in a fresh process.

  • Both overrides unset: 6 → 10 workers selected. XCL_PSO_THREADS=3 with XCL_DXC_THREADS=9 still selects 3. One edge case is XCL_DXC_THREADS=0 with no positive PSO override: the parent falls through to dxc::compile_threads() and selects 2, while the head takes the hardware default and selects 10.
  • The two-pass GS path puts VS first in console, and two_pass_record hashes the first nonempty entry. With the same synthetic VS and two different GS inputs, both select e92c55e701afdc98 despite different GS hashes. If the record field is meant to identify the shader responsible for the GS pass, consider logging the GS hash or stage-qualified VS/GS hashes. The MS caller already selects MS. This concerns the diagnostic field only.

The probe verifies policy output and record selection. It did not start PSO workers or run a driver compile or a title. AI use: OpenAI Codex (GPT-6) prepared and ran the probe and drafted this report.

@oni-swr

oni-swr commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

RDNA3 data at gameplay frames for #2988, taken at the old head dd0b65f1 (32 ms graphics budget on by default): 4 runs, the ~90 s presenting stop does not move. The new head 6f5e03cf makes the budget opt-in, so this is the default-on variant only; I have not run 6f5e03cf.

Setup: RX 7800 XT 16 GB (RDNA3), driver 32.0.31035.1003, Ryzen 7 5700X3D (16 logical CPUs), 64 GB, Windows 11 build 26200, DXC 1.8.2502.11, release builds of the unmodified commits bf7c82ee (base, its exact parent) and dd0b65f1, the same retail title. XCL_PREPARE=0 XCL_NETWORK=0 XCL_ACTIVITY=1, no XCL_PSO_* set, A pressed every 8 s, 300 s runs, each on a fresh copy of the same warm shader cache and profile, interleaved base / PR / base / PR. The 16 CPUs and 64 GB put this host in the worker-scaling branch (8 workers by the formula in the description, instead of 6; I did not check the thread count in the log).

run tree exit last present presents per 30 s (0-30 / 30-60 / 60-90 / 90-120) presents after 120 s graphics / compute pipeline waits after 120 s (summed over threads)
1 base 0x0 98 s 547 / 657 / 581 / 134 0 0 s / 294 s
2 PR 0x0 96 s 479 / 552 / 647 / 117 0 0 s / 511 s
3 base 0x0 92 s 560 / 642 / 590 / 63 0 0 s / 301 s
4 PR 0x0 91 s 566 / 637 / 627 / 18 0 0 s / 419 s
  • Both trees present normally for ~90 s, then stop for the rest of the run. No device removal and no crash in the four runs.
  • The stop is compute, not graphics: after 120 s the graphics pipeline waits are 0 s in all four runs and the compute pipeline waits are 294-511 s (summed over threads, in ~173 s of wall time). A graphics frame budget cannot move this stop, and it did not. D3D12.X: add opt-in gameplay graphics PSO frame budget, scale workers, and log slow compile hashes #2988 leaves producer compute untouched, as its description says, so this is the expected result, not a defect of the PR.
  • Where graphics waits do dominate: on the same host with a shader cache that earlier runs had already filled (3 consecutive 600 s runs of 5fbd90f9 on one cache copy), the third run spent ~1,650 s of summed wait time in graphics pipeline waits at the default 12 s and ~70 s in compute waits, and its presents crept back from ~120 s (2-4 per 30 s, 13-35 per 30 s in the last 90 s). That is the regime where the opt-in budget could matter; I did not run it with XCL_GFX_PSO_FRAME_BUDGET_MS=32.

Not tested: 6f5e03cf, the opt-in budget, a cold cache, more than 2 runs per tree, whether skipped graphics draws changed what is on screen.

AI use: Claude Code (Claude Sonnet 5.5) built the trees, ran the title, read the logs and wrote this comment. Every number comes from those runs.

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

The opt-in frame-budget transition leaves producer compute uncapped, and I found no concrete defect in that policy implementation. The current PR combines three logical changes, however: gameplay wait policy, worker-count scaling, and slow-compile logging. They have different risks and rollback criteria and should be split under the repository contribution rules.

Please also validate the enabled gameplay-budget path in the smoke run; the supplied default-path smoke does not exercise the principal behavior change. Worker scaling needs a high-commit-pressure run, not only pure unit tests.

Reviewed at 6f5e03c with Codex (GPT-5).

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head 6f5e03c

Only the top two commits are this PR's own (dd0b65f, 6f5e03c in hle/d3d12x/pso_async.rs and real.rs). The other ~285 commits are the old amd-dev base that #2912, #2913, #2981, #2989, #3023 and the other large amd-dev PRs also carry. No other PR adds XCL_GFX_PSO_FRAME_BUDGET_MS, pso_worker_threads_for or the 500 ms slow-compile log, and none of them is on amd-dev.
Current amd-dev was rebuilt. It no longer has frame_budget / XCL_PSO_FRAME_BUDGET_MS or pso_worker_threads, which this PR edits, so it has to be redone on current amd-dev. For graphics waits, amd-dev now has the opt-in XCL_GFX_PSO_WAIT_MS, and XCL_PSO_URGENT_WORKERS for builds a title waits on.
Problems: the description is out of date. It describes a 32 ms dynamic default and the test dynamic_frame_budget_transitions_after_boot_and_honors_explicit_override, but 6f5e03c made the cap opt-in and the test is now frame_budget_keeps_default_12s_and_honors_opt_in_gfx_and_explicit_overrides. pso_worker_threads_for raises the default to 8-10 workers on hosts with 16 or more threads and 24 GiB or more RAM. The comment it replaces kept the cap at 6 to avoid AMD LLVM commit thrash on 32 GB systems, and the only measurement of peak commit with more workers is one 60 s smoke run. The PR also bundles three separate changes.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

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.