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

Closed
github-bot wants to merge 1 commit from gh-pr/1136/head into gh-pr/1136/base
Owner

@⁠vakaobr on GitHub · 2026-11-24 12:20 UTC · original
vakaobr:vfs/agility-sdk-console-drive → main · +69 −2 · 3 files · 1 commits · closed without merging

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 #49 and #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

  • MacBook Pro M5 Pro, macOS 27.2.1, CrossOver 26.3.0.39832 (Wine), Rust 1.100.0, x86_64-pc-windows-gnu, debug. Head 58160b6.
  • vfs::tests: 13 passed, 0 failed. gpu::agility: 8 passed, 0 failed.
  • Mutations: registering the candidate directories instead of the files fails the new test at the drive-root check (left: Pass, right: Game { rel: "hunter\\data.bin" }); registering nothing fails it too.
  • Independent runs: the reporter, @⁠Ekibunnel, confirmed on Windows 10 (RTX 5080) that the Agility SDK now loads from a console-mounted S: drive in all three places, XCL_D3D12_DIR, <exe dir>\D3D12 and <exe dir>, with cargo test --workspace at 699 passed, 0 failed (https://github.com/ivall/xcl/pull/1136#issuecomment-7132443864); vfs::tests and gpu::agility pass on Windows (@⁠Anon64, RTX 3060, release, 21 passed, https://github.com/ivall/xcl/pull/1136#issuecomment-7131597132; @⁠DavidM1911, vfs 23 passed, https://github.com/ivall/xcl/pull/1136#issuecomment-7132175903).

Regression run

@⁠Anon64's pair, pasted unchanged from https://github.com/ivall/xcl/pull/1136#issuecomment-7131597132: 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

  • Windows by me (I have no Windows machine); see the independent runs above.
  • #833 does the same for DXC with with_host_io; the two touch different files and should not conflict.

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.
**@⁠vakaobr** on GitHub · 2026-11-24 12:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/1136) `vakaobr:vfs/agility-sdk-console-drive` → `main` · +69 −2 · 3 files · 1 commits · closed without merging 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 #49 and #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** - MacBook Pro M5 Pro, macOS 27.2.1, CrossOver 26.3.0.39832 (Wine), Rust 1.100.0, `x86_64-pc-windows-gnu`, debug. Head `58160b6`. - `vfs::tests`: 13 passed, 0 failed. `gpu::agility`: 8 passed, 0 failed. - Mutations: registering the candidate directories instead of the files fails the new test at the drive-root check (`left: Pass, right: Game { rel: "hunter\\data.bin" }`); registering nothing fails it too. - Independent runs: the reporter, @⁠Ekibunnel, confirmed on Windows 10 (RTX 5080) that the Agility SDK now loads from a console-mounted `S:` drive in all three places, `XCL_D3D12_DIR`, `<exe dir>\D3D12` and `<exe dir>`, with `cargo test --workspace` at 699 passed, 0 failed (https://github.com/ivall/xcl/pull/1136#issuecomment-7132443864); `vfs::tests` and `gpu::agility` pass on Windows (@⁠Anon64, RTX 3060, release, 21 passed, https://github.com/ivall/xcl/pull/1136#issuecomment-7131597132; @⁠DavidM1911, `vfs` 23 passed, https://github.com/ivall/xcl/pull/1136#issuecomment-7132175903). **Regression run** @⁠Anon64's pair, pasted unchanged from https://github.com/ivall/xcl/pull/1136#issuecomment-7131597132: 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** - Windows by me (I have no Windows machine); see the independent runs above. - #833 does the same for DXC with `with_host_io`; the two touch different files and should not conflict. **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 #49 and #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 #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)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:44:39 +00:00
github-bot closed this pull request 2026-11-26 04:44:39 +00:00
Author
Owner

@⁠Anon64 on GitHub · 2026-11-24 12:33 UTC · original

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.

**@⁠Anon64** on GitHub · 2026-11-24 12:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/1136#issuecomment-7131597132) 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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 12:58 UTC · original

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

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

  • cargo test -p xcl --lib vfs: 23 passed, 0 failed — the D3D12Core-on-console-drive change is covered by the VFS suite (note: truncate_existing_validation_errors now passes on this base since #1016 landed).

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

**@⁠DavidM1911** on GitHub · 2026-11-24 12:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/1136#issuecomment-7132175903) Independent verification on current `main` `384f7f7` (branch already contains it — clean). **Machine:** Windows 11, Ryzen 9 7900X; Rust stable MSVC, debug. - `cargo test -p xcl --lib vfs`: **23 passed, 0 failed** — the D3D12Core-on-console-drive change is covered by the VFS suite (note: `truncate_existing_validation_errors` now passes on this base since #1016 landed). AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Author
Owner

@⁠Ekibunnel on GitHub · 2026-11-24 13:10 UTC · original

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;

58160b66e5 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.

**@⁠Ekibunnel** on GitHub · 2026-11-24 13:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/1136#issuecomment-7132443864) **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;` 58160b66e5a2da17a34717a51aaf134665800f95 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.
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-24 13:33 UTC · original

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 #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 (#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.
**@⁠JoaoPauluu** on GitHub · 2026-11-24 13:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/1136#issuecomment-7132990133) 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 #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` (#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.
Author
Owner

@⁠throny on GitHub · 2026-11-24 22:59 UTC · original

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.

**@⁠throny** on GitHub · 2026-11-24 22:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/1136#issuecomment-7146876302) <!-- xcl-1607-hint:D62 --> 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.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-25 09:38 UTC · original

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** on GitHub · 2026-11-25 09:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/1136#issuecomment-7158604899) 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.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.