[PR #2003] Recover interrupted offline save updates before readback #2010

Open
opened 2026-11-26 21:19:43 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2003
Author: @lgr123
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: lgr123/gamesave-interrupted-update-recovery


📝 Commits (1)

  • d64641b Recover interrupted offline save updates

📊 Changes

4 files changed (+434 additions, -104 deletions)

View changed files

📝 docs/saves.md (+4 -0)
📝 runtime/CMakeLists.txt (+1 -1)
📝 runtime/shims/xgameruntime_gamesave.cpp (+186 -85)
📝 runtime/test/xgameruntime_gamesave_test.cpp (+243 -18)

📄 Description

Claimed as RT-GAMESAVE-INTERRUPTED-UPDATE-RECOVERY.

A native synthetic checkpoint had two blobs at generation 1. I ended the save process after the first successful file replacement in public main. A new process reopened it via the save API and returned inventory at generation 2 with player state at generation 1. The uninterrupted control returned 2/2. The earlier rollback for an error returned by the current process remains covered.

Stage new bytes and undo data before touching live files. A same-volume journal records which operations need rollback. If an update is interrupted, restore the complete previous generation before the normal read, enumeration, quota, or next write proceeds. A completed commit retains its new generation. Recovery can be interrupted and retried. It keeps the existing container and blob paths, display metadata, and legacy backup files.

This addresses process interruption in one runtime on the same volume. It does not establish power-loss durability or synchronize multiple runtime processes and an external importer.

Reviewer check

Build the Windows xgameruntime_gamesave_test target and run it with no arguments. The test spawns synthetic child processes and uses disposable save folders. No game files or existing saves are needed.

Tested

  • Native Windows x64, MSVC, public main b9320a1 plus this patch. 156 of 156 checks passed. Coverage includes seven interruption points, interruption during rollback, first-save cleanup, blocked recovery, metadata and quota, legacy backups, and synchronous and asynchronous reads.
  • Compiled the production shim separately with test failure hooks disabled.
  • Source-only check and git diff --check passed. A local merge-tree check with #1952 found no conflict.

GPUs tested: n/a.

AI-assisted: yes.

Checklist

  • Based on public main.
  • One topic.
  • No game data, keys or protection workarounds.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2003 **Author:** [@lgr123](https://github.com/lgr123) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `lgr123/gamesave-interrupted-update-recovery` --- ### 📝 Commits (1) - [`d64641b`](https://github.com/ubiquitarianism/leonida/commit/d64641bcf859e39718b9a562dae2132c3b46b109) Recover interrupted offline save updates ### 📊 Changes **4 files changed** (+434 additions, -104 deletions) <details> <summary>View changed files</summary> 📝 `docs/saves.md` (+4 -0) 📝 `runtime/CMakeLists.txt` (+1 -1) 📝 `runtime/shims/xgameruntime_gamesave.cpp` (+186 -85) 📝 `runtime/test/xgameruntime_gamesave_test.cpp` (+243 -18) </details> ### 📄 Description Claimed as [RT-GAMESAVE-INTERRUPTED-UPDATE-RECOVERY](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7169739872). A native synthetic checkpoint had two blobs at generation 1. I ended the save process after the first successful file replacement in public main. A new process reopened it via the save API and returned inventory at generation **2** with player state at generation **1**. The uninterrupted control returned **2/2**. The earlier rollback for an error returned by the current process remains covered. Stage new bytes and undo data before touching live files. A same-volume journal records which operations need rollback. If an update is interrupted, restore the complete previous generation before the normal read, enumeration, quota, or next write proceeds. A completed commit retains its new generation. Recovery can be interrupted and retried. It keeps the existing container and blob paths, display metadata, and legacy backup files. This addresses process interruption in one runtime on the same volume. It does not establish power-loss durability or synchronize multiple runtime processes and an external importer. ### Reviewer check Build the Windows `xgameruntime_gamesave_test` target and run it with no arguments. The test spawns synthetic child processes and uses disposable save folders. No game files or existing saves are needed. ### Tested - Native Windows x64, MSVC, public main `b9320a1` plus this patch. **156 of 156 checks passed**. Coverage includes seven interruption points, interruption during rollback, first-save cleanup, blocked recovery, metadata and quota, legacy backups, and synchronous and asynchronous reads. - Compiled the production shim separately with test failure hooks disabled. - Source-only check and `git diff --check` passed. A local merge-tree check with #1952 found no conflict. GPUs tested: n/a. AI-assisted: yes. ### Checklist - [x] Based on public main. - [x] One topic. - [x] No game data, keys or protection workarounds. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#2010
No description provided.