Repository navigation
VFS: XCL's shader cache on a drive a console mount names stays where it is - #331
Merged
Merged
Conversation
…it is With XCL_DXIL_CACHE (or %LOCALAPPDATA%) on the PC's D: drive, the title's process took the cache's paths for the console's D:\ (the game folder): it wrote its DXIL and translations into the title's overlay and read them from there. The folder that was named was neither read nor written, so a cache filled outside the title (xcl shaders --precompile, no mounts there) was not found. Vfs::own_folder names a folder of XCL's own besides the title's data; the host passes the shader cache folder. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 24, 2026
Collaborator
This was referenced Nov 24, 2026
This was referenced Nov 24, 2026
CalvyPZ
pushed a commit
to CalvyPZ/xcl
that referenced
this pull request
Nov 24, 2026
The Agility SDK probe (gpu::agility, is_file and fs::read of <dir>\D3D12Core.dll) runs after the VFS hooks are installed. When XCL_D3D12_DIR, <exe dir>\D3D12 or <exe dir> is on a drive letter a console mount names (G:, D:, S: in the report), the hooked file APIs translate the host path to the game folder, the DLL is not found there, and the SDK is reported as unavailable. host.rs now registers each candidate's D3D12Core.dll as one of XCL's own paths before the hooks go in, the mechanism xcl-dev#49 and xcl-dev#331 use for the game folder, the data folder and the shader cache. It registers the files, not their directories: the exe directory can be a drive root (D:\xcl.exe), and a root among the own folders would take the whole drive from the console mount. CreateDeviceFactory loads the DLL through the loader, which is not hooked. The test registers what agility::sdk_files returns for the env override, the exe dir and a drive-root exe dir, and checks that each DLL path passes while the rest of the drive, beside the SDK and at its root, stays the console's. Registering the directories instead fails it at the drive-root check; registering nothing fails it too. Fixes xcl-dev#595 Assisted-by: Claude Code (Claude Opus 4.6 found the cause and wrote the first version; Claude Opus 5.5 narrowed it to the DLL files and rewrote the test)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the shader cache on a PC drive that the title's mounts name –
XCL_DXIL_CACHE=D:\…, or a user profile onD:, the console's game drive – the title's process takes the cache's paths for console paths: it writes its DXIL and translations into the title's overlay and reads them from there. The folder that was named is neither read nor written, so whatxcl shaders --precompilewrites (no mounts there) is not found by the title, and a title's cache is in its own overlay instead of the folder titles share.in_own_folders(#49) already keeps the game folder and the title's data folder out of the mounts; the shader cache is outside both.What is in it
crates/xcl/src/vfs.rs:Vfs::own_foldernames a folder of XCL's own besides the title's data, andin_own_folderscounts it. Testa_console_drive_mount_leaves_xcls_shader_cache_on_that_drive: withoutown_folderthe cache file is classified as a game file (written to the overlay), with it the path is passed through; a sibling folder and the rest of the drive stay the console's.crates/xcl/src/host.rs: the host namesrecomp::dxc::cache_dir().Tested
hardware: Intel Core i7-7700K, 16 GB RAM, NVIDIA GeForce RTX 5080 (driver 610.47), Windows 10 22H2 (19045), rustc 1.100.0
stable-x86_64-pc-windows-msvc; debug for the tests, release for the title.cargo build --workspace && cargo test --workspace -- --test-threads=4on603cdd3: 666 passed, 0 failed, 41 ignored (SKIPPED GPU tests:gpu_wave32_program_in_wave64_hardware,gpu_geometry_wave32_prefix_count_over_a_mask– no wave64).game checked: the newer retail title of the README, with the game folder and
XCL_DXIL_CACHEboth onD:. The cache folder was filled beforehand (402 files, a new folder name, so nothing of it in the overlay), then three 60 s runs, DXIL cache hits / misses fromreport.json:<title data>\overlay\<the folder's path>main85bdf21main85bdf21603cdd3main)With the folder full,
mainmisses 26 of 29 lookups and leaves 23 files in the overlay; its second run reads those. The PR's build reads the folder.Regression run
main:
PR:
(The frame count is this Intel CPU's: #306 is about that and is not part of this change.)
Not tested
XCL_DXC_DIR,XCL_D3D12_DIR): not looked at.xcl shaders --precompileitself: the folder in the runs above was filled by an earlier run of the title with this change, not by a precompile.AI use
Duplicate check before opening (2026-11-23 23:32 UTC,
maindb1ddb2): read #49, #150, #158, #160, #171, #174, #255, #316 (case folding and verbatim roots in the same file, other lines; the two merge together cleanly).🤖 Generated with Claude Code