Skip to content

Scripts: measure NVIDIA PSOs with a temporary cache-off profile - #1849

Open
Daydream3r wants to merge 2 commits into
xcl-dev:mainfrom
Daydream3r:fix-cold-pso-measurements
Open

Daydream3r wants to merge 2 commits into
xcl-dev:mainfrom
Daydream3r:fix-cold-pso-measurements

Conversation

@Daydream3r

@Daydream3r Daydream3r commented Nov 24, 2026 •

Copy link
Copy Markdown

Stacked on #1802; only the top commit 2cc2ba1 belongs to this PR. Part of #1269. Updated to #1802's current patch 3eaf978, rebased unchanged onto main 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 as e58293b (git range-diff reports an identical parent patch).

On RTX 5070 Ti, successful ShaderCacheControl calls still allowed repeated PSO creation to collapse from seconds to milliseconds. This wrapper associates a unique sibling exe with a temporary NVIDIA application profile whose shader disk cache is off, runs the measurement, and removes the profile and exe afterwards. It leaves other profiles and shared cache files alone.

What is in it

  • Parent shaders: benchmark direct DXIL PSO compilation #1802: exact-record HLSL/direct benchmark with JSON and explicit cache-control limitations, retaining its original author's patch.
  • This PR's commit: scripts/measure-nvidia-pso.ps1, four profile-lifetime checks, usage documentation and NVAPI ABI-reference attribution. No Rust runtime change in our own commit; the full diff includes the parent.
  • Rebase replaces the obsolete parent version, resolving its README/shaders conflicts with main. The wrapper/test code is unchanged; only surrounding README context changed.

Tested

  • RTX 5070 Ti 16 GB, NVIDIA 621.01; Ryzen 7 9800X3D, 64 GB RAM; Windows 11 Pro 25H2 26200.6584; Rust 1.100.0 MSVC, DXC/DXIL 1.9.2609.5. Release measurement/smoke, debug tests.
  • cargo build --release --workspace --locked: passed on clean main and clean head 2cc2ba1ac89b53e3e025ea273e29e4c5d45f92c4.
  • cargo test --workspace --locked --no-fail-fast -- --test-threads=4: head 1246 passed, 4 failed, 46 ignored; clean main 1246 passed, same 4 failed, 46 ignored; both exit 101. The four failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0,1,2,3}, CreateComputePipelineState 0x8007000E. Optional XCL_SAMPLE_* inputs unset.
  • Identical 26 explicit SKIPPED lines: 20 no native wave64, 3 refused per-lane forms (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32), 2 missing D3D12 debug-layer checks, 1 no heap windows. These skips are not coverage.
  • scripts/test-measure-nvidia-pso.ps1: 4 checks passed in Windows PowerShell 5.1 and 4 in PowerShell 7.
  • Real wrapper compatibility checks on record 1404420b38db8597, -Repeat 2, 4 windows / split wave64: PowerShell 7 -Backend direct exited 0 (262000 B DXIL; driver 2.3939078 / 2.4177889 s); PowerShell 5.1 -Backend hlsl exited 0 (395152 B DXIL; 3.916841 / 5.0216012 s). Both returned the expected backend/adapter/count JSON and cache_control=temporary_nvidia_profile_off; cold_compile_verified=false remains intact. These are compatibility checks, not interleaved cold/performance proof.
  • Real missing-record failure returned nonzero and cleaned up. Independent NVAPI lookups verified all three temporary profiles absent; each unique probe exe was absent too.
  • git diff --check: passed.

Regression run
Official scripts/smoke.ps1, same retail package 1.0.2.1, 60 s, no input, isolated copies of the same saved data/cache seed, networking off. Head run performed after pushing the new commit. Startup/menu coverage only.

main:

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: NVIDIA GeForce RTX 5070 Ti
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1590 (PresentX 1590)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15927 MB

head:

xcl-smoke v1
commit: 2cc2ba1ac89b53e3e025ea273e29e4c5d45f92c4
gpu: NVIDIA GeForce RTX 5070 Ti
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1630 (PresentX 1630)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17191 MB

Not tested
Other NVIDIA GPUs/drivers, AMD/Intel/native wave64, Linux/Wine, full-pack throughput, world rendering or shader GPU-output parity. The four baseline GPU-fuzz failures remain. A forcibly terminated PowerShell host cannot execute finally; the printed unique profile name permits manual cleanup. Requires permission to save an NVIDIA application profile and #1802's support; drop/rebase the parent after it merges.

AI use
Codex desktop, GPT-6 (exact variant not exposed): our original implementation/tests/measurements, updating the dependency and rebasing, actual local builds/tests/measurements/smoke and this description. Parent #1802 retains its original author and unchanged patch.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

@Daydream3r
Daydream3r marked this pull request as ready for review November 25, 2026 10:21
@throny throny added the goal:world-load Bears on the retail title getting past world loading label Nov 25, 2026
mokkamokacaffe and others added 2 commits November 25, 2026 16:41
ShaderCacheControl succeeds on this RTX 5070 Ti but repeated PSO creation still reuses compiled results. Associate a unique sibling executable with a temporary NVIDIA cache-off profile, then remove both after success or failure.

Part of xcl-dev#1269. Depends on the JSON/backend measurement support in xcl-dev#1802. Profile lifetime tests and real NVIDIA controls verify cleanup and eliminate the observed millisecond repeat timings.

Assisted-by: Codex desktop (GPT-6; exact variant not exposed)
@Daydream3r
Daydream3r force-pushed the fix-cold-pso-measurements branch from 6019206 to 2cc2ba1 Compare November 25, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants