VFS: fail FindFirstFile on a mount root like a native drive root (#577) #756
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/761"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T04:49:13Z.
FindFirstFile("G:\\")on a mount root returned the host's overlay and game folders as directory entries. ForG:\the relative path is empty, socollect_game_entriessearched the bare folder paths and listed the folders themselves. A native drive root has no entry of its own:FindFirstFileExW("C:\\")fails withERROR_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-treeshows no conflicts with either head.What is in it
crates/xcl/src/vfs_hooks.rs:collect_game_entriesreturnsERROR_FILE_NOT_FOUNDfor an empty relative path.crates/xcl/src/vfs_hooks.rs: testfind_first_on_mount_root_matches_native_drive_root. It calls nativeFindFirstFileExWon the host drive root of the temp fixture to get the reference error code. It then checks thatG:\gives the same code and thatG:\*still listsdata. The test uses synthetic temp folders and no game files.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4onea6fcab: 702 passed, 0 failed, 41 ignoredgpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64)main(64b3f35) without the fix (left: None, right: Some(2)) and passes with it. Its native reference assertion passed on this machine, so Win32 returnsERROR_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:
PR:
Not tested
FindFirstFile("D:\\Games\\Title"), no wildcard) also classifies as the empty relative path. It now fails withERROR_FILE_NOT_FOUND, but native Win32 would return one entry for the folder. Titles reach the game folder throughG:\, so this PR follows the console-root semantics. Not checked whether any title searches the host folder this way.mainand on this branch,vfs::tests::truncate_existing_validation_errorsfails when run alone (cargo test -p xcl --lib truncate_existing_validation_errors:left: 127, right: 5atvfs.rs:970). It passes in the full run: the firstunder_wine()call (GetProcAddressofwine_get_version) setsERROR_PROC_NOT_FOUND(127) betweenCreateFileWandGetLastError, and in the full run an earlier test has already cached it. #633 fixes it; this PR does not change it.AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by milas6669 on 2026-11-24T05:03:34Z.
Test report on
ea6fcabc06552e3292d576f912d0bdbf5095a075(PR head, basemain64b3f35, no merge needed).Tested
x86_64-pc-windows-msvc, debugcargo 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 onmain64b3f35: 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.rel.is_empty()check incollect_game_entriesremoved, it fails withleft: None, right: Some(2).Not tested
cargo test --workspace(not run on this machine for this report)scripts/smoke.ps1: I did not run a regression run of this PRAI use
Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T05:08:42Z.
Test run of
ea6fcabc06552e3292d576f912d0bdbf5095a075on AMD RDNA4. I merged it onto currentmaind5442d2locally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 705 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 664 passed, 0 failed, 21 ignoredSKIPPED;find_first_on_mount_root_matches_native_drive_rootpasses.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 ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-24T05:12:46Z.
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:
xcl-smokerequirement, and @ryosen0 ran both blocks natively within nine minutes (full suite on the head: 702 passed; main vs head, same title/90 s, bothexit: 0x0, 0 removals, 0 crashes) — see #763. Ask them for the pair on your headea6fcabcand your description check goes green the same way.FindFirstFileExW("C:\\")comparison is satisfied by Wine's drive-root behavior, which means the Linux cross-build harness (#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.Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T05:18:40Z.
Thanks @pickles976, both useful. @ryosen0, if you have time, could you run the
xcl-smokepair for this PR the way you did for #763:mainand headea6fcabc06552e3292d576f912d0bdbf5095a075, 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!Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T05:30:56Z.
Test report: #761 under Wine (Linux)
The new test compares XCL with the host's
FindFirstFileExWon a drive root. Under Wine that host is Wine'skernel32, and it answers the same as Windows: the test passes, as do the other VFS tests.Setup
experimental-11.0-20261112(wine-11.0)x86_64-pc-windows-gnu(mingw-w64-gcc 16.2.0, GNU ld), debug build of this PR's headea6fcabResults (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'sFindFirstFileExWon the fixture's drive root fails withERROR_FILE_NOT_FOUND, as the test expects from Windows. The fixture lives in the temp folder, which in a Wine prefix is underC:\; I didn't print which root it used.vfs: 21 passed, 0 failed, 0 ignoredNot tested
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.
Imported from ivall/xcl. Originally posted by eizispark on 2026-11-24T05:32:22Z.
Hardware check of
ea6fcabc06552e3292d576f912d0bdbf5095a075(verified clean merge withmaine50836b): pass.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profilecargo 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(includingfind_first_on_mount_root_matches_native_drive_root)Regression run
main(f4ce27c):PR (
ea6fcab):Not tested
AI use
scripts/smoke.ps1harness on this machine and formatted this report.Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T05:34:04Z.
Thanks @eizispark: both blocks are now in Regression run, credited. Thanks also to everyone who ran the tests (@milas6669, @JoaoPauluu, @MesshM).
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:57:28Z.
Empirical test report (
ea6fcabc)Verified PR #761 at
ea6fcabc06552e3292d576f912d0bdbf5095a075in a clean detached checkout.Hardware / environment
AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD.1.100.0 (0ef1bc386 2026-11-09), stable MSVC toolchain. DXC1.9.2609.5 (01b62ad47).Invoke-ArcTest.ps1. The focused test usedXCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1.Commands and results
cargo test --workspace --no-runexited 0 and built the workspace test executables in 1m 06s.cargo test -p xcl --lib vfs_hooks::tests::find_first_on_mount_root_matches_native_drive_root -- --nocaptureexited 0. The captured result was 1 passed, 0 failed, 0 ignored, and 681 filtered out. The log contained 0SKIPPEDlines.Observed behavior
FindFirstFileExWon the fixture drive root returned an invalid handle withERROR_FILE_NOT_FOUND. ClassifyingG:\and collecting its VFS entries yielded the same error.G:\*) still returned the fixture’sdatadirectory. The test exercised filesystem enumeration and VFS logic on the CPU.Not tested
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr761-focused.logand published.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T11:16:12Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:41:33Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-30T02:49:06Z.
merge-check
base:
cb8024684chead:
ea6fcabc06merge: clean
build: cargo build --workspace -> ok (also
cargo build --release -p xcl)tests: cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4 -> 2810 passed, 1 failed, 51 ignored; SKIPPED: 27 lines (22
no wave64, 3 f16/f32 per-lane cases refused, 2no heap windows), the same as on the base; failing:hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, which fails the same way on the base (it came in with #2369; #3474 fixes it). Base alone on this PC: 2809 passed, 1 failed, 51 ignored.review: whole diff read (+31/-0,
vfs_hooks.rs).collect_game_entriesnow returnsERROR_FILE_NOT_FOUNDfor an empty relative path, soFindFirstFileon the bare mount root fails as it does on a native drive root. The return comes before any overlay or game-folder lookup and it is on a read path only. The new test asks the realFindFirstFileExWfor the host drive root and requires the same answer, and also checks thatG:\*still lists. Still needed on currentmain: the function around the hunk is unchanged. #763 had the same guard and was closed as a duplicate of this. Not covered by the test: the other spellings of the root (G:without the slash,\?\), which go throughclassifyand are not changed here.performance: none: one comparison on the enumeration path. Measured with
scripts/smoke.ps1, 60 s of a retail title, release: 1688 frames and 15600 MB peak commit against 1662 and 1684 frames, 16196 and 15752 MB on the base. No device removal, no crash. Whether that title ever enumerates the mount root I did not check.verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB (617.42, wave32), Ryzen 7 9800X3D, 32 GB, Windows 11 26300, rustc 1.100.0 / Claude Code (Claude Fable 5.2 ran the build, suite and smoke and wrote this; Claude Opus 5.5 read the diff first, and I checked its main points in the merged source)
Imported from ivall/xcl. Originally posted by relativespace2K on 2026-11-30T02:58:27Z.
merge-check
base:
53e85fb1head:
ea6fcabc06merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2789 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in
--test gpu_two_pass_cache_e2e, so 5 failing tests give 6 failures). The same five fail on base53e85fb1alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its new test passed. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused.review: no blocking finding; one file, every hunk read. The change is a single early return:
collect_game_entrieswith an empty relative path is a find on the mount root, which has no entry of its own, and it now fails withERROR_FILE_NOT_FOUNDwhere before it fell through to enumerating and returned something. The test does the two things that matter: it asks the hostFindFirstFileExWfor the same shape (C:\) and asserts the native answer really isERROR_FILE_NOT_FOUNDon this machine, then asserts the hook gives the same, and separately keeps*on the root enumerating (datais in the result), so the wildcard case is not caught by the new return. That also matches #577, where a title checks that a mount root behaves like a drive root. No duplicate: #1264 and #316 are the otherFindFirstFilefixes and neither touches the empty-root case.performance: none: one string check before the enumeration.
verdict: safe to merge
hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.
Imported from ivall/xcl. Originally posted by sandivd on 2026-11-30T02:59:05Z.
merge-check claim
head:
ea6fcabc06