Skip to content

VFS: XCL_DRIVER_SHADER_CACHE=0 refuses the driver its shader cache file - #3048

Draft
Prime1997 wants to merge 2 commits into
xcl-dev:nvidia-devfrom
Prime1997:contrib/nv-driver-cache-off
Draft

Prime1997 wants to merge 2 commits into
xcl-dev:nvidia-devfrom
Prime1997:contrib/nv-driver-cache-off

Conversation

@Prime1997

@Prime1997 Prime1997 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Prime · project thread

With XCL_DRIVER_SHADER_CACHE=0 the display driver's opens of its own shader cache file fail with access denied, so it runs without one. Off by default: it trades RAM for slower driver compiles, measured below.

Part of #2688; the cache file's share of the working set is tiagonleal's finding on #1773.

Why
The NVIDIA driver maps its shader cache file for the process (%LOCALAPPDATA%\NVIDIA\DXCache\<id>.nvph) whole. For xcl.exe it had grown to 4 GiB, and 3.9 GB of it was in the working set 25 s after start, before any frame (sampled from outside with VirtualQueryEx / QueryWorkingSetEx). In a retail title driven into its world on an RTX 3060 Ti 8 GB with 32 GB of RAM, Series S profile, 420 s runs on a local branch of nvidia-dev with the trial switches of #2688 work, the machine (32 GB, about 9.5 GB taken by other programs) ran out of RAM at about 225 s; with this switch on, 10.8 GB was still available at 222 s against 1.7 GB. The cost: the driver compiles from scratch. Compute pipelines' driver compiles took a median of 717 ms against 157 ms, p90 15.5 s against 253 ms, and 869 pipelines were built in 420 s against 2,401. By 420 s the process's own memory had grown to fill the RAM either way. XCL keeps the driver's pipeline blobs in its own cache (XCL_PSO_DISK_CACHE_MIN_MS), so that file holds them a second time. A second observation, not proven to be cause and effect: that day the file had stood at exactly 4 GiB, full, since about 09:51 local; of the 420 s runs made with it, 4 of 6 lost the device (0x887a0005, DRED page fault at GPU address 0) between 288 and 422 s, the one run with this switch on did not, and after the cache files were deleted 2 of 2 runs were clean. In the 60 s regression run below (switch off, the default) the title shows 1388 frames against the base's 1391.

What is in it

  • crates/xcl/src/vfs_hooks.rs: is_driver_shader_cache and driver_cache_refused (the switch, read once, a line at powers of two), checked first in the CreateFileW / CreateFileA / CreateFile2 hooks.
  • Test vfs_hooks::tests::only_the_drivers_shader_cache_files_are_recognised.
  • Second commit (review note from thehollowedone): only a .nvph file directly in NVIDIA\DXCache of this user's AppData\Local (LOCALAPPDATA) or of the LocalLow folder beside it counts (driver_cache_roots, is_driver_cache_in), with or without \\?\. The first commit took any path with those folder names, so a title's own G:\assets\NVIDIA\DXCache\title.nvph was refused too; the test now has that path, a file in a subfolder and another user's folder among its negative cases.

Tested

  • NVIDIA GeForce RTX 3060 Ti 8 GB (driver 32.0.16.1714), Intel Core i5-10400, 32 GB RAM, Windows 11 26200, rustc 1.100.0; debug tests, release smoke.
  • cargo test --locked --workspace --no-fail-fast -- --test-threads=4 with XCL_DXC_DIR set to DXC 1.9.2609.5: 1825 passed, 8 failed, 48 ignored. The 8 failures are the same tests that fail on nvidia-dev d1be8103 itself (1824 passed, 8 failed, 48 ignored there, same command): async_compute_pso_registers_real_pso_and_not_standin, console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly, hle::d3d12x::texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stays, hle::d3d12x::texture_upload::tests::pieces_hold_the_texels_of_their_levels, split_compute_prefers_the_offline_whole_pipeline, two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs.
  • SKIPPED on this adapter: 28 (no wave64: 21, per-lane f16 form refused: 3, no dxc.exe: 1, no heap windows (opt-in: XCL_HEAP_WINDOWS=1): 1, cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depend: 1, no heap windows: 1).
  • GitHub's Build and test (Windows, no GPU) fails here, as it does on the other open pull requests against nvidia-dev (D3D12.X: XCL_TEXTURE_SYSMEM puts streamed texture levels in system memory #3039 and D3D12.X: make shadowed textures active again when a draw samples them #2956 among them): on the runner's WARP device a sparse-window test loses the device (hle::d3d12x::sparse::tests::a_gpu_write_into_a_gpu_view_lands_in_its_cpu_view on D3D12.X: XCL_TEXTURE_SYSMEM puts streamed texture levels in system memory #3039) and the lib test process exits with 0x887a0020. The suite above passes that test on the card.

Regression run
A commit of main (b49be183, the last one before the shader preparation screen of #2555, which prepares every record before the title and so does not fit a 60 s run):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 363 (PresentX 363)
presents per 2 s (last 3): 16 17 16
device removals: 0
crashes: 0
peak commit: 15320 MB

The base of this PR, nvidia-dev d1be8103:

xcl-smoke v1
commit: d1be8103644791b7a65f068954324e93d4b1b565
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 1391 (PresentX 1391)
presents per 2 s (last 3): 60 58 59
device removals: 0
crashes: 0
peak commit: 15637 MB

This PR's head:

xcl-smoke v1
commit: 7cd669763e407b3ba1fd80a32e48c9b3a4f8e2ff
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 1388 (PresentX 1388)
presents per 2 s (last 3): 56 60 60
device removals: 0
crashes: 0
peak commit: 15681 MB

Not tested

  • AMD and Intel drivers: their cache files have other names and places, so the switch does nothing there.
  • A LocalLow folder moved away from the folder beside LOCALAPPDATA: the driver's files there are not recognised.
  • What the driver does with a cache it cannot open on other driver versions than 617.14 (here it went on without one, no error).
  • Wine / Linux.

AI use
Claude Code (Claude Fable 5.2 and Claude Opus 5.5) wrote the code, ran the suite and the regression runs on the hardware above, and wrote this description; Prime asked for it and owns the account. We coordinate the 8 GB work on the XCL Discord too: https://discord.gg/6B4TykyC4W

🤖 Generated with Claude Code

The NVIDIA driver maps its shader cache file of a process (AppData\LocalNVIDIA\DXCache\<id>.nvph) whole and reads all of it at start. For a retail
title on an RTX 3060 Ti the file had grown to 4 GiB: 3.9 GB of xcl.exe's
working set from the first second (sampled from outside with
QueryWorkingSetEx), on a 32 GB machine the title fills until Windows has
under 1 GB left. XCL keeps the driver's pipeline blobs in its own cache, so
the file holds them a second time. With XCL_DRIVER_SHADER_CACHE=0 the
driver's opens of such a file fail with access denied. Off by default.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@imnicho

imnicho commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Measurements from a 16 GB machine: the mapping is the same here, the file gets far larger than 4 GiB, and with a small file the switch buys no RAM but costs frames

RTX 5080 16 GB (driver 610.47), i7-7700K, 16 GB RAM, Windows 10 22H2. Your commit edc2b458 cherry-picked (cleanly) onto a local nvidia-dev test tree (d1be8103 plus other open nvidia-dev PRs and local test changes), release build, one binary for all four runs, a retail title driven into its world, Series S profile, 600 s limit, the switch the only difference, runs alternated.

1. The mapping and the size, from earlier days on this machine (no switch)

  • 25 Nov: the driver's files for xcl.exe were 4 GB and 2 GB; 3.2 GB of them were resident in the title's process at its start, and Windows had trimmed that to 0.1 GB once the world needed the RAM (file-backed pages, so they go first).
  • 26 Nov, during the shader preparation: the host process had 8.6 GB resident, 7.8 GB of it one 8 GB .nvph file, with 0.9 GB of RAM available while three workers compiled.
  • 27 Nov: the set for xcl.exe was 34.6 GB in ten files (the largest 8 and 16 GB, all last written on 26 or 27 Nov), and the system drive was full in the middle of a run (xcl run: warn when a drive a run writes to is nearly full #3058 adds a warning for that). I deleted the set afterwards, so the runs below start from a small one.

2. Four runs today, driver cache of xcl.exe at about 1 GB

default default XCL_DRIVER_SHADER_CACHE=0 XCL_DRIVER_SHADER_CACHE=0
world set-up at 147 s 167 s 147 s 144 s
end device removed 0x887a0006 at 543 s 600 s limit 600 s limit device removed 0x887a0006 at 348 s
frames after the set-up 524 (1.36 a second) 693 (1.60) 191 (0.42) 139 (0.72)
driver compiles logged: median / p90 109 / 237 ms 93 / 182 ms 371 / 714 ms 355 / 744 ms
driver compiles: time in all 82 s 81 s 473 s (one of 108 s) 290 s
RAM available in the world: mean / least 976 / 197 MB 1,751 / 115 MB 1,079 / 38 MB 761 / 419 MB
pages read from disk in the world 10,237 a second 6,756 6,907 8,490
cache opens refused (the log's counter) - - 32+ 32+
  • With the switch the driver compiles took about 3.5 times as long at the median (your 717 against 157 ms is 4.6 times), and the title showed 0.4 to 0.7 frames a second in the world against 1.4 to 1.6.
  • Available RAM in the world was no different between the arms here. That fits the first point: on a machine this short of RAM the mapped file is trimmed anyway once the world loads, and at 1 GB it is small. Your 10.8 against 1.7 GB was with a 4 GiB file and 32 GB of RAM, where the file can stay resident; I could not repeat the comparison with the 34.6 GB set because it is gone.
  • The device removal on this machine (one run of two in each arm) does not follow the switch.

So here the case for the switch is the start-up and the preparation (the 7.8 GB above), not the world; and what would help a small machine more than refusing the file is keeping it small. I did not test either of those today.

Not tested: the switch with a large cache file, the preparation with the switch, AMD, the Series X profile.

AI use: Claude Code with Claude Fable 5.2 built the tree, ran the four runs and wrote this comment.

@Prime1997

Copy link
Copy Markdown
Collaborator Author

Thanks, this is the comparison I couldn't make. With a 1 GB file on a 16 GB machine the switch buys no RAM in the world and costs frames (0.4-0.7 against 1.4-1.6 a second), so it stays off by default and stays a switch for start-up and preparation on machines short of RAM.

A data point from here that points the same way as your last paragraph: on the 3060 Ti machine the file for xcl.exe had stood at exactly 4 GiB (full) since the morning. In the afternoon 4 of 6 runs with it lost the device (0x887a0005, a DRED page fault at address 0), the run with the switch on didn't, and after the cache group was deleted 2 of 2 runs were clean. That's not proven to be cause and effect, but keeping the file small, or starting it again when it's full, looks like the better fix than refusing it. That would be a separate change; I'll say here if we make one.

AI use: Claude Code (Claude Opus 5.5) wrote this reply; Prime posted it.

@thehollowedone

Copy link
Copy Markdown
Contributor

I found one path boundary to tighten before using XCL_DRIVER_SHADER_CACHE=0 on titles with arbitrary file names. At head edc2b458, is_driver_shader_cache accepts any path containing \NVIDIA\DXCache\ and ending in .nvph. A title-owned path such as G:\assets\NVIDIA\DXCache\title.nvph matches, and the three CreateFile hooks return access denied before title VFS routing.

I added only the regression below to an otherwise exact copy of this PR's vfs_hooks.rs. cargo test --locked -p xcl --lib only_the_drivers_shader_cache_files_are_recognised -- --nocapture failed 0 passed / 1 failed at the new assertion. The existing positive paths show the intended Local and LocalLow cache locations. I suggest matching normalized absolute paths under the current user's actual Local/LocalLow NVIDIA cache roots, with a direct .nvph child, rather than searching for the directory names anywhere in the path. Keep \\?\ paths covered and add the guest-path negative case.

Regression-only diff
@@ -1291,6 +1291,7 @@ mod tests {
         assert!(!is_driver_shader_cache(r"C:\Games\Title\data\cache.nvph"), "a title's own file of that type");
+        assert!(!is_driver_shader_cache(r"G:\assets\NVIDIA\DXCache\title.nvph"), "a title path can contain the driver's directory names");
         assert!(!is_driver_shader_cache(r"C:\ProgramData\NVIDIA Corporation\Drs\nvdrssel.bin"), "the driver's settings");

This is a synthetic path test. I did not test a modified matcher or run a title with the switch enabled. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), rustc 1.99.1 MSVC. AI use: Codex (GPT-6.2 Sol) wrote and ran the regression; Codex (GPT-6.2 Astra) independently traced the hook path.

is_driver_shader_cache took any path that contained \NVIDIA\DXCache\ and
ended in .nvph, so with XCL_DRIVER_SHADER_CACHE=0 a title's own file such
as G:\assets\NVIDIA\DXCache\title.nvph was refused too (found in review
on xcl-dev#3048). Now only a .nvph file directly in NVIDIA\DXCache of this
user's AppData\Local (LOCALAPPDATA) or of the LocalLow folder beside it
counts, with or without \?\. The test has the review's path, a file in
a subfolder and another user's folder among its negative cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Prime1997

Copy link
Copy Markdown
Collaborator Author

Thanks, confirmed and fixed in 7cd6697: only a .nvph file directly in NVIDIA\DXCache under this user's AppData\Local (from LOCALAPPDATA) or the LocalLow folder beside it counts now, with or without \\?\. G:\assets\NVIDIA\DXCache\title.nvph and a file in a subfolder of the cache folder are among the negative cases of only_the_drivers_shader_cache_files_are_recognised, which fails on the old matcher. The suite and the smoke for the new head are in the description.

AI use: Claude Code (Claude Opus 5.5) wrote the fix and this reply; Prime posted it.

@andrewDoing

Copy link
Copy Markdown

I checked the revised cache-root matcher on head 7cd66976 with synthetic Windows paths and the exact production predicate. It appears to assume LocalLow is a sibling of LOCALAPPDATA. Windows exposes Local and LocalLow as separate known folders, so they can have different locations.

For LOCALAPPDATA=D:\Redirected\Local and LocalLow at C:\Users\sample\AppData\LocalLow:

  • The direct Local cache path matched, as intended.
  • The actual LocalLow cache path did not match.
  • An unrelated D:\Redirected\LocalLow\NVIDIA\DXCache\a.nvph path did match.
  • A guest asset path did not match.

This is a synthetic path-classification probe; I did not redirect known folders or open files on this machine. Resolving the LocalLow known folder independently, rather than deriving it from Local's parent, would address this layout. See the Windows known-folder IDs.

AI use: OpenAI Codex with GPT-6.2 Astra built and ran the probe; Codex reviewed and prepared this report.

@thehollowedone

Copy link
Copy Markdown
Contributor

Follow-up to andrewDoing’s redirected-folder check on head 7cd6697: I tested a small candidate that resolves FOLDERID_LocalAppDataLow independently of LOCALAPPDATA. It obtains the known folder before installing the CreateFile hooks, then checks only a direct .nvph child of either actual cache root. That avoids resolving a folder from inside an intercepted file open. The existing windows-sys dependency needs its Shell feature enabled.

The focused cache-path test passed (1/0/0), including redirected Local and LocalLow roots, the falsely guessed sibling, and an extended UNC path. The full vfs_hooks::tests group passed (11/0/0), and cargo build --offline --locked -j 4 --workspace passed. On Windows 11 build 26300, RTX 3080 Ti, the candidate's cargo test --offline --locked -j 4 --workspace -- --test-threads=4 stopped at the library suite: 1,697 passed, 3 failed, 28 ignored, with 25 GPU skip notices. All three failures also reproduce on the untouched 7cd6697 head when filtered: two texture_upload::tests failures and console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk. Later workspace test binaries were not run because Cargo stopped after the library failure. I did not run a title smoke on this uncommitted suggestion.

Candidate diff against 7cd6697
diff --git a/crates/xcl/Cargo.toml b/crates/xcl/Cargo.toml
index 238591b1..0cd1bee3 100644
--- a/crates/xcl/Cargo.toml
+++ b/crates/xcl/Cargo.toml
@@ -68,5 +68,6 @@ features = [
     "Win32_Globalization",
     "Win32_UI_Controls",
     "Win32_UI_Controls_Dialogs",
+    "Win32_UI_Shell",
     "Win32_UI_WindowsAndMessaging",
 ]
diff --git a/crates/xcl/src/vfs_hooks.rs b/crates/xcl/src/vfs_hooks.rs
index 365807bc..480fefd7 100644
--- a/crates/xcl/src/vfs_hooks.rs
+++ b/crates/xcl/src/vfs_hooks.rs
@@ -82,34 +82,44 @@ fn log_open(api: &str, path: &str, flags: u32) {
     }
 }
 
-/// Whether `path` is the NVIDIA driver's shader cache file of a process: a `.nvph` file directly
-/// in `NVIDIA\DXCache` of this user's `AppData\Local` (`LOCALAPPDATA`) or of the `LocalLow`
-/// folder beside it, where the driver keeps them. A title's own file in folders of those names
-/// elsewhere is not one.
+static DRIVER_CACHE_ROOTS: std::sync::OnceLock<Vec<String>> = std::sync::OnceLock::new();
+
+/// Whether `path` is a direct `.nvph` child of this user's actual NVIDIA cache folders.
 fn is_driver_shader_cache(path: &str) -> bool {
-    static ROOTS: std::sync::OnceLock<Vec<String>> = std::sync::OnceLock::new();
-    let roots = ROOTS.get_or_init(|| driver_cache_roots(&std::env::var("LOCALAPPDATA").unwrap_or_default()));
-    is_driver_cache_in(path, roots)
+    DRIVER_CACHE_ROOTS.get().is_some_and(|roots| is_driver_cache_in(path, roots))
 }
 
-/// The folders the driver keeps its shader cache files in for the user's `AppData\Local` folder
-/// `local`, in lowercase: `<local>\nvidia\dxcache\` and `<local>\..\locallow\nvidia\dxcache\`.
-fn driver_cache_roots(local: &str) -> Vec<String> {
-    let local = local.trim().replace('/', "\\").trim_end_matches('\\').to_ascii_lowercase();
-    if local.is_empty() {
-        return Vec::new();
-    }
-    let mut roots = vec![format!(r"{local}\nvidia\dxcache\")];
-    if let Some((parent, _)) = local.rsplit_once('\\') {
-        roots.push(format!(r"{parent}\locallow\nvidia\dxcache\"));
+/// Resolve LocalLow independently: redirected Local and LocalLow need not be siblings.
+fn local_low_dir() -> Option<String> {
+    use windows_sys::Win32::System::Com::CoTaskMemFree;
+    use windows_sys::Win32::UI::Shell::{FOLDERID_LocalAppDataLow, KF_FLAG_DONT_VERIFY, SHGetKnownFolderPath};
+    let mut path = std::ptr::null_mut();
+    let hr = unsafe { SHGetKnownFolderPath(&FOLDERID_LocalAppDataLow, KF_FLAG_DONT_VERIFY as u32, std::ptr::null_mut(), &mut path) };
+    let result = if hr >= 0 { unsafe { from_wide_ptr(path) } } else { None };
+    unsafe { CoTaskMemFree(path.cast()) };
+    result
+}
+
+fn normalize_driver_cache_path(path: &str) -> String {
+    let lower = path.replace('/', "\\").to_ascii_lowercase();
+    if let Some(rest) = lower.strip_prefix(r"\\?\unc\") {
+        format!(r"\\{rest}")
+    } else {
+        lower.strip_prefix(r"\\?\").unwrap_or(&lower).to_owned()
     }
-    roots
+}
+
+fn driver_cache_roots(local: Option<&str>, low: Option<&str>) -> Vec<String> {
+    [local, low].into_iter().flatten().filter_map(|path| {
+        let root = normalize_driver_cache_path(path);
+        let root = root.trim_end_matches('\\');
+        std::path::Path::new(root).is_absolute().then(|| format!(r"{root}\nvidia\dxcache\"))
+    }).collect()
 }
 
 /// Whether `path` (with or without `\\?\`) is a `.nvph` file directly in one of `roots`.
 fn is_driver_cache_in(path: &str, roots: &[String]) -> bool {
-    let lower = path.replace('/', "\\").to_ascii_lowercase();
-    let plain = lower.strip_prefix(r"\\?\").unwrap_or(&lower);
+    let plain = normalize_driver_cache_path(path);
     roots.iter().any(|root| {
         plain.strip_prefix(root.as_str()).is_some_and(|name| name.len() > ".nvph".len() && name.ends_with(".nvph") && !name.contains('\\'))
     })
@@ -1247,6 +1257,13 @@ unsafe extern "system" fn hk_find_close(h: HANDLE) -> i32 {
 // ---------------------------------------------------------------------------------------
 
 pub fn install() -> Result<(), String> {
+    if std::env::var("XCL_DRIVER_SHADER_CACHE").is_ok_and(|v| v.trim() == "0") {
+        DRIVER_CACHE_ROOTS.get_or_init(|| {
+            let local = std::env::var("LOCALAPPDATA").ok();
+            let low = local_low_dir();
+            driver_cache_roots(local.as_deref(), low.as_deref())
+        });
+    }
     let kb = "kernelbase.dll";
     let list: &[(&str, usize, &AtomicUsize)] = &[
         ("CreateFileW", hk_create_file_w as usize, &O_CREATE_FILE_W),
@@ -1313,20 +1330,24 @@ mod tests {
 
     #[test]
     fn only_the_drivers_shader_cache_files_are_recognised() {
-        let roots = driver_cache_roots(r"C:\Users\a\AppData\Local");
+        let roots = driver_cache_roots(Some(r"D:\Redirected\Local"), Some(r"C:\Users\a\AppData\LocalLow"));
         let is = |path: &str| is_driver_cache_in(path, &roots);
-        assert!(is(r"C:\Users\a\AppData\Local\NVIDIA\DXCache\32e6a9dbc29925ed.nvph"));
+        assert!(is(r"D:\Redirected\Local\NVIDIA\DXCache\32e6a9dbc29925ed.nvph"));
         assert!(is(r"\\?\c:\users\a\appdata\locallow\nvidia\dxcache\0002A9DBC29925ED.NVPH"));
-        assert!(!is(r"C:\Users\a\AppData\Local\NVIDIA\DXCache\"), "the folder itself");
+        assert!(!is(r"D:\Redirected\LocalLow\NVIDIA\DXCache\wrong.nvph"), "the guessed sibling is not LocalLow");
+        assert!(!is(r"D:\Redirected\Local\NVIDIA\DXCache\"), "the folder itself");
         assert!(!is(r"C:\Games\Title\data\cache.nvph"), "a title's own file of that type");
         assert!(!is(r"G:\assets\NVIDIA\DXCache\title.nvph"), "a title's path with the driver's folder names");
-        assert!(!is(r"C:\Users\a\AppData\Local\NVIDIA\DXCache\sub\title.nvph"), "not directly in the driver's folder");
+        assert!(!is(r"D:\Redirected\Local\NVIDIA\DXCache\sub\title.nvph"), "not directly in the driver's folder");
         assert!(!is(r"C:\Users\b\AppData\Local\NVIDIA\DXCache\32e6a9dbc29925ed.nvph"), "another user's");
         assert!(!is(r"C:\ProgramData\NVIDIA Corporation\Drs\nvdrssel.bin"), "the driver's settings");
-        // this process's own folder, as the driver opens it
-        if let Ok(local) = std::env::var("LOCALAPPDATA") {
-            assert!(is_driver_shader_cache(&format!(r"{local}\NVIDIA\DXCache\32e6a9dbc29925ed.nvph")));
-            assert!(!is_driver_shader_cache(r"G:\assets\NVIDIA\DXCache\title.nvph"));
+        assert!(is_driver_cache_in(r"D:\Redirected\Local\NVIDIA\DXCache\a.nvph", &driver_cache_roots(Some(r"D:\Redirected\Local"), None)));
+        assert!(is_driver_cache_in(r"C:\Users\a\AppData\LocalLow\NVIDIA\DXCache\a.nvph", &driver_cache_roots(None, Some(r"C:\Users\a\AppData\LocalLow"))));
+        let unc = driver_cache_roots(Some(r"\\server\profile\Local"), None);
+        assert!(is_driver_cache_in(r"\\?\UNC\server\profile\Local\NVIDIA\DXCache\a.nvph", &unc));
+        if let Some(low) = local_low_dir() {
+            let roots = driver_cache_roots(None, Some(&low));
+            assert!(is_driver_cache_in(&format!(r"{low}\NVIDIA\DXCache\a.nvph"), &roots));
         }
     }

AI use: Codex (GPT-6.2 Sol) wrote and tested the candidate; Codex (GPT-6.2 Astra) checked the folder and hook-order design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants