Repository navigation
OLD-8161: restore old upstream PR 8161 - file_system: T: is a folder of each process's own in the overlay - #684
Merged
Conversation
T:\ mapped to <overlay>\.gta6rt-temp, one folder shared by every run and kept between runs. The title makes its crash dump and crash log there with CREATE_NEW, and a name an earlier run (or a second process) had left failed with ERROR_FILE_EXISTS (80), so no report landed (old upstream issue 7913, measured by Spacecer2 under Wine 11.22). T:\ now names <overlay>\.gta6rt-temp\<YYYYMMDD-HHMMSS-mmm>-pid<id>, the process's start time in UTC and its id, made on the first T: call. The start time keeps a reused process id (Wine hands each fresh prefix the same small ids) out of an old run's folder. T:\.. cannot climb into the shared folder, T:\ itself still cannot be removed or moved, and earlier runs' folders are kept so their crash files can be read. GAME: and G: are unchanged. rt::fs::scratch_dir() returns the folder, and the startup line names it: "console paths: GAME: -> ..., writes -> ..., T: -> ...". The two CMake checks of that line (run_tiny_game_console_paths, run_tiny_game_dir) and the synthetic test of the first now expect the T: part. file_system_test: a CREATE_NEW of a name earlier runs left in .gta6rt-temp succeeds and lands in the process's own folder; the folder is stable for the process; a second process (the test started again) creating the same name on the same overlay succeeds in a folder of its own; GAME: reads and writes are unchanged. On main these fail with ERROR_FILE_EXISTS (80), in this process and in the second one. Restored from old upstream PR 8161 and ported onto the new main: the folder is made through main's win32_io_path, so long overlay roots keep working, and the scratch-folder check of the write-open path is kept. Main's long-overlay T: check now finds scratch.bin in the process's own folder below .gta6rt-temp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… one Xiiano's review of old upstream PR 8161: the folder name (start time to the millisecond plus process id) is not guaranteed unique, and earlier runs' folders are kept, so a reused id in the same millisecond would land in a stale folder and bring ERROR_FILE_EXISTS back. Under Wine every fresh run gets the same small ids (both run_tiny_game_dir runs here were pid 32). rt::fs::reserve_unique_dir(base, stem) makes base\stem with CreateDirectoryW and takes success as ownership; on ERROR_ALREADY_EXISTS it tries stem-2, stem-3, ... up to 1000 names, and fails with the Win32 error otherwise. T:'s folder is reserved once per overlay under a mutex (the first T: call or rt::fs::scratch_dir(), which the startup line calls), so concurrent first calls share it. A failed reservation is printed once and T: paths fail with ERROR_INVALID_NAME. rt::fs::scratch_stem() gives the first name tried. file_system_test: with stem and stem-2 taken, reserve_unique_dir makes stem-3, new and empty, then stem-4; a file with the next name counts as taken; max_tries names taken fail with ERROR_ALREADY_EXISTS; a missing base is made. T: with folders of this process's own stem and stem-2 already kept takes stem-3 and CREATE_NEW succeeds; eight threads making their first T: call at once reserve one folder. The second-process test stays. Restored from old upstream PR 8161 and ported onto the new main: the base folder and every candidate go through main's win32_io_path, like the other creates in file_system.cpp, so a long overlay root keeps working. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 24, 2026
abnalstlll-byte
approved these changes
Nov 24, 2026
abnalstlll-byte
left a comment
Contributor
There was a problem hiding this comment.
Reviewed and verified OLD-8161 restoration. Isolating guest process T: scratch directories under .gta6rt-temp<timestamp>-pid via atomic
eserve_unique_dir with CreateDirectoryW prevents cross-run file collision errors (ERROR_FILE_EXISTS) during crash dump creation. CTest coverage in
untime/tests/file_system_test.cpp and standard-library test ests/test_console_paths.py fully validate path resolution and isolation. Excellent work, approved.
…da#684) Conflict in docs/boot.md, the --overlay switch: main now says the overlay defaults to <game-dir>\overlay and the package is never written; this branch adds the per-process T: folder inside the overlay. Kept main's sentence and appended the T: text after it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/boot.md: main added LEONIDA_WRITE_DIR / LEONIDA_SAVE_DIR to the --overlay bullet and a new "Under Wine on Linux" section; keep both and the T: paragraph of this branch after main's sentences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 25, 2026
Collaborator
Author
This was referenced Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: OLD-8161 #14 (comment)
Restoration of my original pull request, old upstream PR 8161 in
ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Ported onto main at 21625bc; the port makesT:'s folder andreserve_unique_dir's creates go through main'swin32_io_path, keeps the scratch-folder exception in the write-open path, and points main's long-overlayT:check at the process's own folder.Depends on: #317 (textual conflict in
parse_console), #379 (conflict indocs/boot.md)What and why
T:\mapped to<overlay>\.gta6rt-temp, one folder shared by every run and kept between runs.CREATE_NEW.ERROR_FILE_EXISTS(80) and no report landed. This was old upstream issue 7913, measured by Spacecer2 under Wine 11.22.T:\now names<overlay>\.gta6rt-temp\<YYYYMMDD-HHMMSS-mmm>-pid<id>, using the process's start time in UTC and its id. On the console,T:is the title's own temporary drive, empty at launch and shared with no other run.rt::fs::reserve_unique_dirtakes the folder with a create-onlyCreateDirectoryW.-2,-3, ... up to 1000 names, so no run writes into an older folder.T:paths fail withERROR_INVALID_NAME.T:\..cannot climb into the shared folder.T:\still cannot be removed or moved.GAME:andG:are unchanged.console paths: GAME: -> ..., writes -> ..., T: -> ....rt::fs::scratch_dir()returns the folder.check_console_paths.cmake,check_game_dir.cmakeandtests/test_console_paths.pyexpect the new part.docs/boot.mdanddocs/runtime_imports.mddescribe the mapping.GetTempPath/GetTempFileNameresolve to the overlay scratch folder) is complementary, not a conflict. It drops the first partparse_consolereturns, so it lands in this process's folder too.Tested
Linux, Wine 11.22 (Staging), clang 23 targeting
x86_64-w64-mingw32(lld, static libstdc++). This is a local check only; the MSVC/W4 /permissive-build is left to CI.file_system_teston main (21625bc): 494 checks, 11 failures.file_system.cpp(the new functions stubbed to main's behaviour): 519 checks, 27 failures, so the PR's checks add 16.CreateFileW(T:\crash.dmp, CREATE_NEW)fails with 80 in this process and in the second process.reserve_unique_dircheck fails.ReadFileinto uncommitted pages does not fail withERROR_NOACCESS(1);MAXIMUM_ALLOWEDwrite-opens of a package file throughCreateFileW,CreateFileAandCreateFile2(6);python -I tests/test_console_paths.py: OK.run_tiny_game_console_pathsandrun_tiny_game_dirneed the Windowsgta6rtbuild and are left to CI.git diff --checkis clean.python -I scripts/check_no_game_data.pyon the 9 changed files is clean.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)AI-assisted (Claude Code, Claude Opus 5.5).