Repository navigation
D3D12.X: add opt-in gameplay graphics PSO frame budget, scale workers, and log slow compile hashes - #2988
D3D12.X: add opt-in gameplay graphics PSO frame budget, scale workers, and log slow compile hashes#2988Saksukella wants to merge 2 commits into
Conversation
…s, and log slow compile hashes
|
Independent check of #2988 head
One policy point: 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. |
…AME_BUDGET_MS opt-in
|
Follow-up to my earlier NVIDIA report: I isolated the two pack-backed failures on the exact On Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC, with
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. |
|
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). |
|
Full suite on NVIDIA (listed under Not tested) on the new head Tested:
From reading: 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. |
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_MSwas12,000 msacross 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 withoutXCL_PSO_TRACE=1.crates/xcl/src/hle/d3d12x/pso_async.rs):FrameBudgetPolicy::{Explicit, Dynamic}withGAMEPLAY_FRAME_BUDGET_MS = 32starting atGAMEPLAY_FRAME_BUDGET_START_FRAME = 60.frame < 60) keep the existing12,000 msbudget; once active rendering is flowing (frame >= 60), graphics PSO bind waits cap at32 ms/framewhile background workers finish compiling them in parallel.XCL_PSO_FRAME_BUDGET_MS(orXCL_GFX_PSO_FRAME_BUDGET_MS) always overrides uniformly across all frames.p.compute == true/wait_for_submit) are completely untouched (fcap = None).crates/xcl/src/hle/d3d12x/pso_async.rs):pso_worker_threads_for(logical_cpus, total_ram_gib): hosts with< 16logical CPUs or< 24 GiBRAM keep the existing2..=6cap; hosts with>= 16CPUs and>= 24 GiBRAM scale to(logical_cpus / 2).clamp(6, 10)(protected by81c04142commit-headroom gating). ExplicitXCL_PSO_THREADS/XCL_DXC_THREADSalways override.crates/xcl/src/hle/d3d12x/real.rs):driver_compile_identifiednow logs any compile>= 500 mswith its 64-bitrecordhash and driver blob status without requiringXCL_PSO_TRACE=1, andfinish_two_passsupplies the two-pass console shader hash on all 3 call sites.Tested
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_overridepso_worker_threads_scales_with_cpus_and_ramcargo test -p xcl --lib big_compile -- --test-threads=1:15 passed(1 pre-existing unrelated failuregiant_driver_compiles_have_their_own_laneonbf7c82eebase).Not tested
< 16logical CPUs or< 24 GiBRAM (verified viapso_worker_threads_scales_with_cpus_and_ramunit test).Regression run
Baseline (
main,b49be183):This PR (
dd0b65f1onamd-devbf7c82ee):AI use