Repository navigation
Conversation
|
Independent RTX 4060 (8 GB) / Windows 11 verification of PR #2740 at Setup
Targeted RTX 4060 release unit tests (
|
|
Test report: passes on NVIDIA. Exact head Tested
Not tested
Claude Code (Claude Opus 5.5) ran the tests and wrote this report. |
|
Independent synthetic D3D12 cache-boundary check of PR head I added the same uncommitted, test-only fixture to each checkout. It compiles an 86,012-byte synthetic compute DXIL program, sets the process-local compute-blob accounting to the 512 MiB limit without allocating 512 MiB, creates a real D3D12 PSO, and checks for a saved driver blob and a second PSO created from that disk blob. A 300 ms delay in the test's create callback crosses the disk-retention threshold; it is not a driver compile-time measurement.
This exercises the real compute-PSO disk path at the simulated RAM boundary. It does not cover the two-pass path, a naturally full cache during a title run, or a change in frame rate. Synthetic shader only; no game files or diagnostics were used. AI use: Codex (GPT-6.2 Sol) wrote and ran the test fixture and drafted this report. |
|
Independent AMD RDNA4 (native wave64) verification of exact PR head Tested
(Compare against Not tested
AI use
|
|
Independent AMD RX 7800 XT / Windows 11 test report for PR #2740 at exact head Tested
Not tested
AI use: Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report, coordinated by Claude Code (Claude Opus 5.5). All counts are from the runs described. |
|
RX 9070 / Wine cache-boundary verification, including GPU output and reuse in a fresh process. Tested
The same focused Windows libtest was invoked through GE-Proton Wine with
Every invocation made exactly one successful native PSO-create call, with no explicit cold retry, and dispatched the resulting PSO. GPU readback matched the CPU reference in all nine processes. All nine retained zero RAM-cache entries and accounting of 536,870,912 bytes. Main failed only at Additional unchanged-code checks:
An initial fixture-sizing probe was excluded: its 14,000-byte DXIL was below the unchanged 16 KiB retention gate. The results above use the corrected, identical 25,520-byte fixture. Not tested Two-pass compute, console-shader translation, a naturally full cache during a title run, native Windows, full workspace suite, retail/smoke workloads, performance or FPS. AI use OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, wrote the local fixture, ran and independently checked the paired tests, and drafted this report. Publication authorized by the account owner. |
|
Two contributors checked independently and found that #2574 solves the same problem (for #1833) in a different way: #1607, group D127. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
Main (xcl-dev#2959 / 665f72f) moved disk persistence into `keep_driver_blob` before RAM admission, so slow blobs already reach the disk cache past COMPUTE_BLOBS_MAX / GRAPHICS_BLOBS_MAX. However, callers in graphics_pso and finish_two_pass still looked up `graphics_blob` / `compute_blob` in RAM afterward and skipped `warm_replay::accepted` whenever the RAM cache was full. Have `keep_driver_blob` return the captured `Arc<Vec<u8>>` directly (or the existing RAM entry on `!reserve`) even when the RAM cap refuses it, and pass that blob straight to `warm_replay::accepted`. Update `a_blob_over_the_memory_budget_still_reaches_its_caller` for `DriverBlobs` and `keep_driver_blob`.
9ecae59 to
7b6f3f6
Compare
|
Current-head check of #2740
I found a repeat-key gap in the RAM-full return path. When a blob is saved to disk but not admitted to RAM, Please distinguish a persisted disk-only key from an in-flight builder. For a warm-replay capture, the existing Failing test-only fixture@@
+ #[test]
+ fn repeated_disk_only_blob_can_reach_each_warm_receipt() {
+ let cache = super::DriverBlobs::new();
+ let path = std::env::temp_dir().join(format!("xcl-repeat-{}.pso", std::process::id()));
+ let _ = std::fs::remove_file(&path);
+ let minimum = super::COMPUTE_BLOB_MIN_DXIL;
+ let took = std::time::Duration::from_secs(1);
+ super::keep_driver_blob(&cache, 4, 1u64, minimum, None, took, || Some(vec![1; 4]));
+ let first = super::keep_driver_blob(&cache, 4, 2u64, minimum, Some(&path), took, || Some(vec![2; 8]));
+ let persisted = path.exists();
+ let repeated = super::keep_driver_blob(&cache, 4, 2u64, minimum, Some(&path), took, || Some(vec![2; 8]));
+ let _ = std::fs::remove_file(&path);
+ assert!(persisted, "first disk-only blob should be written");
+ assert!(first.is_some(), "first receipt gets the blob");
+ assert!(repeated.is_some(), "a second receipt of the same disk-only blob should get bytes");
+ }The #2574 overlap hint concerned disk persistence. That behavior is already present in this PR's current parent; this head adds the return to warm-replay after RAM admission fails. The description still lists the previous AI use: Codex (GPT-6.2 Sol) inspected the parent and overlapping patch, ran the tests, and wrote the failing fixture and report. |
|
Follow-up to my current-head report on head I tested a local candidate that distinguishes a completed disk-only key from an active writer. It reads the current successful PSO's blob for a warm-replay capture only; ordinary duplicate calls retain the existing no-read behavior. The new focused regression failed on the unchanged head (0 passed, 1 failed, 0 ignored) and passed with the candidate (1/0/0). On the candidate, Candidate diff and regressiondiff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs
index ec09ac02..fedf2ac5 100644
--- a/crates/xcl/src/hle/d3d12x/real.rs
+++ b/crates/xcl/src/hle/d3d12x/real.rs
@@ -6169,6 +6169,12 @@ impl<K: Copy + Eq + std::hash::Hash> DriverBlobs<K> {
!persisted.contains_key(&key) && active.insert(key)
}
+ fn persisted_only(&self, key: K) -> bool {
+ self.keeping.lock().unwrap().as_ref().is_some_and(|(active, persisted)| {
+ !active.contains(&key) && persisted.get(&key).is_some_and(|generation| generation.upgrade().is_none())
+ })
+ }
+
/// Admit the exact disk generation accepted by the driver without copying it. Holding both
/// locks excludes a builder reservation between the presence check and insertion.
fn admit(&self, key: K, blob: std::sync::Arc<Vec<u8>>, limit: usize) -> bool {
@@ -6453,6 +6459,41 @@ mod compute_blob_tests {
assert!(super::keep_driver_blob(&cache, 4, 3u64, super::COMPUTE_BLOB_MIN_DXIL, None, took, || Some(Vec::new())).is_none());
}
+
+ #[test]
+ fn repeated_disk_only_blob_reaches_each_caller_without_republishing() {
+ let cache = super::DriverBlobs::new();
+ let took = std::time::Duration::from_secs(1);
+ let dir = std::env::temp_dir().join(format!("xcl-disk-only-{}", std::process::id()));
+ std::fs::create_dir_all(&dir).unwrap();
+ let path = dir.join("repeat.pso");
+ let _ = std::fs::remove_file(&path);
+ super::keep_driver_blob(&cache, 4, 1u64, super::COMPUTE_BLOB_MIN_DXIL, None, took,
+ || Some(vec![1; 4]));
+ let first = super::keep_driver_blob(&cache, 4, 2u64, super::COMPUTE_BLOB_MIN_DXIL, Some(&path), took,
+ || Some(vec![2; 8]));
+ assert!(path.exists());
+ assert_eq!(first.as_deref().map(Vec::as_slice), Some([2; 8].as_slice()));
+ assert!(super::keep_driver_blob(&cache, 4, 2u64, super::COMPUTE_BLOB_MIN_DXIL, Some(&path), took,
+ || panic!("ordinary duplicate must not reread the PSO")).is_none());
+ assert!(cache.reserve(3u64));
+ crate::shaders::warm_replay::capture_for_test(|| {
+ assert!(super::keep_driver_blob(&cache, 4, 3u64, super::COMPUTE_BLOB_MIN_DXIL, Some(&path), took,
+ || panic!("in-flight duplicate must not reread the PSO")).is_none());
+ true
+ });
+ cache.finish(3u64, None, 4, false);
+ let mut second = None;
+ crate::shaders::warm_replay::capture_for_test(|| {
+ second = super::keep_driver_blob(&cache, 4, 2u64, super::COMPUTE_BLOB_MIN_DXIL, Some(&path), took,
+ || Some(vec![2; 8]));
+ true
+ });
+ assert_eq!(second.as_deref().map(Vec::as_slice), Some([2; 8].as_slice()));
+ assert_eq!(cache.blobs.lock().unwrap().as_ref().unwrap().1, 4);
+ assert_eq!(std::fs::read(&path).unwrap(), [2; 8]);
+ std::fs::remove_dir_all(dir).unwrap();
+ }
}
/// Read `GetCachedBlob` from either an adopted or raw PC `ID3D12PipelineState`.
@@ -6491,7 +6532,13 @@ fn keep_driver_blob<K: Copy + Eq + std::hash::Hash>(
return None;
}
if !cache.reserve(key) {
- return cache.get(key);
+ if let Some(blob) = cache.get(key) { return Some(blob); }
+ // A second cold builder can finish after the first persisted a disk-only generation.
+ // Only a warm-replay capture needs its own successful PSO bytes for a verified receipt.
+ if disk.is_some() && crate::shaders::warm_replay::capturing() && cache.persisted_only(key) {
+ return read().filter(|bytes| !bytes.is_empty()).map(std::sync::Arc::new);
+ }
+ return None;
}
let keep_turn = disk.and_then(|path| driver_cache::KeepTurn::new(path, took));
let Some(bytes) = read().filter(|bytes| !bytes.is_empty()) else {
diff --git a/crates/xcl/src/shaders/warm_replay.rs b/crates/xcl/src/shaders/warm_replay.rs
index fa6d7a22..461da005 100644
--- a/crates/xcl/src/shaders/warm_replay.rs
+++ b/crates/xcl/src/shaders/warm_replay.rs
@@ -61,6 +61,11 @@ pub(super) fn capture(f: impl FnOnce() -> bool) -> (bool, Vec<File>) {
(success, files)
}
+pub(crate) fn capturing() -> bool { CAPTURE.with(|slot| slot.borrow().is_some()) }
+
+#[cfg(test)]
+pub(crate) fn capture_for_test(f: impl FnOnce() -> bool) -> bool { capture(f).0 }
+
/// Record only bytes accepted by the native driver that still occupy this cache file.
pub(crate) fn accepted(path: Option<&Path>, bytes: &[u8]) {
CAPTURE.with(|slot| {AI use: Codex (GPT-6.2 Sol) traced the cache states, wrote and ran the candidate and tests, and checked this report. |
|
One scope clarification for my candidate diff at #2740 head On this head, the mesh receipt index requires For that independent test, capture the second overlapping cold completion, pass its returned bytes to AI use: Codex (GPT-6.2 Sol) checked the current source and this note; Codex (GPT-6.2 Astra) independently traced the receipt and cache paths. |
|
A disk-only rejected blob can leave a cache key marked as persisted after its file is gone. This also reproduces on current With a zero-byte RAM budget, a successful save leaves a persisted key without a resident blob. On rejection, I changed the existing synthetic retry test to call The candidate below is based on main Candidate main-based diff and regressionsdiff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs
index 1c1c7318..177d00ec 100644
--- a/crates/xcl/src/hle/d3d12x/real.rs
+++ b/crates/xcl/src/hle/d3d12x/real.rs
@@ -6568,6 +6568,14 @@ pub(crate) mod driver_cache {
/// `bytes` to `p`, under another name first: a run that is cut short leaves no half file.
pub fn write(p: &Path, bytes: &[u8]) -> bool {
+ write_with_replacement(p, bytes, true)
+ }
+
+ fn write_if_absent(p: &Path, bytes: &[u8]) -> bool {
+ write_with_replacement(p, bytes, false)
+ }
+
+ fn write_with_replacement(p: &Path, bytes: &[u8], replace: bool) -> bool {
use std::io::Write;
if bytes.is_empty() {
return false;
@@ -6583,7 +6591,22 @@ pub(crate) mod driver_cache {
drop(file);
let ok = written && {
let _stall = crate::stall::span(crate::stall::StallKind::CacheIo);
- std::fs::rename(&tmp, p).is_ok()
+ if replace {
+ std::fs::rename(&tmp, p).is_ok()
+ } else {
+ use std::os::windows::ffi::OsStrExt;
+ use windows_sys::Win32::Storage::FileSystem::{MoveFileExW, MOVEFILE_WRITE_THROUGH};
+ // Canonicalization supplies extended absolute paths for long user cache roots.
+ if let Ok(dir) = std::fs::canonicalize(tmp.parent().unwrap()) {
+ let from = dir.join(tmp.file_name().unwrap());
+ let to = dir.join(p.file_name().unwrap());
+ let from: Vec<u16> = from.as_os_str().encode_wide().chain([0]).collect();
+ let to: Vec<u16> = to.as_os_str().encode_wide().chain([0]).collect();
+ unsafe { MoveFileExW(from.as_ptr(), to.as_ptr(), MOVEFILE_WRITE_THROUGH) != 0 }
+ } else {
+ false
+ }
+ }
};
if !ok {
let _stall = crate::stall::span(crate::stall::StallKind::CacheIo);
@@ -6615,7 +6638,15 @@ pub(crate) mod driver_cache {
}
pub(super) fn store(&self, blob: &[u8]) -> bool {
- if write(&self.0, blob) {
+ self.store_with_replacement(blob, true)
+ }
+
+ pub(super) fn store_if_absent(&self, blob: &[u8]) -> bool {
+ self.store_with_replacement(blob, false)
+ }
+
+ fn store_with_replacement(&self, blob: &[u8], replace: bool) -> bool {
+ if if replace { write(&self.0, blob) } else { write_if_absent(&self.0, blob) } {
let n = STORED.fetch_add(1, Ordering::Relaxed) + 1;
if n.is_power_of_two() {
crate::xlog_info!("D3D12.X: {n} driver blobs kept on disk for the next run (this one: {} ms, {} KB)", self.1.as_millis(), blob.len() >> 10);
@@ -6754,7 +6785,57 @@ pub(crate) mod driver_cache {
keep_driver_blob(&cache, 0, 9u64, COMPUTE_BLOB_MIN_DXIL, Some(&path), KEEP, || None);
keep_driver_blob(&cache, 0, 9u64, COMPUTE_BLOB_MIN_DXIL, Some(&path), KEEP, || Some(b"old".to_vec()));
assert_eq!(load_bytes(&path).as_deref(), Some(b"old".as_slice()));
- cache.forget(9);
+ let loaded = load(&path).expect("disk-only blob");
+ let expected = loaded.shared();
+ cache.forget_if(9, &expected);
+ note(false, Some(loaded));
+ assert!(!path.try_exists().unwrap(), "rejected file removed");
+ keep_driver_blob(&cache, 0, 9u64, COMPUTE_BLOB_MIN_DXIL, Some(&path), KEEP, || None);
+ keep_driver_blob(&cache, 0, 9u64, COMPUTE_BLOB_MIN_DXIL, Some(&path), KEEP, || Some(b"fresh".to_vec()));
+ assert_eq!(load_bytes(&path).as_deref(), Some(b"fresh".as_slice()));
+ }
+
+ #[test]
+ fn a_disk_only_repair_does_not_replace_a_newer_file() {
+ use super::super::{keep_driver_blob, DriverBlobs, COMPUTE_BLOB_MIN_DXIL};
+ let dir = std::env::temp_dir().join(format!("xcl-driver-cache-repair-race-{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&dir);
+ std::fs::create_dir(&dir).unwrap();
+ let _directory = Directory(dir.clone());
+ let path = dir.join("repair.pso");
+ let cache = DriverBlobs::new();
+ keep_driver_blob(&cache, 0, 9u64, COMPUTE_BLOB_MIN_DXIL, Some(&path), KEEP, || Some(b"old".to_vec()));
+ let loaded = load(&path).unwrap();
+ cache.forget_if(9, &loaded.shared());
+ note(false, Some(loaded));
+ assert!(!path.exists());
+
+ let result = keep_driver_blob(&cache, 0, 9u64, COMPUTE_BLOB_MIN_DXIL, Some(&path), KEEP, || {
+ assert!(write(&path, b"newer"));
+ Some(b"loser".to_vec())
+ });
+ assert!(result.is_none(), "the losing generation must not be reported as saved");
+ assert_eq!(load_bytes(&path).as_deref(), Some(b"newer".as_slice()));
+ assert!(cache.get(9).is_none());
+ assert_eq!(std::fs::read_dir(&dir).unwrap().count(), 1, "no staging file remains");
+ }
+
+ #[test]
+ fn a_disk_only_repair_supports_a_long_cache_path() {
+ use super::super::{keep_driver_blob, DriverBlobs, COMPUTE_BLOB_MIN_DXIL};
+ let base = std::env::temp_dir().join(format!("xcl-driver-cache-long-repair-{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&base);
+ let _directory = Directory(base.clone());
+ let dir = base.join("a".repeat(120)).join("b".repeat(120));
+ std::fs::create_dir_all(&dir).unwrap();
+ let path = dir.join("repair.pso");
+ assert!(path.to_string_lossy().encode_utf16().count() > 260);
+ let cache = DriverBlobs::new();
+ keep_driver_blob(&cache, 0, 9u64, COMPUTE_BLOB_MIN_DXIL, Some(&path), KEEP, || Some(b"old".to_vec()));
+ let loaded = load(&path).unwrap();
+ cache.forget_if(9, &loaded.shared());
+ note(false, Some(loaded));
+ assert!(!path.exists());
keep_driver_blob(&cache, 0, 9u64, COMPUTE_BLOB_MIN_DXIL, Some(&path), KEEP, || Some(b"fresh".to_vec()));
assert_eq!(load_bytes(&path).as_deref(), Some(b"fresh".as_slice()));
}
@@ -7020,6 +7101,18 @@ impl<K: Copy + Eq + std::hash::Hash> DriverBlobs<K> {
!persisted.contains_key(&key) && active.insert(key)
}
+ /// A rejected disk-only generation can leave a marker after its file is removed.
+ /// Keep that marker while one eligible builder attempts to replace the missing file.
+ fn reserve_disk_repair(&self, key: K) -> bool {
+ let blobs = self.blobs.lock().unwrap();
+ if blobs.as_ref().is_some_and(|(map, _)| map.contains_key(&key)) {
+ return false;
+ }
+ let mut guard = self.keeping.lock().unwrap();
+ let Some((active, persisted)) = guard.as_mut() else { return false };
+ persisted.get(&key).is_some_and(|generation| generation.upgrade().is_none()) && active.insert(key)
+ }
+
/// Admit the exact disk generation accepted by the driver without copying it. Holding both
/// locks excludes a builder reservation between the presence check and insertion.
fn admit(&self, key: K, blob: std::sync::Arc<Vec<u8>>, limit: usize) -> bool {
@@ -7356,10 +7449,17 @@ fn keep_driver_blob_at<K: Copy + Eq + std::hash::Hash>(
let min = if preparing { std::time::Duration::ZERO } else { min };
let memory = !preparing && (dxil_len >= COMPUTE_BLOB_MIN_DXIL || driver_cache::keep_fixtures());
let to_disk = disk.is_some() && driver_cache::worth_keeping(took, min);
- if !(memory || to_disk) || !cache.reserve(key) {
+ if !(memory || to_disk) {
return None;
}
+ let fresh = cache.reserve(key);
+ let repair = !fresh && to_disk && cache.reserve_disk_repair(key);
+ if !fresh && !repair { return None; }
let keep_turn = disk.filter(|_| to_disk).and_then(|path| driver_cache::KeepTurn::new(path, took, min));
+ if repair && (keep_turn.is_none() || !matches!(disk.unwrap().try_exists(), Ok(false))) {
+ cache.finish(key, None, limit, false);
+ return None;
+ }
let Some(bytes) = read().filter(|bytes| !bytes.is_empty()) else {
cache.finish(key, None, limit, false);
return None;
@@ -7367,10 +7467,12 @@ fn keep_driver_blob_at<K: Copy + Eq + std::hash::Hash>(
let blob = std::sync::Arc::new(bytes);
// Publish to disk before exposing the blob through RAM: a concurrent consumer cannot reject
// this generation while its staging file is being renamed into place.
- let persisted = keep_turn.as_ref().is_some_and(|turn| turn.store(&blob));
+ let persisted = keep_turn.as_ref().is_some_and(|turn| {
+ if repair { turn.store_if_absent(&blob) } else { turn.store(&blob) }
+ });
// (a blob for the disk only still releases the key, and marks it persisted when written)
- cache.finish(key, memory.then(|| blob.clone()), limit, persisted);
- Some(blob)
+ cache.finish(key, (memory && (!repair || persisted)).then(|| blob.clone()), limit, persisted);
+ (!repair || persisted).then_some(blob)
}
/// The driver's compiled form of translated graphics pipelines (`GetCachedBlob`),AI use: Codex (GPT-6.2 Sol) wrote and ran the local candidate and regressions; Codex (GPT-6.2 Astra) reviewed the reservation and publication races. |
|
Current-base update for #2740 head The PR currently conflicts with AI use: Codex (GPT-6.2 Sol) compared the current code and ran the focused test. |
|
Follow-up to the current-main repair candidate: its A synthetic If the fresh writer loses the file race, its compiled blob may still be used in memory. Supplemental diff and regression@@ keep_driver_blob_at
- let persisted = keep_turn.as_ref().is_some_and(|turn| {
- if repair { turn.store_if_absent(&blob) } else { turn.store(&blob) }
- });
+ let persisted = keep_turn.as_ref().is_some_and(|turn| turn.store_if_absent(&blob));
@@ driver_cache::tests
+ #[test]
+ fn a_fresh_builder_does_not_replace_a_newer_file() {
+ use super::super::{keep_driver_blob, DriverBlobs, COMPUTE_BLOB_MIN_DXIL};
+ let dir = std::env::temp_dir().join(format!("xcl-driver-cache-fresh-race-{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&dir);
+ std::fs::create_dir(&dir).unwrap();
+ let _directory = Directory(dir.clone());
+ let path = dir.join("fresh.pso");
+ assert!(write(&path, b"stale"));
+ let loaded = load(&path).expect("foreign cached blob");
+ note(false, Some(loaded));
+ assert!(!path.exists(), "refused generation removed");
+ let cache = DriverBlobs::new();
+ let got = keep_driver_blob(&cache, 0, 17u64, COMPUTE_BLOB_MIN_DXIL, Some(&path), KEEP, || {
+ assert!(write(&path, b"newer"));
+ Some(b"older".to_vec())
+ });
+ assert_eq!(got.as_deref().map(Vec::as_slice), Some(b"older".as_slice()));
+ assert_eq!(load_bytes(&path).as_deref(), Some(b"newer".as_slice()));
+ assert_eq!(std::fs::read_dir(&dir).unwrap().count(), 1);
+ }AI use: Codex (GPT-6.2 Sol) wrote and ran the local regression and candidate; Codex (GPT-6.2 Astra) reviewed the cache invariant. |
|
Rechecked the existing disk-only retry candidate and no-replace publication supplement on current Two test-only controls fail on unchanged The refined candidate invalidates an empty cache entry through the exact open file handle, then keeps no-replace publication so a concurrent valid writer is preserved. On the candidate overlay: Windows 11 build 26300, Rust 1.99.1 MSVC; CPU-only, no GPU exercised. This is a local candidate based on current Additional empty-file recovery diffdiff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs
@@ driver_cache::load
- (!bytes.is_empty()).then(|| LoadedBlob { bytes: Arc::new(bytes), file: invalidatable.then_some(file) })
+ if bytes.is_empty() {
+ if invalidatable {
+ let empty = LoadedBlob { bytes: Arc::new(bytes), file: Some(file) };
+ let _ = empty.invalidate();
+ }
+ return None;
+ }
+ Some(LoadedBlob { bytes: Arc::new(bytes), file: invalidatable.then_some(file) })
@@ driver_cache::tests
+#[test]
+fn an_empty_driver_blob_is_invalidated_before_a_fresh_write() {
+ use super::super::{keep_driver_blob, DriverBlobs, COMPUTE_BLOB_MIN_DXIL};
+ let dir = std::env::temp_dir().join(format!("xcl-driver-cache-empty-repair-{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&dir);
+ std::fs::create_dir(&dir).unwrap();
+ let _directory = Directory(dir.clone());
+ let path = dir.join("empty.pso");
+ std::fs::write(&path, []).unwrap();
+ assert!(path.exists());
+ assert!(load(&path).is_none());
+ assert!(!path.exists(), "the exact empty cache generation is invalidated");
+ let cache = DriverBlobs::new();
+ let built = keep_driver_blob(&cache, 0, 18u64, COMPUTE_BLOB_MIN_DXIL, Some(&path), KEEP,
+ || Some(b"fresh".to_vec()));
+ assert_eq!(built.as_deref().map(Vec::as_slice), Some(b"fresh".as_slice()));
+ assert_eq!(load_bytes(&path).as_deref(), Some(b"fresh".as_slice()));
+}AI use: Codex (GPT-6.2 Sol) revalidated the regressions and candidate; Codex (GPT-6.2 Astra) reviewed the file-handle and publication invariants. |
|
This change is already on main. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
|
Closing as superseded: this change is already on Two independent checks found this: Foniass's close list on #1607 and ours against current AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents. |
A slow translated compute PSO can compile successfully after the 512 MiB compute blob RAM cache fills up. Preserve its driver blob for the disk cache even if it cannot be admitted to RAM. This extracts the standalone fix from the NVIDIA reference stack in #2706 and retains the original author of
ee0183fd.What is in it
crates/xcl/src/hle/d3d12x/real.rsgives the caller the driver blob for disk retention and independently checks the RAM budget. Regular translated compute and the two-pass compute path use the same policy.Tested
Exact head
9ecae592ea3a1ba2b41db0167e06da435b271791on NVIDIA GeForce RTX 4060 Laptop (616.56), Ryzen 7 8845HS, Windows 11 build 26200.9974, Rust 1.98.1 MSVC, DXC 1.8.2502.11.cargo test --offline --locked -p xcl --lib compute_blob_tests -- --nocapture --test-threads=1passed 3 with zero skips.cargo test --offline --locked -p xcl --test gpu_compute_e2e -- --nocapture --test-threads=1reported 7 passed and 1 runtime heap-window skip. The skipped case passed on this exact revision in a focused rerun withXCL_HEAP_WINDOWS=1.The exact-head debug workspace build and complete RTX 4060 Laptop run reported 1436 passed, 0 failed, and 47 ignored. There were 26 runtime skip markers (21 no native wave64, 3 refused wave32 per-lane operations, 1 no heap windows, and 1 Windows Developer Mode unavailable).
The first 60-second smoke pair recorded 388 frames on the head against 499 on main, below the frame threshold. Both completed with zero crashes and device removals. The isolated 120-second pair below repeats the comparison.
Regression run
Clean release builds on the same RTX 4060 Laptop GPU and retail workload. XCL used a separate title state and DXIL cache for each run.
Main
PR head
Not tested
AI use
Claude Code (Claude Fable 5.2) assisted the original commit. OpenAI Codex (
gpt-6.2-sol) adapted it to current main, added the duplicate accounting check, ran validation, and prepared this submission.