file_system: list T: scratch from the overlay with no game dir (FS-COLLECT-SCRATCH) #929

Closed
github-bot wants to merge 4 commits from gh-pr/929/head into gh-pr/929/base
Owner

@⁠morodirule on GitHub · 2026-11-24 15:15 UTC · original
fix/fs-collect-scratch → main · +74 −2 · 3 files · 4 commits · closed without merging

Claimed in the coordination issue as: FS-COLLECT-SCRATCH

Depends on: #903 (the test binary needs the MinGW SEH guard to link).

Carries abnalstlll-byte's finding: collect() failed T: scratch listings with ERROR_PATH_NOT_FOUND when --game-dir was unset (gated on r.game.empty()), and probed the package root on every T: listing. Scratch targets (parts starting at .gta6rt-temp) now gate on r.overlay.empty() instead and skip add_root(r.game).

Tests: built file_system_test with x86_64-w64-mingw32-g++ and ran it under Wine 11.22 on Linux: 496 checks, 11 failures — the identical failure set as the pre-change baseline binary (494 checks, same 11: MAXIMUM_ALLOWED opens, long-path markers, host ReadFile page-commit semantics — all Wine-environment behavior, none touched by this change). The 2 new regression checks pass:

  • without a game folder FindFirstFileW(T:*) still lists the scratch root as . and ..
  • listing T: creates the scratch folder in the overlay
    check_no_game_data.py PASS. No game files (synthetic overlay dirs), no GPU. MSVC compile not available on this machine.

AI-assisted.

**@⁠morodirule** on GitHub · 2026-11-24 15:15 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/929) `fix/fs-collect-scratch` → `main` · +74 −2 · 3 files · 4 commits · closed without merging Claimed in the coordination issue as: FS-COLLECT-SCRATCH Depends on: #903 (the test binary needs the MinGW SEH guard to link). Carries abnalstlll-byte's finding: collect() failed T: scratch listings with ERROR_PATH_NOT_FOUND when --game-dir was unset (gated on r.game.empty()), and probed the package root on every T: listing. Scratch targets (parts starting at .gta6rt-temp) now gate on r.overlay.empty() instead and skip add_root(r.game). Tests: built file_system_test with x86_64-w64-mingw32-g++ and ran it under Wine 11.22 on Linux: 496 checks, 11 failures — the identical failure set as the pre-change baseline binary (494 checks, same 11: MAXIMUM_ALLOWED opens, long-path markers, host ReadFile page-commit semantics — all Wine-environment behavior, none touched by this change). The 2 new regression checks pass: - without a game folder FindFirstFileW(T:\*) still lists the scratch root as . and .. - listing T: creates the scratch folder in the overlay check_no_game_data.py PASS. No game files (synthetic overlay dirs), no GPU. MSVC compile not available on this machine. AI-assisted.
file_system touch_pages plus dstorage guarded_move and touch_pages used MSVC __try/__except unguarded, so MinGW stops at the first __except. Non-MSVC builds now probe pages with VirtualQuery instead (same startup_trace.h convention); guarded_move pre-validates source readability and destination writability to keep its false-on-inaccessible contract.
The VirtualQuery fallback rejected PAGE_GUARD outright, but the MSVC
__except filter catches only EXCEPTION_ACCESS_VIOLATION, so a guard-page
touch propagates to vectored handlers there. dstorage_test's hold_on_guard
VEH depends on the copy reaching the guard page; rejecting it turned the
held copy into E_DSTORAGE_ACCESS_VIOLATION (2 extra dstorage_test failures
vs the clang-cl build under Wine: 4/329 instead of 2/329).

Verified with a MinGW build of dstorage_test under Wine 11.22 on Linux:
before 4 failures (guard hold + pending + held copy + moved bytes), after
2 failures (guard hold + pending only), matching the clang-cl baseline.
The remaining two are a Wine artifact: the guard touch completes without
dispatching the VEH in the full test binary under Wine, for both
toolchains.
Depends on: #903

collect() gated every listing on r.game and probed the package root on T: listings, although the scratch folder lives in the overlay only. Scratch targets now gate on r.overlay and skip the package probe. Regression test configures an empty game dir and lists T:. file_system_test under Wine: 496 checks, 11 failures, identical to the pre-change baseline (494 checks, same 11 Wine-environment failures); the 2 new checks pass.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:28:48 +00:00
github-bot closed this pull request 2026-11-26 09:28:48 +00:00

Pull request closed

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