Repository navigation
Conversation
Report SAVE_DATA_ERROR_INTERNAL when setupSaveDataMemory2 fails to persist initial SaveDataParam metadata, and restore previous state so retrying setup can initialize cleanly. Closes #1667.
…ck recovery Write initial SaveDataParam metadata before replacing the memory blob so metadata failure cannot leave a prematurely grown blob. Handle blob write failure with metadata rollback, and allow retries to recover slots with missing metadata. Expand tests with nonzero data, blob failure, and fresh readback.
Keep the existing blob size when repairing missing metadata with a smaller memory request. Cover smaller, equal and larger requests, preserved bytes, zero-filled growth and library reinitialization. Depends on upstream PR #1680. Reproduced the 64-to-32-byte truncation before the fix; all 11 save-data CTest cases pass with MinGW-w64 GCC 15.2.0 on Windows. AI-assisted.
Contributor
|
Additional platform validation on standalone PR head Linux: passed — Arch Linux in WSL2 (kernel 6.6.87.2), GCC 16.2.1 20260810; CMake 4.3.1 / Ninja. Release / Tests: Reproduce after building the test targets: |
3 tasks done
Collaborator
9 tasks done
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.
What
Recovering missing save-data metadata can truncate an existing save when the caller requests a smaller memory size. With the recovery path in #1680, a 64-byte save becomes 32 bytes after a 32-byte setup request.
Keep the larger of the existing size and the requested size during recovery. Smaller and equal requests preserve the saved bytes; larger requests still grow the file and zero-fill the new space.
The regression test covers all three cases, checks the recovered metadata, and verifies that the data survives library termination and reinitialization.
Refs #1667. Depends on #1680. This branch includes that PR's original commits so the recovery path and this fix can be tested together. The follow-up fix and tests are in
dfc477cc. Once #1680 merges, this branch can be rebased onto main to leave just the follow-up change for review.Tested
Windows 11, MinGW-w64 GCC 15.2.0, Ninja, Release,
BUILD_TESTING=ON. Configured the full project and built the affected libraries and save-data test targets. Tests use synthetic save files; no game or console testing.Metadata recovery requested 32 bytes: expected 64 bytes, got 32.git diff --checkpassed.Checklist
main; checked open PRs for duplicates. This is a follow-up to fix(savedata): recover from metadata setup failure #1680.NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt. No new stubs..mdfiles or images added to the repository