Skip to content

docs/saves: the container-name rule that saves.py import warns about - #5783

Open
evilclanker9000 wants to merge 1 commit into
ItsNotRexed:mainfrom
evilclanker9000:deepseek/10-saves-container-name-doc
Open

evilclanker9000 wants to merge 1 commit into
ItsNotRexed:mainfrom
evilclanker9000:deepseek/10-saves-container-name-doc

Conversation

@evilclanker9000

Copy link
Copy Markdown
Contributor

What changed and why

docs/saves.md's Importing into the runtime section describes the layout (%-encoded names, import-manifest.json) but not the container-name rule the runtime enforces. d974c88a5 made tools/saves.py import warn when a container name breaks XGameSaveCreateContainer's rule, but no docs line said what the rule was, so a reader could not tell why a slot named slot 0 imports yet can never be opened by the game.

The new paragraph states the rule exactly as valid_container_name() in tools/saves.py and runtime/shims/xgameruntime_gamesave.cpp check it — at most 256 characters, a path part of letters, digits and _, then a non-empty file part of letters, digits, _, . and - with no trailing . and no .. — links to runtime_imports.md's existing Names bullet, and notes that the default container (the slot name) breaks it as soon as it has a space and that import prints the --map that renames the container.

Test

Docs only, no new test: the behaviour the paragraph documents already has one, and the claim was checked against the code and that test.

python -I tests/test_saves.py ImportTest.test_container_names_follow_the_runtime_rule -v
# Ran 1 test in 0.044s / OK

The rule as the paragraph states it, run against valid_container_name():

SLOT3 True | slots/SAVE_00.sav-1 True | 'slot 0' False | a..b False | x. False | a/b-c/d False | 257 chars False | 256 chars True

No GPU needed.

Notes

  • Scope: docs only, one paragraph, in the section the merged warning belongs to. A separate claim (EGEN-SAVES-IMPORT-DOCS) covers the usage line's missing --with-packed, so this PR leaves that line alone.
  • Wording follows the rule as the runtime implements it, not the GDK prose, because that is what the warning and xgameruntime_gamesave.cpp check.

AI-assisted.

…974c88)

The import section described the layout and encoding but not the XGameSaveCreateContainer rule the runtime enforces and valid_container_name() checks: at most 256 characters, a path part of letters, digits and '_', then a non-empty file part of letters, digits, '_', '.' and '-' with no trailing '.' and no '..'. The default container is the slot name, so a space in it makes the import unusable; import already warns and prints the --map, which the docs now say.
@kapitche

Copy link
Copy Markdown
Contributor

Tested 8a6b042 merged with main 561b65a on Linux (WSL2) / Python 3.12.16: pass

Docs-only. tests/test_docs_*.py: 11 files run, 11 passed, 0 failed. Checked the new paragraph against tools/saves.py valid_container_name and runtime/shims/xgameruntime_gamesave.cpp: 256-character limit, path part of letters/digits/_//, non-empty file part of letters/digits/_/./- that does not end in . and has no .., all as written. Called valid_container_name on 'slot 1' (False), 'slot_1', 'a/b/c.x', 'a'*256 (True), 'x.', 'x..y', 'a'*257 and 'a/' (False), so a space does break the default slot-name container. import prints a warning with a --map <folder>=NAME hint, as described. Negative control: not applicable (no code change).

@skorex

skorex commented Nov 23, 2026

Copy link
Copy Markdown

Duplicate of #5329

#5329 makes the same change and was opened earlier. Topic: docs/saves: container-name rule.

Suggest closing this PR in favour of #5329, and porting anything this one adds that #5329 lacks there.

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.

3 participants