Repository navigation
Conversation
…time reads The runtime's offline XGameSave (save_root() in runtime/shims/xgameruntime_gamesave.cpp) keeps saves in LEONIDA_SAVE_DIR and falls back to %LOCALAPPDATA%\Leonida\saves only when that variable is unset or empty. `saves.py import` without --out always wrote to the fallback, so with LEONIDA_SAVE_DIR set it reported "wrote N blobs" into a folder the runtime never reads. The default is now --out, else LEONIDA_SAVE_DIR when set and not empty, else %LOCALAPPDATA%\Leonida\saves. Three regression tests (ImportDefaultFolderTest) run in temporary folders with LOCALAPPDATA redirected; the LEONIDA_SAVE_DIR case fails before this change. The usage text and docs/saves.md say so. AI-assisted (Claude Code).
|
Tested 2c5af33 on Arch Linux, Python 3.14.10, CPU only: pass — tests/test_saves.py 73/73 OK (1 skipped). Negative control: tool swapped to merge-base → exactly 1 failure (the LEONIDA_SAVE_DIR default test); restored, green again. No game files, no GPU. AI-assisted. |
Desamodeth
left a comment
There was a problem hiding this comment.
Verified 2c5af33a on native Windows x64 (MSVC 19.44, Release). I imported a synthetic ASAV with the CLI, then launched a separate guest with gta6rt --run and read the named blob through XGameSave. The parent importer exited 0 with a custom save root set, but the guest got E_GS_BLOB_NOT_FOUND; the bytes were in the fallback folder.
On this head the guest read the exact input bytes from an absolute Unicode save root, and from the fallback with the variable unset or empty. With --out, only the explicit folder received the import, and pointing the guest there returned the same bytes. All paths were temporary. The saves and import-argument suites had 71 passes and 3 platform skips. CPU only, AI-assisted.
|
Tested 2c5af33 merged with main dde82f2 on Linux/Python 3.12.16: pass Merge is clean (tools/saves.py, docs/saves.md, tests/test_saves.py).
|
|
Tested 2c5af33 on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass. Ran the test files this PR adds or changes, from a clean checkout of the PR head: AI-assisted (Claude Code). |
Claim: #7496 (comment) (new BUILD item)
Problem
The runtime's offline XGameSave (
save_root()inruntime/shims/xgameruntime_gamesave.cpp:169-176) keeps saves inLEONIDA_SAVE_DIRand falls back to%LOCALAPPDATA%\Leonida\savesonly when that variable is unset or empty.tools/saves.py importwithout--outalways used the fallback (tools/saves.py:614). WithLEONIDA_SAVE_DIRset,the import exited 0 and printed
wrote N blobs, but into a folder the runtime never reads.docs/saves.mdsays theimport writes into the runtime's layout; the existing import tests always pass
--out, so the default was untested.Repro on main (synthetic ASAV, no game files):
LEONIDA_SAVE_DIR=<A>,LOCALAPPDATA=<B>,python -I tools/saves.py import <folder>→<A>stays empty, the blob lands in<B>\Leonida\saves\local-user\....Fix
The default output folder is now, in order:
--out, when given (unchanged);LEONIDA_SAVE_DIR, when set and not empty — the same test the shim makes;%LOCALAPPDATA%\Leonida\saves(unchanged).default_save_root()holds that rule; the usage text anddocs/saves.mdsay so.Files
tools/saves.py—default_save_root(), used byimportwhen--outis absent; usage text.tests/test_saves.py—ImportDefaultFolderTest: theLEONIDA_SAVE_DIRdefault,--outwinning over it, andan unset or empty variable falling back to
LOCALAPPDATA. Every folder is temporary andLOCALAPPDATAisredirected, so no real save folder is touched.
docs/saves.md— one sentence on the default folder.Tests
Windows 11, Python 3.13.5. CPU-only; no GPU, Vulkan or game files involved.
python -I tests/test_saves.py ImportDefaultFolderTeston main'stools/saves.py:test_leonida_save_dir_is_the_defaultfails; the--outand unset/empty cases pass (they guard existingbehaviour).
python -I tests/test_saves.py: 73 tests OK, 3 skipped (main: 70 OK, the same 3 skipped).python -I tests/test_saves_import_args.py: OK.python -I scripts/check_no_game_data.py tools/saves.py tests/test_saves.py docs/saves.md: exit 0.Limitations
LEONIDA_SAVE_DIRof 520 characters or more (MAX_PATH * 2buffer) and falls back;this change does not copy that limit, since xgameruntime: support Windows long paths and >200-char hashed save names (RT-387) #5203 removes it from the shim.
LEONIDA_SAVE_DIRis resolved against each process's own working folder, so the tool and the gamecan still disagree on one; an absolute path is what the docs assume.
docs/saves.md; the change is placed away from thatPR's hunks in
tools/saves.pyandtests/test_saves.py. No open PR changes the default folder.AI-assisted (Claude Code): the analysis, code, tests and this description were written with Claude Code and reviewed
before submission.