SAVE-DATA-BLOB: import save payloads under the title's blob name #446

Open
github-bot wants to merge 1 commit from github-bot/gh-446 into main AGit
Owner

@⁠bobcatchris on GitHub · 2026-11-24 05:34 UTC · original
bobcatchris:saves-blob-name → main · +26 −9 · 3 files · 1 commits · open

Claimed in the coordination issue as: SAVE-DATA-BLOB

What and why

saves.py import wrote the payload under the payload file name on a guess that the docs marked VERIFY. The executable settles the data-blob name statically: XGameSaveSubmitBlobWrite is called with "Save Game Header" first and "Save Game Data" with the payload, and the read path matches the same two names. A payload imported under any other name is never read back.

This writes imported payloads as Save Game Data (still %-encoded on disk by the existing layout) and updates docs/saves.md to separate what was measured from what was not. Container names remain a guess because neither CreateContainer call passes a literal; --map still overrides either name. No real save files, save contents, keys or game data are included.

Tested

  • python -I tests/test_saves.py — 70 tests OK, 1 skipped
  • python -I tests/test_docs_links.py — 16 tests OK
  • python -I tests/test_docs_cli_flags.py — 4 tests OK
  • python -m compileall -q tools tests — OK
  • git diff --check — clean
  • security sweep of the diff — 0 hits

GPUs tested: n/a (CPU-only tool and documentation change)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • No new translator rule.
**@⁠bobcatchris** on GitHub · 2026-11-24 05:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/446) `bobcatchris:saves-blob-name` → `main` · +26 −9 · 3 files · 1 commits · open Claimed in the coordination issue as: SAVE-DATA-BLOB ### What and why `saves.py import` wrote the payload under the payload file name on a guess that the docs marked VERIFY. The executable settles the data-blob name statically: `XGameSaveSubmitBlobWrite` is called with `"Save Game Header"` first and `"Save Game Data"` with the payload, and the read path matches the same two names. A payload imported under any other name is never read back. This writes imported payloads as `Save Game Data` (still %-encoded on disk by the existing layout) and updates `docs/saves.md` to separate what was measured from what was not. Container names remain a guess because neither `CreateContainer` call passes a literal; `--map` still overrides either name. No real save files, save contents, keys or game data are included. ### Tested - `python -I tests/test_saves.py` — 70 tests OK, 1 skipped - `python -I tests/test_docs_links.py` — 16 tests OK - `python -I tests/test_docs_cli_flags.py` — 4 tests OK - `python -m compileall -q tools tests` — OK - `git diff --check` — clean - security sweep of the diff — 0 hits GPUs tested: n/a (CPU-only tool and documentation change) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. - [x] No new translator rule.
The import's default blob name was the payload's file name (SLOT0, Player,
story) on a guess the docs carried as a VERIFY. The executable settles it:
XGameSaveSubmitBlobWrite takes a literal at both call sites -- "Save Game
Header" first, 0x128 bytes, then "Save Game Data" with the payload -- and
the read path matches exactly those two names, keeping the header only when
its size is 0x128. A container the title wrote therefore holds a 296-byte
header blob and a data blob, so a payload imported under any other name is
never read back.

Write the payload as "Save Game Data" (the existing %-encoding turns it into
Save%20Game%20Data on disk) and leave --map for both halves. The container
name is still unmeasured: neither CreateContainer call passes a literal, both
take [state + 0x288] + index * 0x2c + 2, a table the title fills at run time,
so the default stays the ASAV slot name and the docs say so instead of
guessing.

docs/saves.md records what was measured and what was not and drops the
VERIFY; the import-manifest note says the same; the layout test pins the new
name. tools/exe_checklist.py goes from 17 notes to 16 on dde82f27e.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:00:34 +00:00
Author
Owner

@⁠Oliwettoo on GitHub · 2026-11-24 10:38 UTC · original

tests/test_saves.py passes with the PR on current main, and the existing same-container/blob check still catches two slots mapped to one container now that every payload is named Save Game Data. I couldn't check the executable measurement itself. One thing to settle before merge: the two texts disagree on whether the title needs the header. docs/saves.md says the read path "keeps the header only if its size is 0x128" (optional), while the new comment above SAVE_DATA_BLOB says the read path "also requires the 296-byte Save Game Header blob". If it is required, an import without the header won't load in the title, which the doc should say plainly. If it isn't, the comment should drop "requires". AI-assisted review.

**@⁠Oliwettoo** on GitHub · 2026-11-24 10:38 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/446#issuecomment-7129048923) `tests/test_saves.py` passes with the PR on current `main`, and the existing same-container/blob check still catches two slots mapped to one container now that every payload is named `Save Game Data`. I couldn't check the executable measurement itself. One thing to settle before merge: the two texts disagree on whether the title needs the header. `docs/saves.md` says the read path "keeps the header only if its size is `0x128`" (optional), while the new comment above `SAVE_DATA_BLOB` says the read path "also requires the 296-byte `Save Game Header` blob". If it is required, an import without the header won't load in the title, which the doc should say plainly. If it isn't, the comment should drop "requires". AI-assisted review.
Author
Owner

@⁠bobcatchris on GitHub · 2026-11-24 23:42 UTC · original

Rebased on current main. Verified: test_saves.py 70 tests (1 skipped), docs CLI-flag tests 4/4, no-game-data check and patch security sweep clean.

**@⁠bobcatchris** on GitHub · 2026-11-24 23:42 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/446#issuecomment-7147709661) Rebased on current main. Verified: test_saves.py 70 tests (1 skipped), docs CLI-flag tests 4/4, no-game-data check and patch security sweep clean.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/446/head:github-bot/gh-446'
git switch 'github-bot/gh-446'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-446'
git switch 'github-bot/gh-446'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-446'
git switch 'github-bot/gh-446'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-446'
git switch 'main'
git merge --squash 'github-bot/gh-446'
git switch 'main'
git merge --ff-only 'github-bot/gh-446'
git switch 'main'
git merge 'github-bot/gh-446'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.