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

Copy link
Copy Markdown

Stacked on #1802; only the top commit 6019206 belongs to this PR. Part of #1269. The parent commit is preserved unchanged and supplies the JSON/backend measurement command.

On RTX 5070 Ti, successful ShaderCacheControl calls still let repeated PSO creation 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.

What is in it

  • scripts/measure-nvidia-pso.ps1: isolated application profile, JSON/backend validation, cleanup on success/failure; no changes to other profiles or shared cache files.
  • Four profile-lifetime checks, usage documentation and NVAPI ABI-reference attribution. This commit changes no Rust runtime source; the full diff includes shaders: benchmark direct DXIL PSO compilation #1802's parent changes.

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 measurements, debug workspace tests.
  • cargo build --release -p xcl: passed. cargo test --workspace -- --test-threads=4: 891 passed, 0 failed, 42 ignored. SKIPPED within the passed count: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows). XCL_SAMPLE_* unset.
  • scripts/test-measure-nvidia-pso.ps1: 4 checks passed in Windows PowerShell 5.1 and PowerShell 7. Real missing-record failure cleaned up; independent NVAPI lookups confirmed all six wrapper profiles absent. A real HLSL measurement also passed in PowerShell 5.1.
  • Retail record 1404420b38db8597, 4 windows, split wave64, interleaved direct/HLSL/direct/HLSL processes, 3 compiles each: driver medians 3.229 / 5.597 / 3.155 / 5.398 s. The same copied exe without the profile gave 2.5808741 / 0.0016611 / 0.0016399 s. No shader salt or code changes. Full timings and commands: shaders: benchmark direct DXIL PSO compilation #1802 (comment) .
  • git diff --check: passed.

Regression run
Earlier clean main/parent-base run and new post-push exact-head run, same title and 60 s, isolated data/cache copies, no menu input. Startup/menu coverage only.

main:

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

this PR:

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

Not tested
Other NVIDIA GPUs/drivers, AMD/Intel, Linux/Wine, full-pack throughput, world rendering or GPU execution performance. Forced termination of the PowerShell host cannot execute finally; the printed unique profile name permits manual cleanup. Requires permission to save an NVIDIA application profile, and #1802's measurement support. Rebase/drop the parent after #1802 merges.

AI use
Codex desktop, GPT-6 (exact variant not exposed): this commit's implementation, tests, local measurements and description. Parent #1802 is unchanged and retains its author's disclosure.

Rooted Hat and others added 2 commits November 24, 2026 21:50
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)
@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
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.

3 participants