Repository navigation
Conversation
At every launch the preparation workers created each used compute pipeline from its stored driver blob only to run its check (the driver makes a pipeline from the blob and returns a blob of the same size), and dropped it. Creating a pipeline from a blob is not free: on an RTX 4080 (driver 621.40) it was measured to cost as much as compiling it, and the preparation took 7-8 minutes at every launch, also right after a launch that had completed it (186 of 192 slow creations in two launches were such hits). A blob that passed that check, or that was just written, now gets a marker beside it (`<blob>.ok`: the driver's identity, the blob's length and a digest of its bytes). A later pass counts a record whose blob still matches its marker as prepared without creating the pipeline. This is the same check as before, so it changes when the check runs, not what it proves (it does not show that the driver used the blob). A blob that changed, also at the same length, is checked the old way and repaired; a blob the driver refuses is removed together with its marker. XCL_PREPARE_VERIFY=1 checks every blob again. Assisted-by: Claude Code (Claude Fable 5.2; first version written by a Claude Sonnet 5.5 sub-agent, reviewed by a Claude Opus 5.5 sub-agent) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
On
All seven AI use: OpenAI Codex with GPT-6.2 Astra prepared the synthetic checks and compared the CLI counters and cache files; Codex coordinated and prepared this report. |
|
I checked whether marker-bypass savings shifted into the first native consumer PSO creation, using head
All 384 consumer creates succeeded. One 115.253 ms trust/supplied preparation outlier is retained. The paired subtotal excludes fixture/setup overhead. Consumer blob I/O and root-signature setup were outside the timed native calls; PSOs remained alive. This checks a small synthetic corpus on one device and shows little transfer of the preparation difference to first native creation in this setup. It does not establish which blob path a title uses, cold-driver behavior, GTA VI startup, dispatch correctness or frame time. AI use: OpenAI Codex with GPT-6.2 Astra built and ran the synthetic measurement and audited the artifacts; Codex coordinated and prepared this report. |
|
@andrewDoing thank you for both checks, in particular the second one: whether the saving just moves into the title's first creation was the open point in Not tested, and your 32 processes on driver 616.92 show little transfer for small programs. The size cap together with a same-length overwrite is a combination I had not run. Status of the checks: AI use: Claude Code (Claude Fable 5.2). |
|
Independent back-to-back verification on RTX 3060 Ti (8 GB) + Ryzen 5 5500 (6C/12T) ( Setup
Two consecutive 90 s runs on the same cache folder
Not tested: driver update invalidation / tampered-blob fallback test on this machine, AMD/Intel adapters. |
luckyteagirl
left a comment
There was a problem hiding this comment.
On 40a14da3716bc28d0c34c86928de987a473192bb, the cold creation path marks a freshly exported blob verified as soon as driver_cache::write succeeds. That path cleared desc.CachedPSO and built the pipeline from DXIL, so the newly written bytes have not passed the check described for this marker: importing them through CreateComputePipelineState, then receiving a cached blob of the same size. On the next normal launch driver_cache::verified returns early and may never perform that check. Could the first pass round-trip the exported blob before marking it, or defer the marker until from_cache succeeds on a later pass? The new test currently expects a marker immediately after cold creation and would need to cover the intended cold → checked → trusted sequence. This is exact-head source review; I did not demonstrate a driver that rejects its own exported blob.
AI use: OpenAI Codex (GPT-6.2 Sol) traced the cold and trusted paths and checked the discussion; OpenAI Codex (GPT-6.2 Astra) independently read the exact source and wrote this review.
|
amd-win check of
What this says for AMD: creating the pipelines from the stored blobs costs almost nothing here. The whole second pass of the base, translation included, takes 3.4 s for 238 pipelines (at most about 57 ms each on average with 4 threads), against 159 s for the first pass. So on this driver the marker saves about 0.1 s per launch and is neutral, in contrast to the 19.7 s per create reported on the RTX 4080. It also did no harm: 0 refused, 0 errors, identical pass 1 time. Not tested: a title run, graphics pipelines, a driver or adapter change between passes, other AMD parts, NVIDIA. The AMD driver's own cache was warm from earlier runs (blobs here are names of entries in it), so this says nothing about a cold driver cache. AI use: Claude Code (Claude Sonnet 5.5) ran the tests and runs and wrote this. |
|
Following the fresh-export review point, I tried the smallest local resolution on #2951 head On Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC, DXC 1.8.2502.11:
Candidate diff for the author--- a/crates/xcl/src/shaders.rs
+++ b/crates/xcl/src/shaders.rs
@@
- /// The pass that made a blob marks it; the next pass counts it as trusted and creates nothing,
- /// and with `verify` it creates the pipeline from the blob again.
+ /// A cold pass writes the blob; the next pass checks it through the driver and marks it.
+ /// Only a later pass trusts that marker without creating the pipeline again.
@@
pipelines.make(&compiled);
assert_eq!(pipelines.made.load(Ordering::Relaxed), 1);
- assert!(driver_cache::verified(&path, identity), "a blob the driver just made is marked");
+ assert!(!driver_cache::verified(&path, identity), "a newly exported blob has not been checked by re-import");
pipelines.make(&compiled);
+ assert_eq!((pipelines.made.load(Ordering::Relaxed), pipelines.reused.load(Ordering::Relaxed)), (2, 1), "checked through the driver");
+ assert!(driver_cache::verified(&path, identity), "a checked blob is marked");
+ pipelines.make(&compiled);
assert_eq!(pipelines.trusted.load(Ordering::Relaxed), 1);
- assert_eq!((pipelines.made.load(Ordering::Relaxed), pipelines.reused.load(Ordering::Relaxed)), (1, 0), "nothing created");
+ assert_eq!((pipelines.made.load(Ordering::Relaxed), pipelines.reused.load(Ordering::Relaxed)), (2, 1), "trusted without another creation");
pipelines.verify = true;
pipelines.make(&compiled);
- assert_eq!((pipelines.made.load(Ordering::Relaxed), pipelines.reused.load(Ordering::Relaxed)), (2, 1), "created from the blob again");
+ assert_eq!((pipelines.made.load(Ordering::Relaxed), pipelines.reused.load(Ordering::Relaxed)), (3, 2), "created from the blob again");
@@
- if driver_cache::write(path, written) {
- if let Some(identity) = self.identity {
- driver_cache::mark_verified(path, identity, written);
- }
- }
+ driver_cache::write(path, written);
--- a/crates/xcl/tests/gpu_compute_e2e.rs
+++ b/crates/xcl/tests/gpu_compute_e2e.rs
@@
- let again = run_trusting();
- assert!(again.contains("pipelines whose blob an earlier pass verified, not created again 1"), "{again}");
+ let checked_again = run_trusting();
+ assert!(checked_again.contains("pipelines loaded from the driver cache 1"), "{checked_again}");
+ assert!(checked_again.contains("pipelines whose blob an earlier pass verified, not created again 0"), "{checked_again}");
+ let trusted_again = run_trusting();
+ assert!(trusted_again.contains("pipelines whose blob an earlier pass verified, not created again 1"), "{trusted_again}");The tradeoff is that the first later launch with a fresh blob must do the driver check; the next matching launch can skip it. The current second-launch timing claim should be remeasured if this is adopted. I did not run the full workspace suite or paired title smoke on this uncommitted candidate. AI use: Codex (GPT-6.2 Sol) traced the paths, wrote the local diff and ran these tests. |
|
Tested Clean
All eight CLI controls and the libtest passed. Zero failures, ignores, or runtime skips. The pinned identity probe identified Arc PCI 8086:56a0. Each Arc process used the shared mutex separately. Not tested A real adapter or driver change, Arc performance, retail smoke and full suite. AI use T3 Code / Codex ( |
At every launch the shader preparation created each used compute pipeline again from its stored driver blob, only to apply its check (the driver makes a pipeline from the blob and returns a blob of the same size), and then dropped the pipeline. That is not free: on an RTX 4080 (driver 621.40) creating a large pipeline from its blob was measured to take as long as compiling it, so the preparation took minutes at every launch, also right after a launch that had completed it. This PR remembers that a blob passed the check and does not create its pipeline again. Part of #2088 (plan and discussion there; the content digest is @ettehn's point).
What is in it
crates/xcl/src/hle/d3d12x/real.rs(driver_cache): a marker<blob>.okbeside a blob that passed the check or was just written: the driver's identity (the one the graphics blobs use), the blob's length and an FNV-64 digest of its bytes.verifiedcompares all three with the file as it is now;removedeletes a refused blob together with its marker.crates/xcl/src/shaders.rs(Pipelines::make_one): a record whose blob matches its marker is counted ("pipelines whose blob an earlier pass verified, not created again N") and returns before the worker slot and the driver call. Anything else goes the present way and is marked afterwards.XCL_PREPARE_VERIFY=1applies the check to every blob again.a_verified_blob_is_trusted_until_it_changes_or_is_refused(other driver, changed length, same-length overwrite, missing blob, refusal), GPU testa_second_pass_trusts_the_blobs_the_first_verified, andgpu_compute_e2e::offline_compute_pipeline_is_reused_by_a_second_processextended across processes (trusted; a blob overwritten with zeros of the same length is rebuilt and trusted again). Two existing e2e tests list only.psofiles and run their reuse assertions withXCL_PREPARE_VERIFY=1, unchanged otherwise.README.md: one bullet for the markers and the switch.The marker says what the preparation's check said before, no more: it does not prove the driver used the blob (the comment at the check already notes a driver may compile from the DXIL and still succeed). It changes when the check runs, not what it proves.
Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on 551bcb90 (this commit before a comment-only amend): 1825 passed, 8 failed, 48 ignored, 27 SKIPPED lines (mostly "no wave64", two "no heap windows"). The 8 failures are 6 tests that fail the same way on the clean baseecc0bb57on this machine, each rerun alone with and without the change: listed in Nvidia dev #2572 (comment). None is in code this PR touches exceptgpu_compute_e2e, where the two failing tests fail at the same lines without it.cargo test -p xcl --lib driver_cache: 7 passed;--lib pipeline_cap_tests: 4 passed;--test gpu_compute_e2e: 5 passed, 2 failed (the two above).XCL_PREPARE_VERIFY=1(the present behaviour) 131 s (compute pipelines 120 s); the two launches after it, with the markers, 11 s and 11 s (compute pipelines 3 s). 4,203 markers were written.Regression run
On the base commit (
nvidia-dev, notmain: this PR is againstnvidia-dev) and on this PR's head, same title, 120 s:Not tested
XCL_PREPARE_VERIFY=1does.AI use
🤖 Generated with Claude Code