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

Open
github-bot wants to merge 2 commits from github-bot/gh-2988 into amd-dev AGit
Owner

@⁠Saksukella on GitHub · 2026-11-27 07:41 UTC · original
Saksukella:perf/pso-dynamic-frame-budget → amd-dev · +177 −29 · 2 files · 2 commits · open

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.
**@⁠Saksukella** on GitHub · 2026-11-27 07:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/2988) `Saksukella:perf/pso-dynamic-frame-budget` → `amd-dev` · +177 −29 · 2 files · 2 commits · open 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`): ```text 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`): ```text 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 07:42:58 +00:00
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-27 08:09 UTC · original

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** on GitHub · 2026-11-27 08:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/2988#issuecomment-7213219035) Independent check of [#2988 head `dd0b65f1`](https://github.com/xcl-dev/xcl/commit/dd0b65f13e28ed5015e00407ff3e04dafbd8ebcf) against its [exact parent `bf7c82ee`](https://github.com/xcl-dev/xcl/commit/bf7c82ee1b2685bb40417e09c4128177aa68d719) 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`](https://github.com/xcl-dev/xcl/blob/dd0b65f13e28ed5015e00407ff3e04dafbd8ebcf/crates/xcl/src/hle/d3d12x/pso_async.rs#L2294-L2305) uses the count of successful `Present` calls, and [`frame_budget_for`](https://github.com/xcl-dev/xcl/blob/dd0b65f13e28ed5015e00407ff3e04dafbd8ebcf/crates/xcl/src/hle/d3d12x/pso_async.rs#L2341-L2356) 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.
github-bot changed title from D3D12.X: use dynamic gameplay graphics PSO frame budget, scale workers, and log slow compile hashes to D3D12.X: add opt-in gameplay graphics PSO frame budget, scale workers, and log slow compile hashes 2026-11-27 08:39:09 +00:00
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-27 08:34 UTC · original

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

**@⁠thehollowedone** on GitHub · 2026-11-27 08:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/2988#issuecomment-7213679945) Follow-up to [my earlier NVIDIA report](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2988): I isolated the two pack-backed failures on [the exact `amd-dev` parent `bf7c82ee`](https://github.com/xcl-dev/xcl/commit/bf7c82ee1b2685bb40417e09c4128177aa68d719), 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](https://git.gtahub.st/github/xcl-dev--xcl/pulls/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`](https://github.com/xcl-dev/xcl/commit/83b008188efbf954b846667f48d75e3fa9310a01), 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 #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.
Author
Owner

@⁠Saksukella on GitHub · 2026-11-27 08:34 UTC · original

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

**@⁠Saksukella** on GitHub · 2026-11-27 08:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/2988#issuecomment-7213680375) 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\).
Author
Owner

@⁠fromthemoonx on GitHub · 2026-11-27 08:41 UTC · original

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.

**@⁠fromthemoonx** on GitHub · 2026-11-27 08:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/2988#issuecomment-7213807587) **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.
Author
Owner

@⁠ettehn on GitHub · 2026-11-27 10:33 UTC · original

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.

**@⁠ettehn** on GitHub · 2026-11-27 10:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/2988#issuecomment-7216032720) 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.
Author
Owner

@⁠oni-swr on GitHub · 2026-11-27 10:37 UTC · original

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

**@⁠oni-swr** on GitHub · 2026-11-27 10:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/2988#issuecomment-7216106899) **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. #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.
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/2988/head:github-bot/gh-2988'
git switch 'github-bot/gh-2988'

Merge

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