Skip to content

file_system: G:\ is the package and T:\ a scratch folder (RT-218) - #3511

Closed
undeadhuman37 wants to merge 1 commit into
ItsNotRexed:mainfrom
undeadhuman37:rt-218-g-t-drives
Closed

undeadhuman37 wants to merge 1 commit into
ItsNotRexed:mainfrom
undeadhuman37:rt-218-g-t-drives

Conversation

@undeadhuman37

Copy link
Copy Markdown
Contributor

Item: RT-218 (claim: #3381 (comment)), from @kotorvr's finding in #3232.

Only GAME: was a console path (runtime/shims/file_system.cpp:95), so a title's G:\x or T:\x went to the host's real drives: with a host G: present it opened the wrong file and a write landed outside the overlay; without one every open failed.

  • G:\ (either separator, any case) maps exactly like GAME:: reads prefer the overlay, writes go to the overlay, the package stays read-only.
  • T:\ is <overlay>\.gta6rt-temp, a writable scratch folder that holds no package files: it is both its own "package" and overlay, so nothing is copied up and no deletion markers are written. GAME:\ does not list it.
  • A G:/T: path inside the host's own game or overlay folder (a --game-dir on drive G:, or a path the title got back from GetModuleFileName) stays a host path, as both drives do before configure(). The drive-relative G:x is always a host path.
  • A move between T:\ and G:\/GAME:\ fails with ERROR_NOT_SAME_DEVICE; .. and drive components are refused as for GAME:.

Which form GTA VI itself uses is still open until the executable is read (the package's DLLs name neither); that's noted in docs/runtime_imports.md.

Tested on Windows 11 (26200), MSVC 14.44, RTX 4070 SUPER (no GPU needed for these):

  • file_system_test: 148/148, 16 new checks; with main's file_system.cpp, 10 of them fail
  • ctest --test-dir runtime/build: 50/50 passed (5 skipped for missing game files, as on main)

No game files. AI-assisted.

🤖 Generated with Claude Code

Only GAME: was a console path, so a title's G:\x or T:\x went to the
host's real drives: with a host G: present it opened the wrong file and a
write landed outside the overlay. Five other Xbox Series layers map G:\
to the package and four map T:\ to scratch (@kotorvr's comparison in
ItsNotRexed#3232).

- G:\ (either separator, any case) maps exactly like GAME:.
- T:\ is <overlay>\.gta6rt-temp: one folder that is both its "package" and
  its overlay, so it has no package files, never copies up and never
  writes deletion markers. GAME:\ does not list it.
- A G:/T: path inside the host's own game or overlay folder (a --game-dir
  on drive G:) stays a host path, as both drives do before configure();
  the drive-relative G:x is always a host path.
- A move between T:\ and G:\/GAME:\ is ERROR_NOT_SAME_DEVICE; .. and drive
  components are refused as for GAME:.

Which form GTA VI uses is still open until the executable is read; noted
in docs/runtime_imports.md.

Tests: file_system_test 148/148 (16 new checks; 10 of them fail on main),
ctest 50/50 passed (5 skipped for missing game files, as on main), on
Windows 11 with MSVC 14.44. No game files, no GPU.

AI-assisted.

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

Kam471 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Compared with my #3485 (now closed in favor of this). Your design is better: the dedicated <overlay>\.gta6rt-temp scratch folder, hidden from GAME:\, with no package fallback or deletion markers, and the host game/overlay-folder exclusion. I verified the #3485 behavior on Windows with a 169-check suite (red-before: 26 failures on main, including a subst G: decoy). If you want extra coverage, #3485 had tests for G:\ root listing/attributes, case and forward-slash variants, CopyFileW both ways, CreateDirectory/RemoveDirectory, SetFileAttributes, and a drive-relative G:x host path. No action needed from you; the implementation here is the one to review.

@Kam471

Kam471 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 5f61a05b on Windows 11 with MSVC 19.44.35228 (cl 14.44.35207) + Ninja, RelWithDebInfo.

  • file_system_test.exe -> 148 check(s), 0 failure(s), exit 0.
  • ctest -R file_system --output-on-failure -> 1/1 passed, 0.11 s.

Private build dir; runtime/build untouched. Synthetic package/overlay trees only; no game files. This is the RT-218 fix I compared against my closed #3485, and it passes on this host.

@zzEmmazz

Copy link
Copy Markdown
Contributor

Tested 5f61a05b, applied alone on main f847748c: pass.
Windows 11 (26200), MSVC 14.50 (VS 2026), Ninja RelWithDebInfo. CPU only.

  • Test change only, on main's file_system.cpp: file_system_test gives 148 check(s), 10 failure(s); the first is FAIL G:\ reads a package file, like GAME:, the rest are the other G:\ and T:\ checks (write to the overlay, scratch folder read, list, delete, cross-volume move, ..). Same numbers as the description.
  • Whole PR: file_system_test gives 148 check(s), 0 failure(s).
  • ctest -R "^(file_system|run_tiny.*|loader)$" with gta6rt rebuilt: 11/11 passed.
  • Docs: test_docs_links, test_docs_repo_paths, test_docs_list_items, test_docs_design_rows pass with the PR's docs/runtime_imports.md.
  • Together with file_system: a MAXIMUM_ALLOWED open is a write-open, so it cannot write the package (RT-229) #3602 (0977b5dc), which edits the same two files: both diffs apply to f847748c one after the other without conflict, and file_system_test built from the two gives 156 check(s), 0 failure(s).
  • This PC has no host G: or T: drive, so the tests ran in the "no such host drive" situation only.

Not checked: a PC that has a real G: or T: drive (the --game-dir on G: case is covered only by what the test simulates); a run with LEONIDA_GAME_DIR set; the rest of ctest.

@Dom-in

Dom-in commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Windows + GPU check: AMD Radeon RX 9070 (RDNA4), Windows 11, MSVC Release, Vulkan SDK 1.4.363. Tested head 5f61a05 merged onto main f847748 (clean merge), full build, full ctest -C Release -j 4: 100% tests passed out of 132 | new failures vs main: none. The main baseline on the same machine passes 132/132.

AI-assisted (Claude Code); runs on my machine.

@traeb0n

traeb0n commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 5f61a05 (on its base main f847748) on NVIDIA GeForce RTX 5070, driver 621.01, Windows 11 Pro (26300), MSVC 14.44 (VS 2022 Build Tools, Ninja, RelWithDebInfo), Vulkan SDK 1.4.363, LEONIDA_VK_VALIDATION=1: pass.

  • Build: exit 0.
  • ctest -E loader -j 4: 128/128 passed, as on main f847748 here.
  • file_system: passed.

AI-assisted (Claude Code).

@Kam471

Kam471 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Heads-up: main now contains RT-218 as part of 4c52ce27 ("Seven fixes ..."), with the same design this PR implements: G:\ is the package, T:\ maps to <overlay>\.gta6rt-temp, internal_dir() hides the scratch folder, paths under the configured game/overlay folders stay host paths, and the file_system_test blocks were merged. git grep kScratchDir HEAD -- runtime/shims/file_system.cpp shows it. Unless there is a case here that the main version misses, this PR can be closed as already applied; I verified the main version on the current tree.

@FaKL-Code

Copy link
Copy Markdown
Contributor

Tested 5f61a05 (merged onto main f847748) on NVIDIA GeForce RTX 4060 Ti, driver 610.88 (32.0.16.1088), Windows 11 26200, MSVC 14.51.36231 (VS 2026), Vulkan SDK 1.4.363.0: pass

  • Merges cleanly; no new compiler warnings against main.
  • ctest: 131 of 131 pass (same 8 skips as main). Loader test passes; validation run: 52 tests clean (2 skipped, as on main).
  • file_system -V: "148 check(s), 0 failure(s)", including the new G:\/T:\ checks (scratch folder, cross-volume move refused, .. refused, a path inside a game folder on drive G: stays a host path).
  • Same test against main's file_system.cpp (only that file swapped, then rebuilt): "148 check(s), 10 failure(s)", the 10 new G:/T: checks. That matches the PR body.
  • RT-218 is already on main: 4c52ce2 ("Seven fixes from an outside contributor") applied it, "G:\ names the package and T:\ a scratch folder in the overlay". So this branch now conflicts with current main (aa2988c) in docs/runtime_imports.md, file_system.cpp and file_system_test.cpp, and file_system: a folder has to exist in the title's view; same-name moves succeed (RT-233) #3651 and file_system: serve the file shims under the three other API sets a title imports them by #3683 have since rebased onto that commit. This PR is probably only needed if something here didn't make it into 4c52ce2; I haven't diffed the two line by line.

AI-assisted (Claude).

@memorypressure

Copy link
Copy Markdown

This looks superseded: main's 4c52ce2 landed the same RT-218 fix (G:\ as the package, T:\ as .gta6rt-temp, host-folder paths staying host paths) with its own file_system tests, including the cross-volume move refusal and the T:.. escape case — all present on current main (verified). The head now conflicts structurally with that refactor (console_drive()/internal_dir() helpers in file_system.cpp, its test file, and the docs table), so a rebase would mostly delete this PR's implementation. Closing in favour of the main commit seems right; thanks for the patch — it is effectively what main shipped. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

@undeadhuman37

Copy link
Copy Markdown
Contributor Author

Closing as superseded: main's 4c52ce2 landed the same RT-218 design (G:\ package, T:\ scratch under the overlay, internal_dir()) with its own file_system tests. Thanks Kam471 and memorypressure for checking.

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.

7 participants