Skip to content

VFS: the Agility SDK's D3D12Core.dll stays on a console-mounted drive - #1136

Closed
vakaobr wants to merge 1 commit into
xcl-dev:mainfrom
vakaobr:vfs/agility-sdk-console-drive
Closed

vakaobr wants to merge 1 commit into
xcl-dev:mainfrom
vakaobr:vfs/agility-sdk-console-drive

Conversation

@vakaobr

@vakaobr vakaobr commented Nov 24, 2026 •

Copy link
Copy Markdown

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. Fixes #595.

What is in it

  • crates/xcl/src/gpu/agility.rs: sdk_files() and host_sdk_files(), the D3D12Core.dll the probe reads in each candidate directory (same candidates and order as init()).
  • crates/xcl/src/host.rs: registers each of those files as one of XCL's own paths before the hooks go in, the mechanism VFS: a console drive mount leaves the PC's own folders on that drive #49 and VFS: XCL's shader cache on a drive a console mount names stays where it is #331 use for the game folder, the data folder and the shader cache. 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 the VFS does not hook.
  • crates/xcl/src/vfs.rs: a test that registers what 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.

Tested

Regression run

@Anon64's pair, pasted unchanged from #1136 (comment): Windows 11, RTX 3060, release, a retail title for 60 s with XCL_NETWORK=0 and A pressed every 4 s from 20 s. 97 % of main's frames, 100 % of its peak commit, no device removals or crashes. Neither run had the Agility SDK on a console-mounted drive, so it shows the change leaves a normal run alone.

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1538 (PresentX 1538)
presents per 2 s (last 3): 57 25 10
device removals: 0
crashes: 0
peak commit: 24595 MB

this PR:

xcl-smoke v1
commit: 58160b66e5a2da17a34717a51aaf134665800f95
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1486 (PresentX 1486)
presents per 2 s (last 3): 28 6 5
device removals: 0
crashes: 0
peak commit: 24644 MB

Not tested

AI use

  • Claude Code with Claude Opus 4.6 found the cause and wrote the first version (own folders for the candidate directories); Claude Code with Claude Opus 5.5 narrowed it to the DLL files after finding that a drive-root exe directory would take the whole drive from the console mount, rewrote the test, and ran the tests and mutations above.

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)
@Anon64

Anon64 commented Nov 24, 2026 •

Copy link
Copy Markdown

Windows runs for this PR, since you have none: head 58160b6, based on main 47efa2e. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, Rust stable MSVC, release.

Tested

  • cargo test -p xcl --release --lib -- vfs::tests gpu::agility on 58160b6: 21 passed, 0 failed, 0 ignored.

Regression run (scripts/smoke.ps1 on a retail title, 60 s, XCL_NETWORK=0, A pressed every 4 s from 20 s)

main 47efa2e:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1538 (PresentX 1538)
presents per 2 s (last 3): 57 25 10
device removals: 0
crashes: 0
peak commit: 24595 MB

this PR:

xcl-smoke v1
commit: 58160b66e5a2da17a34717a51aaf134665800f95
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1486 (PresentX 1486)
presents per 2 s (last 3): 28 6 5
device removals: 0
crashes: 0
peak commit: 24644 MB

No device removals or crashes; 97 % of main's frames, 100 % of its peak commit.

Not tested: the whole suite; an Agility SDK in XCL_D3D12_DIR or the exe directory on a console-mounted drive.

Written with Claude Code (Claude Opus 5.5) from runs on this machine.

@DavidM1911

Copy link
Copy Markdown
Contributor

Independent verification on current main 384f7f7 (branch already contains it — clean).

Machine: Windows 11, Ryzen 9 7900X; Rust stable MSVC, debug.

AI use: test runs by Devin (Cognition, SWE-2); no code changes.

@Ekibunnel

Copy link
Copy Markdown

Tested
NVIDIA GeForce RTX 5080, driver 32.0.16.2101, 9800X3D, 64GB, Windows 10 22H2 (19045.7807), D3D12 Agility SDK (D3D12Core.dll 1.620.2.0), rustc 1.100.0 (0ef1bc386 2026-11-09), release

cargo test --workspace -- --test-threads=4 test result : ok. 699 passed; 0 failed; 21 ignored; 0 measured; 0 filtered out;

58160b6 with an Agility SDK on a console-mounted drive :

  • SET XCL_D3D12_DIR=S:\GTA6\XCL_INDEV\xcl_agility-sdk-console-drive\D3D12 :
    Working ✔ D3D12: Agility SDK v620 (S:\GTA6\XCL_INDEV\xcl_agility-sdk-console-drive\D3D12)

  • <xcl.exe dir>\D3D12 :
    Working ✔ D3D12: Agility SDK v620 (S:\GTA6\XCL_INDEV\xcl_agility-sdk-console-drive\target\release\D3D12)

  • <xcl.exe dir> :
    Working ✔ D3D12: Agility SDK v620 (S:\GTA6\XCL_INDEV\xcl_agility-sdk-console-drive\target\release)


All looking good to me, good job. 👍
Please merge.

@JoaoPauluu

Copy link
Copy Markdown

A run under Wine on Linux, with a retail title: the tests pass and the title runs as on main.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. 58160b6 as it is (based on 47efa2e) and main 47efa2e, no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact, 90 s cap).
  • vfs::tests and gpu::agility on 58160b6: 21 passed, 0 failed, 0 SKIPPED, the three a_console_drive_mount_leaves_… tests included.
  • Retail title 1.0.2.1, scripts/linux/smoke.sh (Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #257) for 60 s, no input, main first. No XCL_D3D12_DIR and no Agility SDK beside xcl.exe, so D3D12Core.dll is vkd3d-proton's and neither run logs an Agility SDK line: this is a regression check, not a check of the fix. called_stubs, imports_by_source and modules in report.json have the same entries in both runs (only per-frame call counts differ).

Regression run

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1351 (PresentX 1351)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

this PR:

xcl-smoke v1
commit: 58160b66e5a2da17a34717a51aaf134665800f95
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1351 (PresentX 1351)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

Under Wine, peak commit reads 0 MB, so these blocks do not check memory.

Not tested

  • an Agility SDK on a console-mounted drive under Wine; native Windows.

AI use

  • Claude Code (Claude Opus 5.5) built the commits, ran the tests and runs and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.

@throny

throny commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Two contributors checked independently and found that #1769 solves the same problem in a different way: #1607, group D62. 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.

@vakaobr

vakaobr commented Nov 25, 2026

Copy link
Copy Markdown
Author

Closing in favour of #1769, as the #1607 hint suggested: it fixes the same lookup (the Agility SDK on a drive a console mount names) and also covers the DXC folder and xcl.exe's folder, with the same drive-root guard. My test report is on #1769, including the one case this PR covered that it doesn't (%LOCALAPPDATA%\XCL\D3D12 on a mounted drive). Thanks to everyone who tested this one.

@vakaobr vakaobr closed this Nov 25, 2026
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.

xcl do not use provided D3D12Core.dll, VSH issue

6 participants