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

Open
github-bot wants to merge 2 commits from github-bot/gh-1849 into main AGit
Owner

@⁠Daydream3r on GitHub · 2026-11-24 21:46 UTC · original
Daydream3r:fix-cold-pso-measurements → main · +277 −27 · 7 files · 2 commits · open

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

**@⁠Daydream3r** on GitHub · 2026-11-24 21:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/1849) `Daydream3r:fix-cold-pso-measurements` → `main` · +277 −27 · 7 files · 2 commits · open 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 #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.
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 #1269. Depends on the JSON/backend measurement support in #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)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:07:10 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 01:15 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 01:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1849#issuecomment-7149366762) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-25 17:36 UTC · original · edited 2026-11-25 17:42 UTC

CPU-only wrapper check of 2cc2ba1ac89b53e3e025ea273e29e4c5d45f92c4 on Windows PowerShell 5.1.26100.9711 and PowerShell 7.6.9. The four scripts/test-measure-nvidia-pso.ps1 lifetime checks passed per shell.

I also ran the full scripts/measure-nvidia-pso.ps1 -Pack <fixture> -Hash 1122334455667788 -Xcl <stand-in> -Backend <backend> -Repeat <count> entry point with an in-process profile test double and a native executable that recorded its arguments. Nine scenarios passed per shell:

  • HLSL with one sample and direct with two samples preserved the child arguments, including a pack path with spaces and brackets, returned the expected timing-array length, kept cold_compile_verified=false, and added the cache-control field.
  • Child exit 23, invalid JSON, wrong backend, wrong sample count and wrong adapter all surfaced errors and called profile cleanup. A create failure never launched the child; a remove failure named the exact temporary profile.
  • Across all scenarios each generated profile name was unique, the copied executable disappeared, and the source executable's hash was unchanged.

Windows 11 26100.9711, i7-13700, RTX 4060. The profile provider and timing data were simulated. No NVIDIA profile was created, no caches were touched, and no cold-compile timing was measured. OpenAI Codex (GPT-6) ran the checks and prepared this report.

**@⁠RavenCurseBurg** on GitHub · 2026-11-25 17:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/1849#issuecomment-7169742244) · edited 2026-11-25 17:42 UTC CPU-only wrapper check of `2cc2ba1ac89b53e3e025ea273e29e4c5d45f92c4` on Windows PowerShell 5.1.26100.9711 and PowerShell 7.6.9. The four `scripts/test-measure-nvidia-pso.ps1` lifetime checks passed per shell. I also ran the full `scripts/measure-nvidia-pso.ps1 -Pack <fixture> -Hash 1122334455667788 -Xcl <stand-in> -Backend <backend> -Repeat <count>` entry point with an in-process profile test double and a native executable that recorded its arguments. Nine scenarios passed per shell: - HLSL with one sample and direct with two samples preserved the child arguments, including a pack path with spaces and brackets, returned the expected timing-array length, kept `cold_compile_verified=false`, and added the cache-control field. - Child exit 23, invalid JSON, wrong backend, wrong sample count and wrong adapter all surfaced errors and called profile cleanup. A create failure never launched the child; a remove failure named the exact temporary profile. - Across all scenarios each generated profile name was unique, the copied executable disappeared, and the source executable's hash was unchanged. Windows 11 26100.9711, i7-13700, RTX 4060. The profile provider and timing data were simulated. No NVIDIA profile was created, no caches were touched, and no cold-compile timing was measured. OpenAI Codex (GPT-6) ran the checks and prepared this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 06:28 UTC · original

Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current main on the new head — needs another rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-26 06:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/1849#issuecomment-7184458838) Re-verification on RTX 3060 Ti (Windows 11): still a **merge conflict with current `main`** on the new head — needs another rebase before it can be tested.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/shaders.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1849/head:github-bot/gh-1849'
git switch 'github-bot/gh-1849'

Merge

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