Shaders: size-based admission for big compute driver compiles #1774

Manually merged
github merged 3 commits from gh-pr/1774/head into gh-pr/1774/base 2026-11-26 05:04:35 +00:00
Owner

@⁠brandostrong on GitHub · 2026-11-24 20:34 UTC · original
brandostrong:a19-size-admission → main · +149 −17 · 3 files · 3 commits · merged 2026-11-25 00:54 UTC

Bounds what a big compute driver compile may spend. The commit headroom a background
compile waits for now scales with the program's DXIL size, and xcl shaders --pipelines
leaves programs over a DXIL cap to the runtime instead of hanging the pass on them.

Measured on the retail pack (#1269): the driver's compile of a 29.8 MB program grew past
14 GB of free commit before it was stopped, and programs of ~1 MB took several GB each on
an 8 GB card; three programs of 29–30 MB DXIL hung --precompile --only cs --pipelines
for 33+ minutes on three machines (#744). The 3 GB headroom floor was measured on the
256 KiB class (~1.5 GB each); above 6 MiB of DXIL it now asks for 512× the DXIL size, and
the offline pass skips what it cannot afford. The title path is unchanged for everything
up to 6 MiB (the floor), and the runtime still builds a capped program when a title needs
the pipeline.

Part of #1269 (campaign task A19).

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: big_compile_headroom(dxil_len) = max(3 GB, 512× DXIL size); big_compile_commit_free waits for that much, through main's driver_compile_identified gate (both the big and the giant lane); headroom test
  • crates/xcl/src/shaders.rs: XCL_PIPELINE_MAX_KB (KiB of DXIL, 8 MiB default, 0 turns the cap off) caps the --pipelines stage; capped programs counted and reported; cap-resolution test
  • crates/xcl/src/shaders.rs: a stale driver blob no longer bypasses the cap — a blob the driver rejects (or accepts while recompiling internally) is removed, the program counts as capped, and the uncached compile is skipped; regression test from #1774 (WebIdentity1)
  • README.md: the cap documented

Tested

  • RTX 4090 (driver 616.64), i9-13900K, 32 GB RAM, Windows 11 26200, cargo 1.100.0, debug and release
  • cargo test --workspace -- --test-threads=4 on 6b9b14f: 963 passed, 0 failed, 43 ignored; 22 SKIPPED, all adapter limits of this wave32 card: the wave64 lowering/comparison GPU tests (gpu::recomp::lower::tests::*, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware) and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)
  • the stale-blob regression test on this adapter: with a deliberately invalid blob and the cap one byte below the DXIL, the program is capped (not compiled), the blob file is removed, and a runtime GPU dispatch of the same DXIL still gives the right output
  • retail pack, --precompile --only cs --pipelines with XCL_PIPELINE_MAX_KB=1: the pipeline stage compiled only the programs at or under the cap (375 made, 0 refused) and capped the rest; the pass was interrupted before its final count (it is resumable). The same pass showed the DXC leg stalling ~176 s over records 22600–22800 (the > 8 MB HLSL programs at -O0) — that leg is not capped here and still finishes
  • a retail title smoke pair below; nothing changes at the screens reached in 150 s (the cap is CLI-side, and the headroom floor is unchanged for the ≤ 6 MiB programs the title builds)

Regression run

Both runs below reached the same screen (post-EULA world load) on the same profile; both
stall there identically — 0 presents in the last 6 s at ~33 GB commit — which is the
pre-existing world-load freeze on main (see #1269), not something this PR introduces or
fixes. No crash, no device removal on either.

xcl-smoke v1
commit: c4d37bec1bb4286eb373aea963404a23f13401fa
gpu: NVIDIA GeForce RTX 4090
title: 3c290c16
seconds: 150
exit: 0x0
frames shown: 1594 (PresentX 1594)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 32855 MB
xcl-smoke v1
commit: 6b9b14fd636ae26152c02eeb8c0f34c51bbd55f7
gpu: NVIDIA GeForce RTX 4090
title: 3c290c16
seconds: 150
exit: 0x0
frames shown: 1592 (PresentX 1592)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 32992 MB

Not tested

  • AMD / RADV; 8 GB-VRAM cards, where the headroom change matters most
  • a --pipelines pass run to completion at the 8 MiB default on the retail pack (resumable; the capped line is unit-tested, the full-pass finish is not yet measured here)
  • a title run that actually builds a > 6 MiB DXIL program

AI use

  • Claude Code, Claude Opus 5.5: wrote the code, the tests, and this description, and ran the suite and the smoke pair; the stale-blob fix and its test come from WebIdentity1's #1774 comment (Codex GPT-6, tested on an RTX 3090), adapted here for the driver-accepts-and-recompiles case; the user reviewed the diff.

🤖 Generated with Claude Code

**@⁠brandostrong** on GitHub · 2026-11-24 20:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/1774) `brandostrong:a19-size-admission` → `main` · +149 −17 · 3 files · 3 commits · merged 2026-11-25 00:54 UTC Bounds what a big compute driver compile may spend. The commit headroom a background compile waits for now scales with the program's DXIL size, and `xcl shaders --pipelines` leaves programs over a DXIL cap to the runtime instead of hanging the pass on them. Measured on the retail pack (#1269): the driver's compile of a 29.8 MB program grew past 14 GB of free commit before it was stopped, and programs of ~1 MB took several GB each on an 8 GB card; three programs of 29–30 MB DXIL hung `--precompile --only cs --pipelines` for 33+ minutes on three machines (#744). The 3 GB headroom floor was measured on the 256 KiB class (~1.5 GB each); above 6 MiB of DXIL it now asks for 512× the DXIL size, and the offline pass skips what it cannot afford. The title path is unchanged for everything up to 6 MiB (the floor), and the runtime still builds a capped program when a title needs the pipeline. Part of #1269 (campaign task A19). **What is in it** - `crates/xcl/src/hle/d3d12x/real.rs`: `big_compile_headroom(dxil_len)` = max(3 GB, 512× DXIL size); `big_compile_commit_free` waits for that much, through main's `driver_compile_identified` gate (both the big and the giant lane); headroom test - `crates/xcl/src/shaders.rs`: `XCL_PIPELINE_MAX_KB` (KiB of DXIL, 8 MiB default, 0 turns the cap off) caps the `--pipelines` stage; capped programs counted and reported; cap-resolution test - `crates/xcl/src/shaders.rs`: a stale driver blob no longer bypasses the cap — a blob the driver rejects (or accepts while recompiling internally) is removed, the program counts as capped, and the uncached compile is skipped; regression test from #1774 (WebIdentity1) - `README.md`: the cap documented **Tested** - RTX 4090 (driver 616.64), i9-13900K, 32 GB RAM, Windows 11 26200, cargo 1.100.0, debug and release - `cargo test --workspace -- --test-threads=4` on `6b9b14f`: 963 passed, 0 failed, 43 ignored; 22 SKIPPED, all adapter limits of this wave32 card: the wave64 lowering/comparison GPU tests (`gpu::recomp::lower::tests::*`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`) and `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows) - the stale-blob regression test on this adapter: with a deliberately invalid blob and the cap one byte below the DXIL, the program is capped (not compiled), the blob file is removed, and a runtime GPU dispatch of the same DXIL still gives the right output - retail pack, `--precompile --only cs --pipelines` with `XCL_PIPELINE_MAX_KB=1`: the pipeline stage compiled only the programs at or under the cap (375 made, 0 refused) and capped the rest; the pass was interrupted before its final count (it is resumable). The same pass showed the DXC leg stalling ~176 s over records 22600–22800 (the > 8 MB HLSL programs at `-O0`) — that leg is not capped here and still finishes - a retail title smoke pair below; nothing changes at the screens reached in 150 s (the cap is CLI-side, and the headroom floor is unchanged for the ≤ 6 MiB programs the title builds) **Regression run** Both runs below reached the same screen (post-EULA world load) on the same profile; both stall there identically — 0 presents in the last 6 s at ~33 GB commit — which is the pre-existing world-load freeze on main (see #1269), not something this PR introduces or fixes. No crash, no device removal on either. ``` xcl-smoke v1 commit: c4d37bec1bb4286eb373aea963404a23f13401fa gpu: NVIDIA GeForce RTX 4090 title: 3c290c16 seconds: 150 exit: 0x0 frames shown: 1594 (PresentX 1594) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 32855 MB ``` ``` xcl-smoke v1 commit: 6b9b14fd636ae26152c02eeb8c0f34c51bbd55f7 gpu: NVIDIA GeForce RTX 4090 title: 3c290c16 seconds: 150 exit: 0x0 frames shown: 1592 (PresentX 1592) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 32992 MB ``` **Not tested** - AMD / RADV; 8 GB-VRAM cards, where the headroom change matters most - a `--pipelines` pass run to completion at the 8 MiB default on the retail pack (resumable; the capped line is unit-tested, the full-pass finish is not yet measured here) - a title run that actually builds a > 6 MiB DXIL program **AI use** - Claude Code, Claude Opus 5.5: wrote the code, the tests, and this description, and ran the suite and the smoke pair; the stale-blob fix and its test come from WebIdentity1's #1774 comment (Codex GPT-6, tested on an RTX 3090), adapted here for the driver-accepts-and-recompiles case; the user reviewed the diff. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The 3 GB floor was measured on the 256 KiB class (~1.5 GB each in the
driver). The programs at the other end are a different order: the
driver compile of a 29.8 MB program grew past 14 GB of free commit
before it was stopped, and ~1 MB programs took several GB each on an 8
GB card (xcl-dev/xcl#1269). Ask for max(3 GB, 512x DXIL size), so a
giant program waits for headroom instead of exhausting commit next to a
loading title. Programs up to 6 MiB of DXIL wait for exactly what they
waited for before.

Part of xcl-dev/xcl#1269 (A19).

Co-Authored-By: Claude Code <[email protected]>
The precompile pass stopped advancing on the biggest compute programs:
their driver compile takes tens of minutes and gigabytes (three of
29-30 MB DXIL hung --precompile --only cs --pipelines for 33+ minutes
on three machines, xcl-dev/xcl#744). Skip programs whose DXIL is over
XCL_PIPELINE_MAX_KB (8 MiB by default; 0 turns the cap off) when no
blob exists yet, count them, and report the total; the runtime still
builds one when a title needs the pipeline. 8 MiB sits above the
largest program that ever completes (~2.2 MB, the optimized class) and
below the smallest that hangs (14.1 MB), so the pass now finishes.

Part of xcl-dev/xcl#1269 (A19).

Co-Authored-By: Claude Code <[email protected]>
The --pipelines cap only gated programs with no saved blob: a blob the
driver rejects (after an adapter or driver change) fell through to the
uncached compile, recompiling exactly the giant programs the cap exists
to skip. NVIDIA drivers showed both faces: a hard reject (Err) when cold,
and an Ok with an internal recompile when their own cache had the result
- the latter looked like a blob hit and bypassed the cap too. A blob
attempt now counts as a hit only when the pipeline carries a blob of the
size handed to it; a miss over the cap removes the stale file, counts the
program as capped, and returns before the uncached compile.

Diagnosis, regression test and the first version of the fix from
WebIdentity1 in #1774 (tested on an RTX 3090); the hit-detection filter
and the Ok-with-internal-fallback case added here (RTX 4090).

Co-Authored-By: Claude Code <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:04:33 +00:00
github manually merged commit 6b9b14fd63 into gh-pr/1774/base 2026-11-26 05:04:35 +00:00
Author
Owner

@⁠eizispark on GitHub · 2026-11-24 21:16 UTC · original

Hardware test report — commit a239e35

Verified a239e358922fad455fb91b7f9f11218e32f9619d (clean merge with main 7f7e768): pass.

Tested

  • Hardware: AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 x64 (stable-x86_64-pc-windows-msvc, rustc 1.100.0 (0ef1bc386 2026-11-09)), debug tests + release smoke
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 893 passed, 0 failed, 42 ignored (2 skipped: shaders::tests::pso_measurement_compiles_an_exact_synthetic_record — Windows Developer Mode required (0x887A002D); heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows)
  • hle::d3d12x::real::big_compile_tests::headroom_is_the_3_gb_floor_until_512_times_the_dxil_exceeds_it, shaders::pipeline_cap_tests::the_cap_is_8_mib_unless_set_and_off_at_zero, console_wave64_compute_through_the_pso_hook_dispatch_and_read_back, and both native RDNA4 wave64 GPU tests (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware) passed cleanly

Regression run (scripts/smoke.ps1, 60 s, warm shader/driver cache)
main (85e38262ff94aecd75d6f83fa8156a8b7697bd13):

xcl-smoke v1
commit: 85e38262ff94aecd75d6f83fa8156a8b7697bd13
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1669 (PresentX 1669)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14860 MB

PR (a239e358922fad455fb91b7f9f11218e32f9619d):

xcl-smoke v1
commit: a239e358922fad455fb91b7f9f11218e32f9619d
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1677 (PresentX 1677)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14857 MB

Not tested

  • full xcl shaders --pipelines pack run hitting > 8 MiB compute DXIL containers or XCL_PIPELINES_MAX_DXIL_KB overrides, NVIDIA/Intel GPUs, Wine/vkd3d-proton, gameplay past the menus

AI use

  • Verified and formatted with Antigravity (Google DeepMind, Gemini 4 Carbon).
**@⁠eizispark** on GitHub · 2026-11-24 21:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/1774#issuecomment-7144713879) ### Hardware test report — commit `a239e35` Verified `a239e358922fad455fb91b7f9f11218e32f9619d` (clean merge with `main` `7f7e768`): **pass**. **Tested** - Hardware: AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64, driver `32.0.32015.16001`), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 x64 (`stable-x86_64-pc-windows-msvc`, `rustc 1.100.0 (0ef1bc386 2026-11-09)`), debug tests + release smoke - `cargo test --workspace --no-fail-fast -- --test-threads=4`: `893 passed, 0 failed, 42 ignored` (`2 skipped`: `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record` — Windows Developer Mode required (`0x887A002D`); `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows`) - `hle::d3d12x::real::big_compile_tests::headroom_is_the_3_gb_floor_until_512_times_the_dxil_exceeds_it`, `shaders::pipeline_cap_tests::the_cap_is_8_mib_unless_set_and_off_at_zero`, `console_wave64_compute_through_the_pso_hook_dispatch_and_read_back`, and both native RDNA4 wave64 GPU tests (`gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`) passed cleanly **Regression run** (`scripts/smoke.ps1`, 60 s, warm shader/driver cache) `main` (`85e38262ff94aecd75d6f83fa8156a8b7697bd13`): ``` xcl-smoke v1 commit: 85e38262ff94aecd75d6f83fa8156a8b7697bd13 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1669 (PresentX 1669) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14860 MB ``` PR (`a239e358922fad455fb91b7f9f11218e32f9619d`): ``` xcl-smoke v1 commit: a239e358922fad455fb91b7f9f11218e32f9619d gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1677 (PresentX 1677) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14857 MB ``` **Not tested** - full `xcl shaders --pipelines` pack run hitting `> 8 MiB` compute DXIL containers or `XCL_PIPELINES_MAX_DXIL_KB` overrides, NVIDIA/Intel GPUs, Wine/vkd3d-proton, gameplay past the menus **AI use** - Verified and formatted with Antigravity (Google DeepMind, Gemini 4 Carbon).
Author
Owner

@⁠WebIdentity1 on GitHub · 2026-11-24 21:12 UTC · original · edited 2026-11-24 21:26 UTC

I found a reproducible cap bypass on exact head a239e358922fad455fb91b7f9f11218e32f9619d. In Pipelines::make (crates/xcl/src/shaders.rs), the new over-cap check asks whether driver_cache::load returned bytes. If a nonempty blob is then rejected by CreateComputePipelineState, the fallback still compiles that over-cap DXIL from scratch. A stale blob after a driver or adapter change can therefore defeat XCL_PIPELINE_MAX_KB.

3090 negative control and local fix check: With an isolated cache, I wrote an intentionally invalid PSO blob for public synthetic 2,816-byte compute DXIL, set the diagnostic cap to 2,815 bytes, and dispatched the same shader to check GPU output. Unchanged head plus test-only fixture: 0 passed / 1 failed / 0 ignored (expected), capped=0, made=1, refused=0, GPU output 42. A local candidate that checks the cap again after cached-PSO rejection, removes the stale blob and returns before the uncached fallback: 1 passed / 0 failed / 0 ignored, capped=1, made=0, refused=0, GPU output still 42. No skips or device removal. Both 295-file source snapshots matched their SHA256 manifests before and after native testing. Windows 10 19045, RTX 3090 driver 591.74, Rust 1.98.1 MSVC, DXC 1.8.2502.11; command: cargo test --locked -p xcl --lib stale_blob_cannot_bypass_the_offline_pipeline_cap -- --test-threads=1 --show-output --nocapture.

The narrow fix point is immediately after from_cache: when cached.is_some() && from_cache.is_none() && over_cap, remove the rejected blob, release the running slot, count it as capped, and return. The existing no-blob early check remains. Avoid driver_cache::note(false, ...) here: its current log says the pipeline will be compiled again, whereas this path skips it. This fixture deliberately uses a low cap to make the failure cheap; it does not measure production 8 MiB shaders, world-loading memory or retail gameplay. I measured one uncached driver compile avoided; the millisecond timings are not a controlled speed benchmark because another build was active during the initial candidate run.

Portable patch follow-up: I replaced the environment-specific diagnostic with a private cache-path injection seam and a test-owned scratch directory. The same regression on 3090 still fails before the fix (0/1/0, capped=0, made=1, output 42) and passes after (1/0/0, capped=1, made=0, output 42), no skips/device removal. Both 295-file Windows snapshots matched SHA256 before and after. A matched interactive-session-1 cargo build --locked --workspace passed on both; cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output across 20 targets was 891 passed / 3 failed / 42 ignored on the control and 892 / 2 / 42 on the candidate. Both shared the known integer-CLAMP failure and the synthetic PSO-measurement driver-cache/SDK requirement; the third control failure is this expected regression. Four explicit skips on each (two debug-layer, two native-wave64 references). Neither full suite is green, but there is no candidate-only failure. This local patch is in one file (shaders.rs, 62 additions / 2 deletions), uncommitted and unpushed; I can supply the complete diff if useful. The author still needs exact-head retail smoke after incorporating a runtime change.

Separately, the PR-description check currently fails because its head smoke block names 60443ff, while this PR's head is a239e35; the required exact-head smoke needs updating after the last push.

Portable one-file patch against a239e35
diff --git a/crates/xcl/src/shaders.rs b/crates/xcl/src/shaders.rs
index 69f4413..8061b2c 100644
--- a/crates/xcl/src/shaders.rs
+++ b/crates/xcl/src/shaders.rs
@@ -1039,6 +1039,48 @@ mod pipeline_cap_tests {
         // not a number: the default, not a crash
         assert_eq!(pipeline_cap_kb(Some("off")), 8192);
     }
+
+    #[test]
+    fn stale_blob_cannot_bypass_the_offline_pipeline_cap() {
+        use super::{Pipelines, recomp, Ordering};
+        use std::time::{Instant, SystemTime, UNIX_EPOCH};
+
+        struct Scratch(std::path::PathBuf);
+        impl Drop for Scratch {
+            fn drop(&mut self) { let _ = std::fs::remove_dir_all(&self.0); }
+        }
+        if let Err(reason) = recomp::dxc::location() {
+            recomp::runner::skip_test(&format!("no DXC: {reason}"));
+            return;
+        }
+        let mut pipelines = match Pipelines::new() {
+            Ok(pipelines) => pipelines,
+            Err(reason) => {
+                recomp::runner::skip_test(&format!("no D3D12 device: {reason}"));
+                return;
+            }
+        };
+        let nonce = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_nanos();
+        let scratch = Scratch(std::env::temp_dir().join(format!("xcl-stale-pso-{}-{nonce}", std::process::id())));
+        std::fs::create_dir(&scratch.0).expect("scratch cache directory");
+        let hlsl = "RWByteAddressBuffer mem : register(u2); [numthreads(1,1,1)] void main() { mem.Store(0, 42); }";
+        let dxil = recomp::dxc::compile(hlsl, "main", "cs_6_6", &[]).expect("DXC compile");
+        let path = scratch.0.join("stale.pso");
+        std::fs::write(&path, b"deliberately invalid cached PSO").expect("stale blob");
+
+        pipelines.max_dxil = dxil.len() - 1;
+        let start = Instant::now();
+        pipelines.make_with_cache_path(&recomp::pso::Compiled { dxil: dxil.clone(), samplers: vec![] }, Some(path.clone()));
+        let elapsed = start.elapsed();
+        let capped = pipelines.capped.load(Ordering::Relaxed);
+        let made = pipelines.made.load(Ordering::Relaxed);
+        let refused = pipelines.refused.load(Ordering::Relaxed);
+        let output = recomp::runner::dispatch(&dxil, [1, 1, 1], &[], &[0; 64]).expect("runtime GPU dispatch");
+        println!("adapter={} dxil_bytes={} offline_ms={} capped={} made={} refused={} gpu_word0={}", recomp::runner::adapter().unwrap_or_default(), dxil.len(), elapsed.as_millis(), capped, made, refused, output[0]);
+        assert_eq!(output[0], 42);
+        assert_eq!((capped, made, refused), (1, 0, 0));
+        assert!(!path.exists(), "rejected blob should not be retried next run");
+    }
 }
 
 // D3D12 devices and root signatures are free-threaded
@@ -1061,6 +1103,10 @@ impl Pipelines {
 
     /// The compute pipeline of `c` (made and released).
     fn make(&self, c: &recomp::pso::Compiled) {
+        self.make_with_cache_path(c, None);
+    }
+
+    fn make_with_cache_path(&self, c: &recomp::pso::Compiled, path_override: Option<PathBuf>) {
         use windows::Win32::Graphics::Direct3D12::*;
         let key: Vec<u32> = c.samplers.iter().flat_map(|(w, cmp)| w.iter().copied().chain([*cmp as u32])).collect();
         let rs = {
@@ -1085,12 +1131,13 @@ impl Pipelines {
             ..Default::default()
         };
         use crate::hle::d3d12x::real::driver_cache;
-        let path = driver_cache::path(&c.dxil, desc.Flags.0);
+        let path = path_override.or_else(|| driver_cache::path(&c.dxil, desc.Flags.0));
         let cached = path.as_deref().and_then(driver_cache::load);
+        let over_cap = self.max_dxil != 0 && c.dxil.len() > self.max_dxil;
         // over the cap and no blob from an earlier run: the driver's compile of this one takes
         // tens of minutes and gigabytes; the pass finishes without it, and the runtime builds it
         // when a title needs the pipeline. `XCL_PIPELINE_MAX_KB` 0 turns the cap off.
-        if cached.is_none() && self.max_dxil != 0 && c.dxil.len() > self.max_dxil {
+        if cached.is_none() && over_cap {
             self.capped.fetch_add(1, Ordering::Relaxed);
             self.capped_bytes.fetch_add(c.dxil.len(), Ordering::Relaxed);
             drop(std::mem::ManuallyDrop::into_inner(desc.pRootSignature));
@@ -1107,6 +1154,19 @@ impl Pipelines {
             desc.CachedPSO = D3D12_CACHED_PIPELINE_STATE { pCachedBlob: bytes.as_ptr().cast(), CachedBlobSizeInBytes: bytes.len() };
             unsafe { self.dev.CreateComputePipelineState::<ID3D12PipelineState>(&desc) }.ok()
         });
+        // A stale blob is not a usable cache hit. Do not let its presence bypass the offline
+        // size cap and start the expensive uncached driver compile.
+        if cached.is_some() && from_cache.is_none() && over_cap {
+            if let Some(path) = path.as_deref() {
+                let _ = std::fs::remove_file(path);
+            }
+            *self.running.0.lock().unwrap() -= 1;
+            self.running.1.notify_one();
+            self.capped.fetch_add(1, Ordering::Relaxed);
+            self.capped_bytes.fetch_add(c.dxil.len(), Ordering::Relaxed);
+            drop(std::mem::ManuallyDrop::into_inner(desc.pRootSignature));
+            return;
+        }
         let r = if let Some(pso) = from_cache {
             self.reused.fetch_add(1, Ordering::Relaxed);
             Ok(pso)
AI use: Codex (GPT-6) wrote the local diagnostic and candidate and ran the tests. No source commit or competing PR was made.
**@⁠WebIdentity1** on GitHub · 2026-11-24 21:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/1774#issuecomment-7144615604) · edited 2026-11-24 21:26 UTC I found a reproducible cap bypass on exact head `a239e358922fad455fb91b7f9f11218e32f9619d`. In `Pipelines::make` (`crates/xcl/src/shaders.rs`), the new over-cap check asks whether `driver_cache::load` returned bytes. If a nonempty blob is then rejected by `CreateComputePipelineState`, the fallback still compiles that over-cap DXIL from scratch. A stale blob after a driver or adapter change can therefore defeat `XCL_PIPELINE_MAX_KB`. **3090 negative control and local fix check:** With an isolated cache, I wrote an intentionally invalid PSO blob for public synthetic 2,816-byte compute DXIL, set the diagnostic cap to 2,815 bytes, and dispatched the same shader to check GPU output. Unchanged head plus test-only fixture: `0 passed / 1 failed / 0 ignored` (expected), `capped=0, made=1, refused=0`, GPU output `42`. A local candidate that checks the cap again after cached-PSO rejection, removes the stale blob and returns before the uncached fallback: `1 passed / 0 failed / 0 ignored`, `capped=1, made=0, refused=0`, GPU output still `42`. No skips or device removal. Both 295-file source snapshots matched their SHA256 manifests before and after native testing. Windows 10 19045, RTX 3090 driver 591.74, Rust 1.98.1 MSVC, DXC 1.8.2502.11; command: `cargo test --locked -p xcl --lib stale_blob_cannot_bypass_the_offline_pipeline_cap -- --test-threads=1 --show-output --nocapture`. The narrow fix point is immediately after `from_cache`: when `cached.is_some() && from_cache.is_none() && over_cap`, remove the rejected blob, release the `running` slot, count it as capped, and return. The existing no-blob early check remains. Avoid `driver_cache::note(false, ...)` here: its current log says the pipeline will be compiled again, whereas this path skips it. This fixture deliberately uses a low cap to make the failure cheap; it does not measure production 8 MiB shaders, world-loading memory or retail gameplay. I measured one uncached driver compile avoided; the millisecond timings are not a controlled speed benchmark because another build was active during the initial candidate run. **Portable patch follow-up:** I replaced the environment-specific diagnostic with a private cache-path injection seam and a test-owned scratch directory. The same regression on 3090 still fails before the fix (`0/1/0`, `capped=0, made=1`, output `42`) and passes after (`1/0/0`, `capped=1, made=0`, output `42`), no skips/device removal. Both 295-file Windows snapshots matched SHA256 before and after. A matched interactive-session-1 `cargo build --locked --workspace` passed on both; `cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output` across 20 targets was **891 passed / 3 failed / 42 ignored** on the control and **892 / 2 / 42** on the candidate. Both shared the known integer-CLAMP failure and the synthetic PSO-measurement driver-cache/SDK requirement; the third control failure is this expected regression. Four explicit skips on each (two debug-layer, two native-wave64 references). Neither full suite is green, but there is no candidate-only failure. This local patch is in one file (`shaders.rs`, 62 additions / 2 deletions), uncommitted and unpushed; I can supply the complete diff if useful. The author still needs exact-head retail smoke after incorporating a runtime change. Separately, the PR-description check currently fails because its head smoke block names `60443ff`, while this PR's head is `a239e35`; the required exact-head smoke needs updating after the last push. <details> <summary>Portable one-file patch against a239e35</summary> ```diff diff --git a/crates/xcl/src/shaders.rs b/crates/xcl/src/shaders.rs index 69f4413..8061b2c 100644 --- a/crates/xcl/src/shaders.rs +++ b/crates/xcl/src/shaders.rs @@ -1039,6 +1039,48 @@ mod pipeline_cap_tests { // not a number: the default, not a crash assert_eq!(pipeline_cap_kb(Some("off")), 8192); } + + #[test] + fn stale_blob_cannot_bypass_the_offline_pipeline_cap() { + use super::{Pipelines, recomp, Ordering}; + use std::time::{Instant, SystemTime, UNIX_EPOCH}; + + struct Scratch(std::path::PathBuf); + impl Drop for Scratch { + fn drop(&mut self) { let _ = std::fs::remove_dir_all(&self.0); } + } + if let Err(reason) = recomp::dxc::location() { + recomp::runner::skip_test(&format!("no DXC: {reason}")); + return; + } + let mut pipelines = match Pipelines::new() { + Ok(pipelines) => pipelines, + Err(reason) => { + recomp::runner::skip_test(&format!("no D3D12 device: {reason}")); + return; + } + }; + let nonce = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_nanos(); + let scratch = Scratch(std::env::temp_dir().join(format!("xcl-stale-pso-{}-{nonce}", std::process::id()))); + std::fs::create_dir(&scratch.0).expect("scratch cache directory"); + let hlsl = "RWByteAddressBuffer mem : register(u2); [numthreads(1,1,1)] void main() { mem.Store(0, 42); }"; + let dxil = recomp::dxc::compile(hlsl, "main", "cs_6_6", &[]).expect("DXC compile"); + let path = scratch.0.join("stale.pso"); + std::fs::write(&path, b"deliberately invalid cached PSO").expect("stale blob"); + + pipelines.max_dxil = dxil.len() - 1; + let start = Instant::now(); + pipelines.make_with_cache_path(&recomp::pso::Compiled { dxil: dxil.clone(), samplers: vec![] }, Some(path.clone())); + let elapsed = start.elapsed(); + let capped = pipelines.capped.load(Ordering::Relaxed); + let made = pipelines.made.load(Ordering::Relaxed); + let refused = pipelines.refused.load(Ordering::Relaxed); + let output = recomp::runner::dispatch(&dxil, [1, 1, 1], &[], &[0; 64]).expect("runtime GPU dispatch"); + println!("adapter={} dxil_bytes={} offline_ms={} capped={} made={} refused={} gpu_word0={}", recomp::runner::adapter().unwrap_or_default(), dxil.len(), elapsed.as_millis(), capped, made, refused, output[0]); + assert_eq!(output[0], 42); + assert_eq!((capped, made, refused), (1, 0, 0)); + assert!(!path.exists(), "rejected blob should not be retried next run"); + } } // D3D12 devices and root signatures are free-threaded @@ -1061,6 +1103,10 @@ impl Pipelines { /// The compute pipeline of `c` (made and released). fn make(&self, c: &recomp::pso::Compiled) { + self.make_with_cache_path(c, None); + } + + fn make_with_cache_path(&self, c: &recomp::pso::Compiled, path_override: Option<PathBuf>) { use windows::Win32::Graphics::Direct3D12::*; let key: Vec<u32> = c.samplers.iter().flat_map(|(w, cmp)| w.iter().copied().chain([*cmp as u32])).collect(); let rs = { @@ -1085,12 +1131,13 @@ impl Pipelines { ..Default::default() }; use crate::hle::d3d12x::real::driver_cache; - let path = driver_cache::path(&c.dxil, desc.Flags.0); + let path = path_override.or_else(|| driver_cache::path(&c.dxil, desc.Flags.0)); let cached = path.as_deref().and_then(driver_cache::load); + let over_cap = self.max_dxil != 0 && c.dxil.len() > self.max_dxil; // over the cap and no blob from an earlier run: the driver's compile of this one takes // tens of minutes and gigabytes; the pass finishes without it, and the runtime builds it // when a title needs the pipeline. `XCL_PIPELINE_MAX_KB` 0 turns the cap off. - if cached.is_none() && self.max_dxil != 0 && c.dxil.len() > self.max_dxil { + if cached.is_none() && over_cap { self.capped.fetch_add(1, Ordering::Relaxed); self.capped_bytes.fetch_add(c.dxil.len(), Ordering::Relaxed); drop(std::mem::ManuallyDrop::into_inner(desc.pRootSignature)); @@ -1107,6 +1154,19 @@ impl Pipelines { desc.CachedPSO = D3D12_CACHED_PIPELINE_STATE { pCachedBlob: bytes.as_ptr().cast(), CachedBlobSizeInBytes: bytes.len() }; unsafe { self.dev.CreateComputePipelineState::<ID3D12PipelineState>(&desc) }.ok() }); + // A stale blob is not a usable cache hit. Do not let its presence bypass the offline + // size cap and start the expensive uncached driver compile. + if cached.is_some() && from_cache.is_none() && over_cap { + if let Some(path) = path.as_deref() { + let _ = std::fs::remove_file(path); + } + *self.running.0.lock().unwrap() -= 1; + self.running.1.notify_one(); + self.capped.fetch_add(1, Ordering::Relaxed); + self.capped_bytes.fetch_add(c.dxil.len(), Ordering::Relaxed); + drop(std::mem::ManuallyDrop::into_inner(desc.pRootSignature)); + return; + } let r = if let Some(pso) = from_cache { self.reused.fetch_add(1, Ordering::Relaxed); Ok(pso) ``` </details> AI use: Codex (GPT-6) wrote the local diagnostic and candidate and ran the tests. No source commit or competing PR was made.
Author
Owner

@⁠WebIdentity1 on GitHub · 2026-11-24 21:44 UTC · original

I checked the new head cbff0b8c09e240f33acb86db4b7e213966392641 after its rebase. The cap bypass from my earlier fail-before/pass-after reproducer and portable patch is still present in the code: Pipelines::make checks cached.is_none() at shaders.rs:1210, then a rejected nonempty cached PSO reaches the uncapped fallback at shaders.rs:1230-1232. The new commit does not add a post-rejection cap check. This is a code review of cbff0b8, not a new GPU run on that head; the RTX 3090 reproducer was run on a239e35. The earlier patch can be integrated into this PR, with its test and the required exact-head smoke rerun by the author.

**@⁠WebIdentity1** on GitHub · 2026-11-24 21:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/1774#issuecomment-7145326756) I checked the new head `cbff0b8c09e240f33acb86db4b7e213966392641` after its rebase. The cap bypass from my [earlier fail-before/pass-after reproducer and portable patch](https://git.gtahub.st/github/xcl-dev--xcl/pulls/1774) is still present in the code: `Pipelines::make` checks `cached.is_none()` at `shaders.rs:1210`, then a rejected nonempty cached PSO reaches the uncapped fallback at `shaders.rs:1230-1232`. The new commit does not add a post-rejection cap check. This is a code review of `cbff0b8`, not a new GPU run on that head; the RTX 3090 reproducer was run on `a239e35`. The earlier patch can be integrated into this PR, with its test and the required exact-head smoke rerun by the author.
Author
Owner

@⁠brandostrong on GitHub · 2026-11-24 22:04 UTC · original

@⁠WebIdentity1 confirmed on RTX 4090 and merged as 6b9b14f, with your test and injection seam taken as-is and the diagnosis credited in the commit message. Your repro showed a second face here: with a warm NVIDIA driver cache the driver accepts the invalid blob, recompiles internally and returns Ok - the attempt then looks like a blob hit and your post-rejection check never fires (cold: hard reject, your case; warm: silent fallback, test failed in-suite). The merged fix adds hit-detection: a blob attempt counts as a hit only when the pipeline carries a blob of the size handed to it (GetCachedBlob size check), so both faces land on the capped path and the test is deterministic cold and warm. Suite on the new head: 963 passed / 0 failed / 43 ignored, no candidate-only failures. Thanks for the precise fix point.

**@⁠brandostrong** on GitHub · 2026-11-24 22:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/1774#issuecomment-7145764224) @⁠WebIdentity1 confirmed on RTX 4090 and merged as `6b9b14f`, with your test and injection seam taken as-is and the diagnosis credited in the commit message. Your repro showed a second face here: with a warm NVIDIA driver cache the driver *accepts* the invalid blob, recompiles internally and returns Ok - the attempt then looks like a blob hit and your post-rejection check never fires (cold: hard reject, your case; warm: silent fallback, test failed in-suite). The merged fix adds hit-detection: a blob attempt counts as a hit only when the pipeline carries a blob of the size handed to it (`GetCachedBlob` size check), so both faces land on the capped path and the test is deterministic cold and warm. Suite on the new head: 963 passed / 0 failed / 43 ignored, no candidate-only failures. Thanks for the precise fix point.
Author
Owner

@⁠brandostrong on GitHub · 2026-11-24 22:04 UTC · original

@⁠eizispark thanks for the AMD run - first RDNA4 coverage on this PR. Heads-up: the head moved to 6b9b14f (a stale-blob cap-bypass fix from #1774 discussion, shaders.rs only, offline --pipelines path; your gate/headroom results are unaffected). The regression pair in the description is now a same-screen world-load pair; both sides stall identically, which is the pre-existing freeze on main, not this PR.

**@⁠brandostrong** on GitHub · 2026-11-24 22:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/1774#issuecomment-7145764978) @⁠eizispark thanks for the AMD run - first RDNA4 coverage on this PR. Heads-up: the head moved to `6b9b14f` (a stale-blob cap-bypass fix from #1774 discussion, `shaders.rs` only, offline `--pipelines` path; your gate/headroom results are unaffected). The regression pair in the description is now a same-screen world-load pair; both sides stall identically, which is the pre-existing freeze on main, not this PR.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 23:24 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 under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 23:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/1774#issuecomment-7147367084) 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 under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
Author
Owner

@⁠thiagocalile on GitHub · 2026-11-25 00:12 UTC · original

Tested commit 6b9b14fd636ae26152c02eeb8c0f34c51bbd55f7 on an AMD Radeon RX 6600 (RDNA2, native 64-lane waves) with unit/workspace tests and a 60 s scripts/smoke.ps1 regression run (comparing against main 62265d3).

Tested

  • Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64 + mesh shaders, driver 32.0.21045.29003; XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.8.2502.11.
  • XCL_ADAPTER=radeon cargo test -p xcl --lib shaders::tests -- --test-threads=4: 6 passed, 0 failed, 0 ignored (46.64s).
  • XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 959 passed, 3 failed, 43 ignored (68.14s).
    • The 3 failures are pre-existing on main on this RX 6600 (placed_title_textures_share_vram_and_preserve_pixels: 3D mip subresource mismatch, plus 2 mutex-poison cascades transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory; tracked by #1028).
    • SKIPPED (not counted as coverage): gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)); gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)); gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's)); gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's)); gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's)); gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's)); heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows; shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): O aplicativo solicitou uma operação que depende de um componente SDK que está ausente ou é incompatível. (0x887A002D) (plus D3D12 debug-layer tests skip because d3d12SDKLayers.dll is not installed).

Regression run (scripts/smoke.ps1, 60 s, release build, XCL_ADAPTER=radeon)

Base (main 62265d3):

xcl-smoke v1
commit: 62265d3bbde2255f849fb650cc29872df91a4cf0
gpu: AMD Radeon RX 6600
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1517 (PresentX 1517)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13034 MB

PR (6b9b14f):

xcl-smoke v1
commit: 6b9b14fd636ae26152c02eeb8c0f34c51bbd55f7
gpu: AMD Radeon RX 6600
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 864 (PresentX 864)
presents per 2 s (last 3): 56 52 60
device removals: 0
crashes: 0
peak commit: 12534 MB

Not tested

  • D3D12 debug layer, NVIDIA / Intel GPUs, Linux / Wine.

AI use

  • Antigravity (Gemini 4 Neon) ran the test suites and scripts/smoke.ps1 runs on my RX 6600 and drafted this report; I checked the output before posting.
**@⁠thiagocalile** on GitHub · 2026-11-25 00:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/1774#issuecomment-7148270394) Tested commit `6b9b14fd636ae26152c02eeb8c0f34c51bbd55f7` on an AMD Radeon RX 6600 (RDNA2, native 64-lane waves) with unit/workspace tests and a 60 s `scripts/smoke.ps1` regression run (comparing against `main` `62265d3`). **Tested** - Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64 + mesh shaders, driver `32.0.21045.29003`; `XCL_ADAPTER=radeon`), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (`10.0.26200.0`), Rust `1.100.0` (`stable-x86_64-pc-windows-msvc`), DXC `1.8.2502.11`. - `XCL_ADAPTER=radeon cargo test -p xcl --lib shaders::tests -- --test-threads=4`: **6 passed, 0 failed, 0 ignored** (`46.64s`). - `XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4`: **959 passed, 3 failed, 43 ignored** (`68.14s`). - The 3 failures are pre-existing on `main` on this RX 6600 (`placed_title_textures_share_vram_and_preserve_pixels`: 3D mip subresource mismatch, plus 2 mutex-poison cascades `transitions_apply_when_their_list_is_submitted` and `d32s8_targets_take_their_own_size_of_video_memory`; tracked by #1028). - `SKIPPED` (not counted as coverage): `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))`; `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))`; `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))`; `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))`; `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))`; `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))`; `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows`; `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): O aplicativo solicitou uma operação que depende de um componente SDK que está ausente ou é incompatível. (0x887A002D)` (plus D3D12 debug-layer tests skip because `d3d12SDKLayers.dll` is not installed). **Regression run** (`scripts/smoke.ps1`, 60 s, release build, `XCL_ADAPTER=radeon`) Base (`main` `62265d3`): ``` xcl-smoke v1 commit: 62265d3bbde2255f849fb650cc29872df91a4cf0 gpu: AMD Radeon RX 6600 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1517 (PresentX 1517) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13034 MB ``` PR (`6b9b14f`): ``` xcl-smoke v1 commit: 6b9b14fd636ae26152c02eeb8c0f34c51bbd55f7 gpu: AMD Radeon RX 6600 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 864 (PresentX 864) presents per 2 s (last 3): 56 52 60 device removals: 0 crashes: 0 peak commit: 12534 MB ``` **Not tested** - D3D12 debug layer, NVIDIA / Intel GPUs, Linux / Wine. **AI use** - Antigravity (Gemini 4 Neon) ran the test suites and `scripts/smoke.ps1` runs on my RX 6600 and drafted this report; I checked the output before posting.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-24 21:51 UTC · original · edited 2026-11-25 01:04 UTC

Tested

On 6b9b14fd, I ran the stock synthetic compute shader through the CLI in three separate processes using the same scratch cache. With XCL_PIPELINE_MAX_KB=1 and an empty cache, the CLI capped one pipeline and made none. With the cap disabled, it built one and saved the driver blob. With the 1 KiB cap restored, it reused that valid blob and reported zero capped pipelines. All three invocations exited successfully with zero refusals.

RTX 3080 Ti / 621.35, Windows 11 build 26300, Ryzen 7 9800X3D, Rust 1.99.1 MSVC debug, DXC 1.8.2502.11. cargo test --offline --locked -p xcl --test gpu_compute_e2e <filter> -- --nocapture --test-threads=1 passed 1/1 for the stock offline_compute_pipeline_is_reused_by_a_second_process and 1/1 for the local scratch_offline_cap_preserves_valid_warm_pipeline fixture, with zero skips.

Not tested

This checks cold admission and warm reuse through shaders --precompile --pipelines. The fixture used a small synthetic shader and a lowered cap. It does not measure retail world loading or driver memory use.

AI-assisted. Codex (GPT-6 family, exact variant unavailable) wrote and ran the local fixture and drafted this report.

Post-merge stale-cache check on 656c0e8

On the RTX 3080 Ti (621.35), Windows 11 build 26300, Rust 1.99.1 MSVC and DXC 1.8.2502.11, cargo test --offline --locked -p xcl --lib --jobs 2 stale_blob_cannot_bypass_the_offline_pipeline_cap -- --nocapture --test-threads=1 passed with zero skips. With a 2,816-byte synthetic shader and a cap one byte below it, the rejected cached blob was removed and offline counters were 1 capped, 0 made, 0 refused. A separate GPU dispatch read back the expected value of 42. The cap-default and headroom-formula tests also passed. This covers offline admission and the headroom calculation. No retail workload or runtime compiler memory was measured.

AI-assisted. Codex (GPT-6 family, exact variant unavailable) ran the tests and drafted this update.

**@⁠thehollowedone** on GitHub · 2026-11-24 21:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/1774#issuecomment-7145481188) · edited 2026-11-25 01:04 UTC **Tested** On [`6b9b14fd`](https://github.com/xcl-dev/xcl/commit/6b9b14fd636ae26152c02eeb8c0f34c51bbd55f7), I ran the stock synthetic compute shader through the CLI in three separate processes using the same scratch cache. With `XCL_PIPELINE_MAX_KB=1` and an empty cache, the CLI capped one pipeline and made none. With the cap disabled, it built one and saved the driver blob. With the 1 KiB cap restored, it reused that valid blob and reported zero capped pipelines. All three invocations exited successfully with zero refusals. RTX 3080 Ti / 621.35, Windows 11 build 26300, Ryzen 7 9800X3D, Rust 1.99.1 MSVC debug, DXC 1.8.2502.11. `cargo test --offline --locked -p xcl --test gpu_compute_e2e <filter> -- --nocapture --test-threads=1` passed 1/1 for the stock `offline_compute_pipeline_is_reused_by_a_second_process` and 1/1 for the local `scratch_offline_cap_preserves_valid_warm_pipeline` fixture, with zero skips. **Not tested** This checks cold admission and warm reuse through `shaders --precompile --pipelines`. The fixture used a small synthetic shader and a lowered cap. It does not measure retail world loading or driver memory use. AI-assisted. Codex (GPT-6 family, exact variant unavailable) wrote and ran the local fixture and drafted this report. **Post-merge stale-cache check on [`656c0e8`](https://github.com/xcl-dev/xcl/commit/656c0e8ca070bdc9d7cb197d264792ef49304865)** On the RTX 3080 Ti (621.35), Windows 11 build 26300, Rust 1.99.1 MSVC and DXC 1.8.2502.11, `cargo test --offline --locked -p xcl --lib --jobs 2 stale_blob_cannot_bypass_the_offline_pipeline_cap -- --nocapture --test-threads=1` passed with zero skips. With a 2,816-byte synthetic shader and a cap one byte below it, the rejected cached blob was removed and offline counters were 1 capped, 0 made, 0 refused. A separate GPU dispatch read back the expected value of 42. The cap-default and headroom-formula tests also passed. This covers offline admission and the headroom calculation. No retail workload or runtime compiler memory was measured. AI-assisted. Codex (GPT-6 family, exact variant unavailable) ran the tests and drafted this update.
This discussion has been locked. Commenting is limited to contributors.
No description provided.