Skip to content

VFS: fail FindFirstFile on a mount root like a native drive root (#577) - #761

Open
upipibi wants to merge 1 commit into
xcl-dev:mainfrom
upipibi:fix/577-mount-root
Open

upipibi wants to merge 1 commit into
xcl-dev:mainfrom
upipibi:fix/577-mount-root

Conversation

@upipibi

@upipibi upipibi commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

FindFirstFile("G:\\") on a mount root returned the host's overlay and game folders as directory entries. For G:\ the relative path is empty, so collect_game_entries searched the bare folder paths and listed the folders themselves. A native drive root has no entry of its own: FindFirstFileExW("C:\\") fails with ERROR_FILE_NOT_FOUND. The mount root now fails the same way. G:\* is unchanged.

Part of #577 (item 3). Items 1 and 2 are #644 and #618. This PR touches neither path, and git merge-tree shows no conflicts with either head.

What is in it

  • crates/xcl/src/vfs_hooks.rs: collect_game_entries returns ERROR_FILE_NOT_FOUND for an empty relative path.
  • crates/xcl/src/vfs_hooks.rs: test find_first_on_mount_root_matches_native_drive_root. It calls native FindFirstFileExW on the host drive root of the temp fixture to get the reference error code. It then checks that G:\ gives the same code and that G:\* still lists data. The test uses synthetic temp folders and no game files.

Tested

  • NVIDIA GeForce RTX 3070, driver 616.56, AMD Ryzen 9 5950X, Windows 11 Pro 26100, rustc 1.100.0, debug
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on ea6fcab: 702 passed, 0 failed, 41 ignored
  • SKIPPED GPU tests: gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64)
  • The new test fails on main (64b3f35) without the fix (left: None, right: Some(2)) and passes with it. Its native reference assertion passed on this machine, so Win32 returns ERROR_FILE_NOT_FOUND (2) for a drive root.

Regression run
Run by @eizispark on an AMD Radeon RX 9070 XT (posted in this PR's comments; we have no retail title here).

main:

xcl-smoke v1
commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1667 (PresentX 1667)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14847 MB

PR:

xcl-smoke v1
commit: ea6fcabc06552e3292d576f912d0bdbf5095a075
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1663 (PresentX 1663)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14858 MB

Not tested

  • Retail titles on NVIDIA / wave32 (the smoke run above is AMD RDNA4), and gameplay past the menus.
  • A host path to the game folder itself (for example FindFirstFile("D:\\Games\\Title"), no wildcard) also classifies as the empty relative path. It now fails with ERROR_FILE_NOT_FOUND, but native Win32 would return one entry for the folder. Titles reach the game folder through G:\, so this PR follows the console-root semantics. Not checked whether any title searches the host folder this way.
  • On main and on this branch, vfs::tests::truncate_existing_validation_errors fails when run alone (cargo test -p xcl --lib truncate_existing_validation_errors: left: 127, right: 5 at vfs.rs:970). It passes in the full run: the first under_wine() call (GetProcAddress of wine_get_version) sets ERROR_PROC_NOT_FOUND (127) between CreateFileW and GetLastError, and in the full run an earlier test has already cached it. Tests: capture the truncate error before checking for Wine #633 fixes it; this PR does not change it.

AI use

  • AI-assisted (Claude Code, Claude Opus 5.5): wrote the fix, the test and this description, and ran the tests above.

🤖 Generated with Claude Code

…-dev#577)

For G:\ the relative path is empty, so collect_game_entries searched the
bare overlay and game folder paths and returned those folders as entries.
Native FindFirstFileExW on a drive root fails with ERROR_FILE_NOT_FOUND;
the new test checks that on the host drive and that the mount root now
does the same, while G:\* still lists the game folder's contents.

Item 3 of xcl-dev#577.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milas6669

Copy link
Copy Markdown
Contributor

Test report on ea6fcabc06552e3292d576f912d0bdbf5095a075 (PR head, base main 64b3f35, no merge needed).

Tested

  • Intel i9-10900KF, Windows 11 Pro 10.0.26200, rustc 1.100.0 x86_64-pc-windows-msvc, debug
  • cargo test -p xcl --lib -- --test-threads=2 --skip gpu:: --skip d3d12x --skip vram (the CPU-only part of the lib tests; the GPU was busy): 278 passed, 0 failed, 2 ignored. The same command on main 64b3f35: 277 passed, 0 failed, 2 ignored, so the only difference is the new test, find_first_on_mount_root_matches_native_drive_root, which passes.
  • The new test fails without the fix: with the four-line rel.is_empty() check in collect_game_entries removed, it fails with left: None, right: Some(2).

Not tested

  • the GPU tests, the e2e tests and cargo test --workspace (not run on this machine for this report)
  • scripts/smoke.ps1: I did not run a regression run of this PR
  • wave64 / AMD hardware

AI use

  • Claude Code, Claude Sonnet 5.5, ran the commands and wrote this report. I did not review the diff beyond reading it.

@MesshM

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

Test run of ea6fcabc06552e3292d576f912d0bdbf5095a075 on AMD RDNA4. I merged it onto current main d5442d2 locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200 (native Windows), Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 705 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 664 passed, 0 failed, 21 ignored
  • 0 SKIPPED; find_first_on_mount_root_matches_native_drive_root passes.

Review: Duplicate of #763 (open), same three-line fix; this one's test is the stronger of the two, since it checks against what a native drive root actually returns. Only one should land. The fix itself is right.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

@pickles976

Copy link
Copy Markdown

You landed three minutes ahead of my #763 (now closed as duplicate — same guard; your live-native comparison is the better test). Two things worth carrying to your PR:

  1. A smoke partnership exists. VFS: a search on the bare mount root lists no entries #763's description was red on exactly the same xcl-smoke requirement, and @ryosen0 ran both blocks natively within nine minutes (full suite on the head: 702 passed; main vs head, same title/90 s, both exit: 0x0, 0 removals, 0 crashes) — see VFS: a search on the bare mount root lists no entries #763. Ask them for the pair on your head ea6fcabc and your description check goes green the same way.
  2. Your test runs under Wine too, not just real Windows — the live FindFirstFileExW("C:\\") comparison is satisfied by Wine's drive-root behavior, which means the Linux cross-build harness (How about linux? #520) can run your test natively to CI parity. Verified: the sibling test on the closed duplicate passed here under Wine 9, and the smoke partner's 9800X3D box ran it on Windows as well.

@upipibi

upipibi commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @pickles976, both useful. @ryosen0, if you have time, could you run the xcl-smoke pair for this PR the way you did for #763: main and head ea6fcabc06552e3292d576f912d0bdbf5095a075, same title and duration? I'll copy both blocks into Regression run with credit. We have no retail title here, so the description check can't go green without them. Thanks!

@JoaoPauluu

Copy link
Copy Markdown

Test report: #761 under Wine (Linux)

The new test compares XCL with the host's FindFirstFileExW on a drive root. Under Wine that host is Wine's kernel32, and it answers the same as Windows: the test passes, as do the other VFS tests.

Setup

  • CachyOS, kernel 7.3.3-1-cachyos, Intel i5-10400F, 16 GB RAM, NVIDIA GeForce RTX 3060 12 GB, driver 620.70.06
  • Proton Experimental experimental-11.0-20261112 (wine-11.0)
  • Rust 1.100.0, x86_64-pc-windows-gnu (mingw-w64-gcc 16.2.0, GNU ld), debug build of this PR's head ea6fcab

Results (lib test binary under Wine, --test-threads=1)

  • vfs_hooks::tests::find_first_on_mount_root_matches_native_drive_root: ok, in 2 of 2 runs. So Wine's FindFirstFileExW on the fixture's drive root fails with ERROR_FILE_NOT_FOUND, as the test expects from Windows. The fixture lives in the temp folder, which in a Wine prefix is under C:\; I didn't print which root it used.
  • Filter vfs: 21 passed, 0 failed, 0 ignored

Not tested

  • Windows (covered by the other reports), llvm-mingw / MSVC builds, the rest of the suite, a title run

AI use: Claude Code (Claude Opus 5.5) built the tests, ran them on the machine above and wrote this report. The counts are pasted from those runs. The account owner asked for test reports to be posted while they were away and has not reviewed this one.

@eizispark

Copy link
Copy Markdown

Hardware check of ea6fcabc06552e3292d576f912d0bdbf5095a075 (verified clean merge with main e50836b): pass.

Tested

  • Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profile
  • cargo test --workspace -- --test-threads=4: 702 passed, 0 failed, 41 ignored (GPU tests skipped on this adapter: none)
  • cargo test -p xcl --lib vfs_hooks: 11 passed, 0 failed (including find_first_on_mount_root_matches_native_drive_root)

Regression run
main (f4ce27c):

xcl-smoke v1
commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1667 (PresentX 1667)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14847 MB

PR (ea6fcab):

xcl-smoke v1
commit: ea6fcabc06552e3292d576f912d0bdbf5095a075
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1663 (PresentX 1663)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14858 MB

Not tested

  • wave32-only GPUs (NVIDIA / Intel); gameplay past the menus

AI use

  • Antigravity (Gemini 4 Carbon) ran the build, test suite, and scripts/smoke.ps1 harness on this machine and formatted this report.

@upipibi

upipibi commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @eizispark: both blocks are now in Regression run, credited. Thanks also to everyone who ran the tests (@milas6669, @JoaoPauluu, @MesshM).

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.

6 participants