Repository navigation
Conversation
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
AMD RDNA4 run of Setup
1. Default mode ( 2.
3. A fresh exe name per run keeps AMD cold. I copied
Both match the first cold run above (471.6 s) within 1 %. Suggestion
Not tested
AI use: Claude Code (Claude Opus 5.5) ran the script and drafted this. Counts and timings only, no game data. |
|
As a small follow-up to the two-GPU check, I prepared and verified the fixture-only patch below: route the Tested: At With this patch applied to the exact head above, Not tested: No runtime files changed. No retail smoke or new driver timings; this is a test-script-only patch. AI use Ran via Samaritan:
Verified patch for this PRdiff --git a/scripts/cold-pso-bench.tests.ps1 b/scripts/cold-pso-bench.tests.ps1
index e1be6f8..5982e93 100644
--- a/scripts/cold-pso-bench.tests.ps1
+++ b/scripts/cold-pso-bench.tests.ps1
@@ -5,7 +5,17 @@ $ErrorActionPreference = 'Stop'
$bench = Join-Path $PSScriptRoot 'cold-pso-bench.ps1'
$fixture = Join-Path ([IO.Path]::GetTempPath()) ('xcl-cold-pso-' + [guid]::NewGuid())
$null = New-Item -ItemType Directory -Path $fixture
+$savedAppData = $env:LOCALAPPDATA
+$savedTimes = $env:XCL_PIPELINE_TIMES
+$savedCacheOff = $env:XCL_PIPELINE_CACHE_OFF
try {
+ # The fixture must never clear the user's driver cache or append to a real timing file.
+ $env:LOCALAPPDATA = Join-Path $fixture 'local-appdata'
+ $cache = Join-Path $env:LOCALAPPDATA 'NVIDIA\DXCache'
+ $null = New-Item -ItemType Directory -Path $cache
+ $sentinel = Join-Path $cache 'sentinel'
+ [IO.File]::WriteAllText($sentinel, 'temporary fixture cache')
+ Remove-Item Env:XCL_PIPELINE_TIMES, Env:XCL_PIPELINE_CACHE_OFF -ErrorAction SilentlyContinue
$xcl = Join-Path $fixture 'xcl.cmd'
# A pipelines run (XCL_PIPELINE_TIMES set) writes four builds and the environment it saw.
[IO.File]::WriteAllText($xcl, (@(
@@ -36,7 +46,11 @@ try {
& $bench -Shaders 'D:\pack' -Threads 6 -Xcl $xcl -Out (Join-Path $fixture 'out2') -ClearNvCache *> $null
$seen = (Get-Content (Join-Path $fixture 'env-6.txt') -Raw).Trim()
if ($seen -notmatch '^0 +shaders D:\\pack --precompile --only cs --pipelines$') { throw "-ClearNvCache: caches switch still set: $seen" }
+ if (Test-Path -LiteralPath $sentinel) { throw '-ClearNvCache: temporary cache was not cleared' }
'cold-pso-bench.ps1: ok'
} finally {
+ $env:LOCALAPPDATA = $savedAppData
+ $env:XCL_PIPELINE_TIMES = $savedTimes
+ $env:XCL_PIPELINE_CACHE_OFF = $savedCacheOff
Remove-Item -Recurse -Force $fixture -ErrorAction SilentlyContinue
}Follow-up on the revised script (
|
| System | Workspace | Runtime skips |
|---|---|---|
| RTX 5080 16 GB, NVIDIA 610.88; Ryzen 7 9800X3D, 32 GiB, Rust 1.97.0, DXC 1.9.2609.5 | 1,155 passed, 0 failed, 46 ignored | 25: 20 no native wave64, three unsupported per-lane cases, no heap windows, cache-disable unavailable |
| RTX 2080 SUPER 8 GB, NVIDIA 610.88; Ryzen 5 5600X, 16 GiB, Rust 1.99.1, DXC 1.8.2502.11 | 1,155 passed, 0 failed, 46 ignored | 27: same plus two missing D3D12 debug-layer cases |
The PowerShell fixture passed on both PCs. Then ran the unmodified scripts/cold-pso-bench.ps1 -Shaders <synthetic-records> -Threads 2,4 -Xcl <debug-xcl> -Out <isolated-output> -ClearNvCache -TimeoutMinutes 3 with a disposable LOCALAPPDATA, XCL_DATA_ROOT, and explicit XCL_ADAPTER. Only the disposable NVIDIA cache path was targeted. Each worker count made 12 pipelines, 0 refused, 0 XCL driver-blob reuses, and no per-run executable copies remained.
| Adapter | 2 workers: wall / summed driver / peak commit | 4 workers: wall / summed driver / peak commit |
|---|---|---|
| RTX 5080 | 3.8 s / 5.7 s / 231 MB | 2.2 s / 6.4 s / 313 MB |
| RTX 2080 SUPER | 7.2 s / 12.1 s / 229 MB | 5.1 s / 15.1 s / 347 MB |
| Radeon RDNA2 iGPU, driver 32.0.21043.5001 (9800X3D system above) | 3.4 s / 6.1 s / 318 MB | 2.3 s / 7.1 s / 501 MB |
Not tested: Actual implicit driver-cache misses, full AMD workspace, retail smoke, and repeated or larger samples. Fresh executable names and made rows alone do not prove cold cache status; the table is an end-to-end check, not a scaling recommendation.
AI use
Ran via Samaritan:
- OpenCode (GPT-6.2 Sol): ran and audited the two-PC checks and wrote this follow-up.
Peak commit for runs shorter than the sampling interval
The current once-per-second sampler leaves peak commit at zero if the process exits before the first sample. The script-only patch below reads Windows' lifetime PeakPagefileUsage from the retained process handle after exit, without changing the benchmark's timeout, cache options, or CSV schema.
Tested: Base 8b690141096f61a663500c4dc5e0f47240529d70; candidate is that head plus the diff below. Same Windows, GPU, CPU, RAM, driver, Rust and DXC configurations as above. Ran powershell -NoProfile -File scripts/cold-pso-bench.tests.ps1: strengthened fast-exit assertion failed on the RTX 5080 before the fix and passed on both PCs after it (one fixture run passed per PC, no skips). On each PC ran scripts/cold-pso-bench.ps1 -Shaders <one-record directory> -Threads 2 -Xcl <debug-xcl> -Out <isolated output> -ClearNvCache -TimeoutMinutes 2, with the same synthetic shader, disposable LOCALAPPDATA and XCL data directory. Each baseline and candidate run exited 0 with one pipeline made, zero refused and zero XCL blob reuses. RTX 5080: 0 MB reported → 110 MB; RTX 2080 SUPER: 0 MB reported → 96 MB. These are corrected measurements, not a memory increase or reduction.
Not tested: Retail titles, confirmed cold driver-cache status, or PowerShell 7. No Rust code changed; workspace results above are from the unchanged pinned binary.
AI use
Ran via Samaritan:
- OpenCode (GPT-6.2 Sol): reproduced the zero reading, implemented the counter and fixture check, ran both PC comparisons, and prepared the diff.
Verified peak-commit patch
diff --git a/scripts/cold-pso-bench.ps1 b/scripts/cold-pso-bench.ps1
index de2678e..1c2734d 100644
--- a/scripts/cold-pso-bench.ps1
+++ b/scripts/cold-pso-bench.ps1
@@ -72,6 +72,35 @@ function Get-Summary($Rows) {
[pscustomobject]$s
}
+# Windows retains the lifetime peak commit while a handle to the process is open.
+if (-not ('XclBenchmarkMemory' -as [type])) {
+ Add-Type -TypeDefinition @'
+using System;
+using System.Runtime.InteropServices;
+
+public static class XclBenchmarkMemory {
+ [StructLayout(LayoutKind.Sequential)]
+ struct Counters {
+ public uint Size, PageFaults;
+ public UIntPtr PeakWorkingSet, WorkingSet, PeakPagedPool, PagedPool;
+ public UIntPtr PeakNonpagedPool, NonpagedPool, Commit, PeakCommit;
+ }
+
+ [DllImport("psapi.dll", SetLastError = true)]
+ static extern bool GetProcessMemoryInfo(IntPtr process, ref Counters counters, uint size);
+
+ public static ulong PeakCommit(IntPtr process) {
+ var counters = new Counters();
+ counters.Size = (uint)Marshal.SizeOf(typeof(Counters));
+ if (!GetProcessMemoryInfo(process, ref counters, counters.Size)) {
+ throw new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error());
+ }
+ return counters.PeakCommit.ToUInt64();
+ }
+}
+'@
+}
+
# One `xcl shaders` run with the given environment; wall and CPU time, peak private commit.
function Invoke-Xcl([string[]]$Arguments, [hashtable]$Environment, [string]$Exe = $Xcl) {
$psi = New-Object System.Diagnostics.ProcessStartInfo
@@ -82,14 +111,20 @@ function Invoke-Xcl([string[]]$Arguments, [hashtable]$Environment, [string]$Exe
$psi.RedirectStandardError = $true
foreach ($k in $Environment.Keys) { $psi.EnvironmentVariables[$k] = [string]$Environment[$k] }
$p = [System.Diagnostics.Process]::Start($psi)
- $stdout = $p.StandardOutput.ReadToEndAsync(); $stderr = $p.StandardError.ReadToEndAsync()
- $watch = [Diagnostics.Stopwatch]::StartNew(); $peak = 0L
- while (-not $p.WaitForExit(1000)) {
- try { $p.Refresh(); $peak = [math]::Max($peak, $p.PrivateMemorySize64) } catch { }
- if ($watch.Elapsed.TotalMinutes -gt $TimeoutMinutes) { $p.Kill(); throw "xcl ran over $TimeoutMinutes minutes" }
+ try {
+ $handle = $p.Handle
+ $stdout = $p.StandardOutput.ReadToEndAsync(); $stderr = $p.StandardError.ReadToEndAsync()
+ $watch = [Diagnostics.Stopwatch]::StartNew()
+ while (-not $p.WaitForExit(1000)) {
+ if ($watch.Elapsed.TotalMinutes -gt $TimeoutMinutes) { $p.Kill(); throw "xcl ran over $TimeoutMinutes minutes" }
+ }
+ $p.WaitForExit()
+ $watch.Stop()
+ $peak = [XclBenchmarkMemory]::PeakCommit($handle)
+ [pscustomobject]@{ Exit = $p.ExitCode; WallS = [math]::Round($watch.Elapsed.TotalSeconds, 1); CpuS = [math]::Round($p.TotalProcessorTime.TotalSeconds, 1); PeakMB = [math]::Round($peak / 1MB); Out = $stdout.Result + $stderr.Result }
+ } finally {
+ $p.Dispose()
}
- $p.WaitForExit()
- [pscustomobject]@{ Exit = $p.ExitCode; WallS = [math]::Round($watch.Elapsed.TotalSeconds, 1); CpuS = [math]::Round($p.TotalProcessorTime.TotalSeconds, 1); PeakMB = [math]::Round($peak / 1MB); Out = $stdout.Result + $stderr.Result }
}
$common = @('shaders', $Shaders, '--precompile', '--only', 'cs')
diff --git a/scripts/cold-pso-bench.tests.ps1 b/scripts/cold-pso-bench.tests.ps1
index 0a4d992..2fb2b5e 100644
--- a/scripts/cold-pso-bench.tests.ps1
+++ b/scripts/cold-pso-bench.tests.ps1
@@ -38,7 +38,8 @@ try {
if ($seen -notmatch "^xcl-cold-$n-[0-9a-f]{8} 0 1 shaders D:\\pack --precompile --only cs --limit 10 --pipelines$") { throw "threads ${n}: exe name, environment or arguments wrong: $seen" }
$names += ($seen -split ' ')[0]
# made: 0.1 + 0.3 + 5.0 s; p50 of three is the second, p95 and max the third
- if ($table -notmatch "\| $n \| [\d.]+ \| [\d.]+ \| \d+ \| 3 \| 1 \| 5\.4 \| 0\.3 \| 5 \| 5 \|") { throw "threads ${n}: summary row wrong:`n$table" }
+ # The immediate-exit fixture still has a nonzero lifetime peak commit.
+ if ($table -notmatch "\| $n \| [\d.]+ \| [\d.]+ \| [1-9]\d* \| 3 \| 1 \| 5\.4 \| 0\.3 \| 5 \| 5 \|") { throw "threads ${n}: summary row wrong:`n$table" }
foreach ($row in @("\| $n \| < 64 KiB \| 1 \| 0\.1 \|", "\| $n \| 64-256 KiB \| 1 \| 0\.3 \|", "\| $n \| 1-4 MiB \| 1 \| 5 \|")) {
if ($table -notmatch $row) { throw "threads ${n}: bucket row missing ($row):`n$table" }
}386e3d4 to
b3b962c
Compare
|
@itsSio thank you, that was a real hazard: the fixture's On your cache observation (driver 610.88: a repeat of the same exe ~0.03 s, a new exe name cold again): the RTX 4070 table here was not from a warm cache. Its eight runs used the same exe, the same DXIL and the same compute programs one after another, with the NVIDIA AI use: Claude Code (Claude Opus 5.5) applied and checked the patch and drafted this reply. |
|
Updated review on \�3b962c:\n\n- Folding the \LOCALAPPDATA\ / \XCL_PIPELINE_TIMES\ / \XCL_PIPELINE_CACHE_OFF\ sandbox isolation into \scripts/cold-pso-bench.tests.ps1\ prevents the test fixture from touching the user's live \DXCache\ or timing files; CI (\Build and test\ + \PR description) is green and \CLEAN.\n\nRemaining before merge:\n1. Fresh independent AMD + NVIDIA verification on \�3b962c\ (prior runs were on \386e3d4).\n2. Follow-up or documentation note on @bielfreedom's AMD finding (-ClearNvCache\ reuses \xcl.exe\ without Developer Mode / per-run exe name on AMD). |
|
NVIDIA verification of #2129 at Setup: RTX 5070 Ti 16 GB, driver 32.0.16.1742, Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro 10.0.26300, Developer Mode on. Release build of Tested on
Per bucket, the same in both runs: 12 programs under 64 KiB (driver sum 2.1 s at 2 threads, 2.7 s at 8) and 20 programs of 64-256 KiB (47.6 s and 63.2 s). All 32 rows were
Not tested
Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5). |
b3b962c to
8b69014
Compare
|
@bielfreedom thank you, that was a real hole: with Checked here: the fixture test now records the exe name of each run, fails on the previous script and passes now (a new name per run, no copy left). A real @tiagonleal thanks for the RTX 5070 Ti run: a repeat under the same exe name being mostly warm on NVIDIA too (22 of 32 under 0.1 s, all rows
AI use: Claude Code (Claude Opus 5.5) made the change, ran the checks and drafted this reply. |
|
Pascal data point for #2129 (GTX 1050 Ti), script at Setup: GTX 1050 Ti 4 GB, driver 32.0.15.8266, Core i5-8400 (6 cores), 16 GB RAM, Windows 11 Pro 26100, Developer Mode off. Release Run:
What it shows on this card: going from 2 to 4 threads cuts the wall time by 24 % but every compile gets about 35 % slower (driver sum 700 → 944 s) and peak commit grows by 0.8 GB. The 3 programs of 1-4 MiB take 83-114 s each and are 31-38 % of all driver time, so on Pascal they alone set the floor for a cold start. Not tested: thread counts other than 2 and 4; the full pack (the first DXIL pass over all 2 689 compute programs ran at a few per minute on the largest ones, so I stopped it); Developer Mode on; more than one run per cell. Run and written with Claude Code (Claude Opus 5.5). |
|
CPU fixture report and a script-only follow-up for this PR: dcd14b8, based on exact head An exit-zero fixture with missing or malformed timing data can still produce a successful benchmark summary on the current script. The patch validates the five CSV fields, rejects missing/empty files and nonfinite/negative durations, and identifies the file and physical line in row errors. Actual zero durations and refused-only/reused-only measurements remain valid. Timing cleanup/read and summary export use literal paths; an append-mode repeat fixture also checks that an output directory containing Tested Windows 11 Pro, build 26200, Intel Core i7-9750H; CPU-only
The 37 cases comprise 30 invalid inputs and 7 valid/repeated-run cases; none ignored or skipped. Original environment, percentile/bucket, thread-argument, temporary cache and executable-cleanup checks also pass. Of the 30 invalid inputs, the original script accepted and wrote a summary for 24 on 5.1 and 26 on 7; the remaining cases already threw but lacked file/line diagnostics. Two literal-path cases account for the other baseline failures. Commands run with both powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/cold-pso-bench.tests.ps1
pwsh.exe -NoProfile -ExecutionPolicy Bypass -File scripts/cold-pso-bench.tests.ps1
git diff --checkFor the baseline, the final fixture was run beside an untouched copy of Not tested No new GPU/cold-cache measurement, retail smoke or full Rust-suite run for this script-only follow-up. This does not refresh the runtime PR's merge-validation evidence or prove that a timing file includes every expected pipeline. AI use Codex (exact model identifier unavailable), with subagents, wrote the patch, regression fixture and this report and checked the measured results. |
|
@jeroenhaentjens thank you, the cases are real: an AI use: Claude Code (Claude Opus 5.5) drafted this reply. |
|
Ampere data point for #2129 (RTX 3080 10 GB), script at Setup: NVIDIA GeForce RTX 3080 10 GB, driver 617.42 (32-lane waves only); AMD Ryzen 5 5600 (6 cores, 12 threads); 32 GB RAM; Windows 11 IoT Enterprise LTSC 26100, Developer Mode on. Release build of Tested on
Run: the unmodified
What it shows on this machine:
Not tested: Run and written with Claude Code (Claude Opus 5.5). |
|
Retested the incorporated change on Short-process measurement on
Windows 11 26100.9711, Core i7-13700. Synthetic process only; no GPU workload or real shader timings. OpenAI Codex (GPT-6) implemented the candidate and ran these checks. Earlier checks on the child environment and on the CSV follow-upI independently tested @jeroenhaentjens's script-only follow-up on top of Five-line follow-up and regression, based directly on the linked CSV patch for its author to use separately. After preparation succeeds, the script removes the superseded summary before replacing timing files. If preparation fails, the previous summary remains available. A valid retry writes a new summary.
Windows 11 build 26100.9711, i7-13700. No real shader pack, GPU workload or driver timings. OpenAI Codex (GPT-6) ran the checks and prepared the incremental change. Follow-up on the benchmark environment review. On I ran I also tried the candidate together with #2495 at |
|
@Creaa @RavenCurseBurg published the separate follow-up as draft #2495, stacked on this PR as requested. Only top commit f4ac6cd belongs to the follow-up. I reproduced the stale-summary case on dcd14b8 plus the supplied regression: 37 passed / 1 failed in both Windows PowerShell 5.1 and PowerShell 7. Incorporated the fix with RavenCurseBurg credited as co-author, and added valid-retry and byte-for-byte preparation-failure preservation checks. Final result in both shells: 39 timing cases passed, 0 failed, plus the preparation check. Full workspace build passes; tests on the exact final head: 1154 passed, 1 failed, 46 ignored, 25 explicit skips. The sole failure is the adapter-selection test fixed by #2318, absent from this parent. The draft documents the inherited shaders.rs conflict and smoke requirement while #2129 remains pending. No real shader-pack or performance result is claimed. AI use: OpenAI Codex (GPT-6; exact deployment variant unavailable), including an independent subagent diff review. |
Validate timing rows and report file/line errors instead of publishing misleading zero-cost results. Use literal output paths. After preparation succeeds, remove the old summary before replacing timings; a failed preparation preserves the previous complete result. Stop before measuring if a locked or read-only timing file cannot be removed. Otherwise an exit-zero producer can leave old readable rows and publish them as a fresh measurement. Adopt RavenCurseBurg's two fixes and extend their regressions with no-start, byte preservation and fresh-retry checks. Windows PowerShell 5.1 and PowerShell 7 each pass all 39 timing cases, preparation preservation and both replacement/retry cases. With the prior production script, both new replacement cases fail in each shell. Stacked on xcl-dev#2129. Part of xcl-dev#2088. Source: RavenCurseBurg@4b190ba Source: RavenCurseBurg@91e1e60 Co-authored-by: RavenCurseBurg <360931527+RavenCurseBurg@users.noreply.github.com> Assisted-by: OpenAI Codex (GPT-6; exact deployment variant unavailable)
bmjask
left a comment
There was a problem hiding this comment.
P1 benchmark validity: cold-pso-bench.ps1 never sets XCL_PIPELINE_MAX_KB=0, so the default 8 MiB cap makes make_with_cache_path return before emitting XCL_PIPELINE_TIMES. The script can claim every compute pipeline while omitting all >8 MiB programs from summaries. Disable the cap and test capped fixture. P2: -ClearNvCache inherits XCL_PIPELINE_CACHE_OFF=1 because child environment is unsanitized, potentially disabling caches/refusing Developer Mode; remove/sanitize it and test inherited state. Short runs can also under-report wall/peak memory due stopwatch/sampling placement.
8b69014 to
510f768
Compare
|
@bmjask thanks, right: with the default cap a program over 8 MiB returned before its timing line, so the summary dropped exactly the biggest ones without a word. Fixed in AI use: Claude Code (Claude Opus 5.5) made the change, ran the checks and drafted this reply. |
xcl-dev#2088) pass at 4 to 24 workers. scripts/cold-pso-bench.ps1 fills a DXIL cache once (DXC, not timed), then makes every compute pipeline of the same input again for each thread count with XCL's driver blobs off and either the implicit D3D and driver shader caches off (XCL_PIPELINE_CACHE_OFF=1, Developer Mode) or the NVIDIA DXCache folder emptied (-ClearNvCache), and tabulates wall and CPU time, peak commit, summed driver time and p50/p95/max per pipeline, also per DXIL size bucket. xcl shaders --pipelines gets the two switches it needs: - XCL_PIPELINE_TIMES=<file>: one CSV line per pipeline (DXIL hash and bytes, made/reused/refused, slot wait and time in CreateComputePipelineState); - XCL_PIPELINE_CACHE_OFF=1: the pass turns the implicit caches off through the helper --measure-pso already used (now shared), or refuses to run. On an RTX 4070 (617.14, i7-13700F), 67 compute programs (every 40th of a retail pack), cold: wall time 558 s at 4 threads, 430 s at 6 and 415-432 s from 8 to 24, CPU time ~2100-2400 s throughout, while summed driver time grew 2.6x and peak commit 5.5 -> 13.6 GB. The fixture test runs with its own LOCALAPPDATA and without inherited XCL_PIPELINE_TIMES / XCL_PIPELINE_CACHE_OFF, so -ClearNvCache never empties a real NVIDIA cache and no real timing file gets rows (found and fixed by itsSio in review). Every measured run starts a copy of the exe under a name of its own, next to the original, and removes it afterwards: the AMD driver keys its shader cache on the exe's file name, so with -ClearNvCache on AMD the second run of a sweep was served warm and reported as cold (found and measured on RDNA4 by bielfreedom in review). -Threads is read as text and split on commas: from cmd or bash, `powershell -File ... -Threads 4,8` passes one string "4,8", which an [int[]] parameter silently read as 48 threads; anything that is not a thread count is refused. Every measured run also turns off the 8 MiB DXIL cap of --pipelines (XCL_PIPELINE_MAX_KB=0): a capped program returns before writing its timing line, so the summary silently left out the biggest programs (found by bmjask in review). With -ClearNvCache the runs set XCL_PIPELINE_CACHE_OFF=0 rather than leaving it out, so a caller's =1 does not turn the switch back on; and wall time and peak commit come from the process itself (start and exit times, PeakPagefileUsage on its handle), since a child shorter than the one-second sampling showed 0 MB (both found by bmjask in review; the measurement change is RavenCurseBurg's). Co-Authored-By: itsSio <31954644+itsSio@users.noreply.github.com> Co-Authored-By: bielfreedom <341226708+bielfreedom@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: RavenCurseBurg <360931527+RavenCurseBurg@users.noreply.github.com>
510f768 to
30a3ef1
Compare
|
@bmjask the other two points are in now too (my previous reply only covered the cap, sorry):
Squashed into the PR's commit, now AI use: Claude Code (Claude Opus 5.5) made the P2 change, took in the P3 commit, ran the checks and drafted this reply. |
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
A reproducible cold benchmark of the compute-pipeline pass, for workstream 6 of #2088: every compute pipeline of a fixed input made again at each thread count with no warm cache, and a table of what each thread count costs. Part of #2088.
scripts/cold-pso-bench.ps1fills a DXIL cache once (DXC, not timed), then for each thread count runsxcl shaders <input> --precompile --only cs --pipelineswith XCL's driver blobs off (XCL_PSO_DISK_CACHE=0) and either the implicit D3D and driver shader caches off (XCL_PIPELINE_CACHE_OFF=1, needs Developer Mode) or the NVIDIA DXCache folder emptied (-ClearNvCache). It prints wall and CPU time, peak commit, pipelines made/refused, summed driver time and p50/p95/max per pipeline, the same per DXIL size bucket, and writessummary.csv.What is in it
crates/xcl/src/shaders.rs:XCL_PIPELINE_TIMES=<file>writes one CSV line per pipeline of--pipelines(DXIL hash and bytes,made/reused/refused, slot wait ms, ms insideCreateComputePipelineState);XCL_PIPELINE_CACHE_OFF=1turns the implicit caches off for the pass or refuses to run, through the helper--measure-psoalready used (taken out of it and shared); the setup error no longer says "no GPU device" when the cause is the cache switch. Test:pipeline_timing_lines_name_the_dxil_outcome_and_both_times.scripts/cold-pso-bench.ps1andscripts/cold-pso-bench.tests.ps1(fixturexcl.cmd: the environment and arguments of each run, the summary and bucket rows). Every measured run turns off the 8 MiB DXIL cap of--pipelines(XCL_PIPELINE_MAX_KB=0): a capped program writes no timing line, so the summary would leave out the biggest programs (found by @bmjask in review); the fixture checks the variable for each run. With-ClearNvCachethe runs setXCL_PIPELINE_CACHE_OFF=0, so a caller's=1does not come back through the inherited environment. Wall time is taken from the process's start and exit times and peak commit fromPeakPagefileUsageon its handle, so short runs are not under-reported (@RavenCurseBurg's change, co-authored). The fixture runs with its ownLOCALAPPDATAand no inheritedXCL_PIPELINE_TIMES/XCL_PIPELINE_CACHE_OFF, so its-ClearNvCachecase cannot empty a real NVIDIA cache or add rows to a real timing file (found and fixed by @itsSio in review, co-author of the commit). Every measured run starts a copy of-Xclunder a name of its own, next to the original (so it finds the same DXC and Agility SDK folders), and removes it afterwards: the AMD driver keys its shader cache on the exe's file name, so with-ClearNvCacheon AMD every run after the first was warm but reported as cold (found and measured on RDNA4 by @bielfreedom in review, co-author of the commit); the fixture checks that each run gets a new name and that no copy is left.-Threadsis read as text and split on commas: from cmd or bash,powershell -File ... -Threads 4,8passes one string, which the[int[]]parameter silently read as 48 threads; the fixture runs that form through-Fileand checks it gives two runs, and that-Threads 4,xis refused.Tested
cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1424 passed, 0 failed, 46 ignored (rebased ontomaine1d84b7). SKIPPED: the wave64 GPU tests (no wave64), the direct-DXIL f16/f32 cases refused per gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426,heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(Developer Mode is off) and the D3D12 debug-layer tests.powershell -File scripts\cold-pso-bench.tests.ps1: ok; also run from a caller with a cache folder holding a sentinel, a timing CSV with rows andXCL_PIPELINE_CACHE_OFF=1set: all three unchanged afterwards (without the fix the run fails on the inherited timing file). With the per-run exe name: the fixture test fails on the previous script (xclinstead ofxcl-cold-4-<id>) and passes now, as does the-File -Threads 3,5case (one run of 35 threads before); a real run on the RTX 4070 (-Limit 12 -ClearNvCache, release build of this head) made 12 of 12 pipelines through the copy and left no copy behind.-ClearNvCache, one run per thread count:By DXIL size at 4 / 12 / 24 threads, summed driver s: < 64 KiB (23 programs) 2.4 / 5.1 / 5.9; 64–256 KiB (23) 65 / 160 / 323; 256 KiB–1 MiB (9) 461 / 888 / 1 403; 1–4 MiB (12) 1 586 / 2 933 / 3 865.
On this machine the wall time stops improving at about 6 threads and the CPU time stays at ~2 100–2 400 s whatever the thread count: one process gets about 5.5 cores' worth of driver work. More threads only stretch each compile (p50 ×5.5, max ×1.9 from 4 to 24) and raise peak commit 2.5×. One run per thread count; the 12 programs of 1–4 MiB are most of the time.
Regression run
main:
this PR:
The title run does not reach the changed code (
xcl shadersonly); it is the regression check the PR checks ask for.Not tested
XCL_PIPELINE_CACHE_OFF=1on hardware: Developer Mode is off here, so the numbers above use-ClearNvCache(NVIDIA's DXCache folder emptied before each run). Only its refusal path ran (the--measure-psotest's skip shows the same error).AI use
🤖 Generated with Claude Code