WIP: fix(fs): a save reaches the save folder whole, at Commit #607

Draft
jarynclouatre wants to merge 1 commit from jarynclouatre/Longshot:fix/save-staged-commit into main
Contributor

Type: fix · Risk: high · Tested on: Windows 11, RTX 4070 Ti SUPER; Linux x86-64 (game-free checks) · Needs: Windows and Linux, any GPU

Why

A save can be lost while it is being written. The save mount writes straight into the save folder and Commit does nothing. The game saves a file by opening it, setting its size to 0, writing it in one piece and closing it; it does that for slot_NN/progress.sav, option.sav and slot_NN/caption.sav in turn and then calls Commit. Anything that stops the game between the resize and the Commit (a crash, a closed window, a frozen PC, a full disk under the write) leaves an empty or half-written file where the last good save was, or a new progress.sav beside an old caption.sav. On the console nothing reaches the save until Commit.

The game autosaves at every area change.

Found reading host/nn_fs.c; no issue reports a lost save. The tracker was searched for "corrupt", "save lost", "save gone", "save file".

How to reproduce

Seen on: Linux x86-64, in the game-free check below (a real partial write over the real file layer). The game's order of calls is from a run on Windows 11, RTX 4070 Ti SUPER (the trace under Measurements).
Settings and switches: defaults.
Steps: python -I -B tests/test_fs_save_commit.py --source <main's host/nn_fs.c> --case a: a 16-byte committed file, an overwrite cut off after 8 bytes by a file size limit, no Commit.
Expected: the committed file still holds its old bytes.
Actual: AssertionError: (a): failed overwrite damaged committed bytes. The game is told the write failed, and the old save is already gone.

What changed

The game now writes its save into a working copy, and Commit puts the changed files into the save folder in one step that a stop in the middle cannot leave half done. The save folder itself keeps its place and layout, so save tools, the control bridge and other programs that share the files see only whole saves.

  • folders (host/nn_fs.c, save_mount): user/save/<uid> stays the committed save. MountSaveData copies it to user/save-work/<uid> and mounts that. What was not committed is gone at the next mount, as on the console. If the working copy cannot be made, the save folder is mounted in place as before, with a log line.
  • notes: each change the game makes below the mount is noted by path (a file opened for writing or created, a folder made, an entry deleted or renamed). Deletions are noted entry by entry from what the game removed, never worked out from what the save folder happens to hold.
  • Commit (save_publish): for each noted path the working file is compared with the committed one; a changed file is copied beside its target as <n>.longshot-new and flushed. Then a journal (user/save-work/<uid>.journal) lists the steps, the steps are applied (renames over the targets, folders made, the game's deletions), and the journal is removed. A failure before the journal leaves the save folder untouched and returns an error; a rename the system refuses is tried again for one second, then the journal stays and the next Commit or mount finishes it. Commit with a file still open for writing is refused, as Horizon refuses it; the game never does that (trace below).
  • recovery: a mount replays a whole journal and drops a half-written one together with its staged files. A journal that cannot be replayed is moved aside as <uid>.journal.failed with a log line and the game goes on with the files as they are.
  • a failed write: the file is put back from the committed copy when its last writer closes it, so a later Commit cannot publish the mixed bytes.
  • two running copies of the game: user/save-work/<uid>.lock is held by the first. A second one mounts the save folder in place, as both do on main, and never touches the working copy or the journal.
  • links: nothing below the working copy or, during a publish, below the save folder is followed through a link; the save folder itself may still be a link to another drive, which is why the staged files sit in it and not in the working folder.
  • HOS_FS_TRACE=1 now also logs each change to a writable mount and each Commit with its counts and time.
  • tools: scripts/longshot_saves.py does not take save-work for a save and refuses to copy a save whose journal is waiting; the Linux move of the data folder (host/hos_main.c) leaves save-work behind and waits while a journal is there. docs/saves.md says what the folder is.
  • tests: tests/test_fs_save_commit.py runs the real HLE functions over host/posix/win32_posix.c. tests/test_guest_copies.py and tests/test_vcore_fs_open.py follow the moved code; the second also checks that an open on the RomFS mount takes no save lock.

Reviewer notes: host/nn_fs.c grows by about 950 lines. #61, #68, #355 and #461 change the same file and will conflict in text; #68 and #355 copy the save folder after a quiet time because writes were in place, and with this change the save folder only ever holds whole saves. I will rebase onto whichever lands first.

Measurements

Verdict: the new check fails on main and passes here, and the suite has no new failures. In the game 12 saves in a row were published whole, each in 12.8 to 15.4 ms (median 13.7 ms) on the game's own save thread. Frame times around a save were not compared with main yet, which is why this is WIP.

Hardware: Windows 11, RTX 4070 Ti SUPER, Ryzen 7 9800X3D, 32 GB, NVMe drive; the suite on a Linux x86-64 PC (gcc 15.2, Python 3.14.4)
Scene: a scripted walk of about 9 minutes with debug teleports (Graveyard, Kakariko, Hyrule Field, Gerudo Valley), headless, after a shader preparation
Method: 2026-11-14. Game: one run with HOS_FS_TRACE=1, the fs: lines read from the log, the two folders listed after the run. That run was made before the rebase, on main @ 8b619764 with this change; host/nn_fs.c and host/posix/win32_posix.c are the same in this commit. Suite: python3 -I -B tests/run_all.py --jobs 4 --timeout 120, main and the PR in turn, two runs each.
How to reproduce: HOS_FS_TRACE=1 in longshot_env.txt, walk through a few loading zones, read the fs: Commit and fs: save: lines

Before: main @ 225c37f8 After: this PR @ e7e7e368
tests/run_all.py (run 1, run 2) 484 passed, 11 failed, 84 skipped (both) 485 passed, 11 failed, 84 skipped (both)
failing checks test_appimage_player_build.py, test_bake_portability.py, test_cpm_discovery.py, test_crash_dialog.py, test_env_on.py, test_lift_cleanup_error.py, test_make_game_cache.py, test_readback_late.py, test_vk_pgo.py, test_vram_budget_row.py, test_walk_key.py the same eleven
test_fs_save_commit.py --case a fails: the committed file holds mixed bytes after a failed write passes
test_fs_save_commit.py, all cases not applicable, main has no staging passes, twice

In the game (this change only; main logs none of these lines):

this PR's code on main @ 8b619764
saves made by the game in the run 12, plus one rewrite of account.sav with the same bytes at the start (nothing to publish)
calls of one save resize to 0, one write, close for progress.sav (about 124 KB), option.sav (42 KB), caption.sav (about 38 KB); then Commit
thread gmd::SaveDataMgr for every write and every Commit
Commit with a file open for writing 0 of 13
time of a publish (3 files) 12.8 to 15.4 ms, median 13.7 ms
after the run save and save-work hold the same files and sizes; no journal, no staged file
[hos gmd::SaveDataMgr] fs: resize save:/slot_01/progress.sav to 0
[hos gmd::SaveDataMgr] fs: write save:/slot_01/progress.sav at 0, 124028 bytes, 124028 written, result 0
[hos gmd::SaveDataMgr] fs: close save:/slot_01/progress.sav, written 1, result 1
[hos gmd::SaveDataMgr] fs: resize save:/option.sav to 0
[hos gmd::SaveDataMgr] fs: write save:/option.sav at 0, 42100 bytes, 42100 written, result 0
[hos gmd::SaveDataMgr] fs: close save:/option.sav, written 1, result 1
[hos gmd::SaveDataMgr] fs: resize save:/slot_01/caption.sav to 0
[hos gmd::SaveDataMgr] fs: write save:/slot_01/caption.sav at 0, 37497 bytes, 37497 written, result 0
[hos gmd::SaveDataMgr] fs: close save:/slot_01/caption.sav, written 1, result 1
[hos gmd::SaveDataMgr] fs: Commit: 3 files, 3 ops, 0 failed paths, 0 open writers, result 0 in 13.052 ms
[hos gmd::SaveDataMgr] fs: save: published 3 files in 13.052 ms

Flags and settings

No new switch. One existing switch logs more.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
HOS_FS_TRACE logs the game's file calls off; logs opens off; also logs changes to writable mounts and each Commit log lines only helps when reading what a save did off: only for testing

Testing

Tested: the game-free suite on Linux, as in Measurements. tests/test_fs_save_commit.py: a failed partial write, three files published together, a remount without Commit, a stop after the journal and a stop in the middle of applying it (both replayed at the next mount), half-written and hostile journals, deletes and renames, a file the player put into the save folder during play, a publish that runs out of room, a working copy that cannot be made, a refused rename, two real processes on one save, links below both folders, and that the build finds every changed function as HLE(name). The game on Windows 11 with an RTX 4070 Ti SUPER: the run under Measurements. The Windows game of that run was built from this code with llvm-mingw 20261104 (before the rebase). For Linux, host/nn_fs.c and host/posix/win32_posix.c compile whole with gcc 15.2 (-Wall -Wextra) in the new check, and the Linux move in host/hos_main.c in tests/test_linux_saves_move.py; no full Linux game was built.

Not tested: frame times around a save against main. A real power cut or reset in the middle of a save (the checks stop the process at those points instead). The game on Linux. A save folder on a network drive or under a cloud sync program. A second copy of the game on Windows (checked on Linux with two processes; on Windows read in the source only).

Must be tested:

  • Windows, any GPU: play through several area changes, expecting no new hitch at an autosave against main (by hand: present intervals around the fs: save: published lines with HOS_FS_TRACE=1; I will post a main-against-PR run)
  • Linux, any GPU: play through two area changes and quit, start again and continue, expecting the newest save to load and fs: save: published 3 files lines in the log (by hand)
  • Windows, any GPU: end the game from the task manager right after an area change, start again, expecting the save list as it was before or after that save, never a broken entry (by hand)

Risks

What could break: saving, for everyone. A fault here could keep saves from reaching the save folder or keep the game from starting with one. The ways out built in: any failure to set up the working copy mounts the save folder in place as before; a journal that cannot be replayed is moved aside and play goes on; a Commit that fails returns an error to the game and leaves the last good save alone. The publish adds about 14 ms on the game's save thread per save on the test PC.

Turning it off: revert the commit. There is no switch; a save folder written by this change is an ordinary save folder, so main reads it as it is.

Compatibility: saves keep their place and format. A new folder save-work appears beside save in the user folder; it can be deleted while the game is closed. Progress the game wrote without a Commit is no longer kept at the next start; the game commits every save (13 of 13 in the trace). Tools that copy saves should copy save only.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.
**Type:** fix · **Risk:** high · **Tested on:** Windows 11, RTX 4070 Ti SUPER; Linux x86-64 (game-free checks) · **Needs:** Windows and Linux, any GPU ## Why A save can be lost while it is being written. The save mount writes straight into the save folder and `Commit` does nothing. The game saves a file by opening it, setting its size to 0, writing it in one piece and closing it; it does that for `slot_NN/progress.sav`, `option.sav` and `slot_NN/caption.sav` in turn and then calls `Commit`. Anything that stops the game between the resize and the `Commit` (a crash, a closed window, a frozen PC, a full disk under the write) leaves an empty or half-written file where the last good save was, or a new `progress.sav` beside an old `caption.sav`. On the console nothing reaches the save until `Commit`. The game autosaves at every area change. Found reading `host/nn_fs.c`; no issue reports a lost save. The tracker was searched for "corrupt", "save lost", "save gone", "save file". ## How to reproduce **Seen on:** Linux x86-64, in the game-free check below (a real partial write over the real file layer). The game's order of calls is from a run on Windows 11, RTX 4070 Ti SUPER (the trace under Measurements). **Settings and switches:** defaults. **Steps:** `python -I -B tests/test_fs_save_commit.py --source <main's host/nn_fs.c> --case a`: a 16-byte committed file, an overwrite cut off after 8 bytes by a file size limit, no `Commit`. **Expected:** the committed file still holds its old bytes. **Actual:** `AssertionError: (a): failed overwrite damaged committed bytes`. The game is told the write failed, and the old save is already gone. ## What changed The game now writes its save into a working copy, and `Commit` puts the changed files into the save folder in one step that a stop in the middle cannot leave half done. The save folder itself keeps its place and layout, so save tools, the control bridge and other programs that share the files see only whole saves. - folders (`host/nn_fs.c`, `save_mount`): `user/save/<uid>` stays the committed save. `MountSaveData` copies it to `user/save-work/<uid>` and mounts that. What was not committed is gone at the next mount, as on the console. If the working copy cannot be made, the save folder is mounted in place as before, with a log line. - notes: each change the game makes below the mount is noted by path (a file opened for writing or created, a folder made, an entry deleted or renamed). Deletions are noted entry by entry from what the game removed, never worked out from what the save folder happens to hold. - `Commit` (`save_publish`): for each noted path the working file is compared with the committed one; a changed file is copied beside its target as `<n>.longshot-new` and flushed. Then a journal (`user/save-work/<uid>.journal`) lists the steps, the steps are applied (renames over the targets, folders made, the game's deletions), and the journal is removed. A failure before the journal leaves the save folder untouched and returns an error; a rename the system refuses is tried again for one second, then the journal stays and the next `Commit` or mount finishes it. `Commit` with a file still open for writing is refused, as Horizon refuses it; the game never does that (trace below). - recovery: a mount replays a whole journal and drops a half-written one together with its staged files. A journal that cannot be replayed is moved aside as `<uid>.journal.failed` with a log line and the game goes on with the files as they are. - a failed write: the file is put back from the committed copy when its last writer closes it, so a later `Commit` cannot publish the mixed bytes. - two running copies of the game: `user/save-work/<uid>.lock` is held by the first. A second one mounts the save folder in place, as both do on main, and never touches the working copy or the journal. - links: nothing below the working copy or, during a publish, below the save folder is followed through a link; the save folder itself may still be a link to another drive, which is why the staged files sit in it and not in the working folder. - `HOS_FS_TRACE=1` now also logs each change to a writable mount and each `Commit` with its counts and time. - tools: `scripts/longshot_saves.py` does not take `save-work` for a save and refuses to copy a save whose journal is waiting; the Linux move of the data folder (`host/hos_main.c`) leaves `save-work` behind and waits while a journal is there. `docs/saves.md` says what the folder is. - tests: `tests/test_fs_save_commit.py` runs the real HLE functions over `host/posix/win32_posix.c`. `tests/test_guest_copies.py` and `tests/test_vcore_fs_open.py` follow the moved code; the second also checks that an open on the RomFS mount takes no save lock. Reviewer notes: `host/nn_fs.c` grows by about 950 lines. #61, #68, #355 and #461 change the same file and will conflict in text; #68 and #355 copy the save folder after a quiet time because writes were in place, and with this change the save folder only ever holds whole saves. I will rebase onto whichever lands first. ## Measurements **Verdict:** the new check fails on main and passes here, and the suite has no new failures. In the game 12 saves in a row were published whole, each in 12.8 to 15.4 ms (median 13.7 ms) on the game's own save thread. Frame times around a save were not compared with main yet, which is why this is WIP. Hardware: Windows 11, RTX 4070 Ti SUPER, Ryzen 7 9800X3D, 32 GB, NVMe drive; the suite on a Linux x86-64 PC (gcc 15.2, Python 3.14.4) Scene: a scripted walk of about 9 minutes with debug teleports (Graveyard, Kakariko, Hyrule Field, Gerudo Valley), headless, after a shader preparation Method: 2026-11-14. Game: one run with `HOS_FS_TRACE=1`, the `fs:` lines read from the log, the two folders listed after the run. That run was made before the rebase, on main @ 8b619764 with this change; `host/nn_fs.c` and `host/posix/win32_posix.c` are the same in this commit. Suite: `python3 -I -B tests/run_all.py --jobs 4 --timeout 120`, main and the PR in turn, two runs each. How to reproduce: `HOS_FS_TRACE=1` in `longshot_env.txt`, walk through a few loading zones, read the `fs: Commit` and `fs: save:` lines | | Before: main @ 225c37f8 | After: this PR @ e7e7e368 | |---|---|---| | `tests/run_all.py` (run 1, run 2) | 484 passed, 11 failed, 84 skipped (both) | 485 passed, 11 failed, 84 skipped (both) | | failing checks | `test_appimage_player_build.py`, `test_bake_portability.py`, `test_cpm_discovery.py`, `test_crash_dialog.py`, `test_env_on.py`, `test_lift_cleanup_error.py`, `test_make_game_cache.py`, `test_readback_late.py`, `test_vk_pgo.py`, `test_vram_budget_row.py`, `test_walk_key.py` | the same eleven | | `test_fs_save_commit.py --case a` | fails: the committed file holds mixed bytes after a failed write | passes | | `test_fs_save_commit.py`, all cases | not applicable, main has no staging | passes, twice | In the game (this change only; main logs none of these lines): | | this PR's code on main @ 8b619764 | |---|---| | saves made by the game in the run | 12, plus one rewrite of `account.sav` with the same bytes at the start (nothing to publish) | | calls of one save | resize to 0, one write, close for `progress.sav` (about 124 KB), `option.sav` (42 KB), `caption.sav` (about 38 KB); then `Commit` | | thread | `gmd::SaveDataMgr` for every write and every `Commit` | | `Commit` with a file open for writing | 0 of 13 | | time of a publish (3 files) | 12.8 to 15.4 ms, median 13.7 ms | | after the run | `save` and `save-work` hold the same files and sizes; no journal, no staged file | ``` [hos gmd::SaveDataMgr] fs: resize save:/slot_01/progress.sav to 0 [hos gmd::SaveDataMgr] fs: write save:/slot_01/progress.sav at 0, 124028 bytes, 124028 written, result 0 [hos gmd::SaveDataMgr] fs: close save:/slot_01/progress.sav, written 1, result 1 [hos gmd::SaveDataMgr] fs: resize save:/option.sav to 0 [hos gmd::SaveDataMgr] fs: write save:/option.sav at 0, 42100 bytes, 42100 written, result 0 [hos gmd::SaveDataMgr] fs: close save:/option.sav, written 1, result 1 [hos gmd::SaveDataMgr] fs: resize save:/slot_01/caption.sav to 0 [hos gmd::SaveDataMgr] fs: write save:/slot_01/caption.sav at 0, 37497 bytes, 37497 written, result 0 [hos gmd::SaveDataMgr] fs: close save:/slot_01/caption.sav, written 1, result 1 [hos gmd::SaveDataMgr] fs: Commit: 3 files, 3 ops, 0 failed paths, 0 open writers, result 0 in 13.052 ms [hos gmd::SaveDataMgr] fs: save: published 3 files in 13.052 ms ``` ### Flags and settings No new switch. One existing switch logs more. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `HOS_FS_TRACE` | logs the game's file calls | off; logs opens | off; also logs changes to writable mounts and each `Commit` | log lines only | helps when reading what a save did | off: only for testing | ## Testing **Tested:** the game-free suite on Linux, as in Measurements. `tests/test_fs_save_commit.py`: a failed partial write, three files published together, a remount without `Commit`, a stop after the journal and a stop in the middle of applying it (both replayed at the next mount), half-written and hostile journals, deletes and renames, a file the player put into the save folder during play, a publish that runs out of room, a working copy that cannot be made, a refused rename, two real processes on one save, links below both folders, and that the build finds every changed function as `HLE(name)`. The game on Windows 11 with an RTX 4070 Ti SUPER: the run under Measurements. The Windows game of that run was built from this code with llvm-mingw 20261104 (before the rebase). For Linux, `host/nn_fs.c` and `host/posix/win32_posix.c` compile whole with gcc 15.2 (`-Wall -Wextra`) in the new check, and the Linux move in `host/hos_main.c` in `tests/test_linux_saves_move.py`; no full Linux game was built. **Not tested:** frame times around a save against main. A real power cut or reset in the middle of a save (the checks stop the process at those points instead). The game on Linux. A save folder on a network drive or under a cloud sync program. A second copy of the game on Windows (checked on Linux with two processes; on Windows read in the source only). **Must be tested:** - Windows, any GPU: play through several area changes, expecting no new hitch at an autosave against main (by hand: present intervals around the `fs: save: published` lines with `HOS_FS_TRACE=1`; I will post a main-against-PR run) - Linux, any GPU: play through two area changes and quit, start again and continue, expecting the newest save to load and `fs: save: published 3 files` lines in the log (by hand) - Windows, any GPU: end the game from the task manager right after an area change, start again, expecting the save list as it was before or after that save, never a broken entry (by hand) ## Risks **What could break:** saving, for everyone. A fault here could keep saves from reaching the save folder or keep the game from starting with one. The ways out built in: any failure to set up the working copy mounts the save folder in place as before; a journal that cannot be replayed is moved aside and play goes on; a `Commit` that fails returns an error to the game and leaves the last good save alone. The publish adds about 14 ms on the game's save thread per save on the test PC. **Turning it off:** revert the commit. There is no switch; a save folder written by this change is an ordinary save folder, so main reads it as it is. **Compatibility:** saves keep their place and format. A new folder `save-work` appears beside `save` in the user folder; it can be deleted while the game is closed. Progress the game wrote without a `Commit` is no longer kept at the next start; the game commits every save (13 of 13 in the trace). Tools that copy saves should copy `save` only. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated.
fix(fs): a save reaches the save folder whole, at Commit
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 14s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
e7e7e36805
The save mount wrote in place and Commit did nothing. The game saves by
opening each file, setting its size to 0, writing it and closing it
(progress.sav, option.sav, caption.sav), then calls Commit. A write that
failed part way, or a game or PC stopped between the resize and the
Commit, left an empty or mixed file where the last good save was.

The game now writes into a working copy (user/save-work/<uid>). Commit
stages the changed files beside their targets in user/save/<uid>, writes
a journal and renames them into place; a journal left by a stop in the
middle is replayed at the next mount. A file whose write failed is put
back from the committed copy when it is closed. What was not committed is
gone at the next mount, as on the console. A second running copy of the
game on the same save writes the save folder in place, as before.
HumanBean force-pushed fix/save-staged-commit from e7e7e36805
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 14s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 0f30a75f15
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 8s
CI / Conventional Commit title (pull_request) Successful in 6s
CI / Workflow lint (actionlint) (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 10s
Third-party parts / As their notes say (pull_request) Successful in 18s
Website / Website on Cloudflare (pull_request_target) Has been skipped
2026-11-15 18:41:48 +00:00
Compare
Author
Contributor

Measured on Windows 11, RTX 4070 Ti SUPER, Ryzen 7 9800X3D, no window, the game at its 60 fps. Main 225c37f8 against this branch e7e7e368, both with main's renderer DLL, in turn (main, PR, main, PR). The route is a scripted adult walk of about nine minutes with four teleports (Graveyard, Kakariko Village, Hyrule Field, Gerudo Valley) and 13 autosaves. HOS_PRESENT_TRACE gave the present intervals; a file watcher on the user folder gave each save's time on the same clock.

Frames around a save (from 0.1 s before the first file change of a save to 0.4 s after the last):

Run Saves Frames Worst Over 25 ms Over 50 ms
main 1 13 417 65 ms 1 1
main 2 13 417 30 ms 2 0
PR 1 15 806 34 ms 6 0
PR 2 15 775 38 ms 6 0

The PR's windows are longer because they hold the staged writes and then the Commit. The 26 Commits with files took 11.4 to 14.9 ms each (13.1 ms mean), on the game's save thread.

The first 229 s of the route, where all four runs do the same thing:

Run Frames 99th percentile Over 25 ms Over 50 ms Over 100 ms
main 1 13501 18.34 ms 44 18 7
PR 1 13464 18.48 ms 48 18 9
main 2 13481 18.39 ms 47 16 8
PR 2 13487 18.28 ms 35 16 9

After 230 s the runs are not comparable as wholes: in both PR runs Link's walk through the Graveyard goes another way than in both main runs (the PR runs get one more autosave at 254 s and load more actors), so the later counts differ with the path. The inputs are timed by the clock, and I have not yet shown whether that is the route reacting to a frame of timing or something this change does. I am leaving WIP on until I have.

A stop in the middle of a save (PR): the game was ended at the first change in save-work of the third save. The save folder was byte for byte what it was before that save (14 files, same hashes), save-work held the half-made save, and no staged or journal file was left. On the next start the game read the save folder's save and save-work matched it again.

Not tested: Linux play.

Measured on Windows 11, RTX 4070 Ti SUPER, Ryzen 7 9800X3D, no window, the game at its 60 fps. Main 225c37f8 against this branch e7e7e368, both with main's renderer DLL, in turn (main, PR, main, PR). The route is a scripted adult walk of about nine minutes with four teleports (Graveyard, Kakariko Village, Hyrule Field, Gerudo Valley) and 13 autosaves. `HOS_PRESENT_TRACE` gave the present intervals; a file watcher on the user folder gave each save's time on the same clock. **Frames around a save** (from 0.1 s before the first file change of a save to 0.4 s after the last): | Run | Saves | Frames | Worst | Over 25 ms | Over 50 ms | |---|---|---|---|---|---| | main 1 | 13 | 417 | 65 ms | 1 | 1 | | main 2 | 13 | 417 | 30 ms | 2 | 0 | | PR 1 | 15 | 806 | 34 ms | 6 | 0 | | PR 2 | 15 | 775 | 38 ms | 6 | 0 | The PR's windows are longer because they hold the staged writes and then the Commit. The 26 Commits with files took 11.4 to 14.9 ms each (13.1 ms mean), on the game's save thread. **The first 229 s of the route**, where all four runs do the same thing: | Run | Frames | 99th percentile | Over 25 ms | Over 50 ms | Over 100 ms | |---|---|---|---|---|---| | main 1 | 13501 | 18.34 ms | 44 | 18 | 7 | | PR 1 | 13464 | 18.48 ms | 48 | 18 | 9 | | main 2 | 13481 | 18.39 ms | 47 | 16 | 8 | | PR 2 | 13487 | 18.28 ms | 35 | 16 | 9 | After 230 s the runs are not comparable as wholes: in both PR runs Link's walk through the Graveyard goes another way than in both main runs (the PR runs get one more autosave at 254 s and load more actors), so the later counts differ with the path. The inputs are timed by the clock, and I have not yet shown whether that is the route reacting to a frame of timing or something this change does. I am leaving WIP on until I have. **A stop in the middle of a save** (PR): the game was ended at the first change in `save-work` of the third save. The save folder was byte for byte what it was before that save (14 files, same hashes), `save-work` held the half-made save, and no staged or journal file was left. On the next start the game read the save folder's save and `save-work` matched it again. Not tested: Linux play.
Member

Thanks for taking this on. A save lost halfway through its write is about the worst bug a player can meet; a working copy with a journal applied at Commit is a clear way to stop it. I read the diff and tested e7e7e368 and its rebase onto main, 0f30a75f (same changed lines, host/nn_fs.c the same file byte for byte), on Linux. In every kill test I made on your head, a save ends whole old or whole new.

Check Result
tests/test_fs_save_commit.py passes; against the merge base's nn_fs.c it fails at case (a), as you wrote
test_guest_copies, test_vcore_fs_open, test_linux_saves_move, test_longshot_saves, test_fs_links pass
whole suite, run_all.py --strict 577 passed, 14 failed, 16 skipped; the merge base 576 passed, 14 failed, 16 skipped. The same 14 fail on both; none is a test this change touches
Windows-target syntax check of the changed fixtures fails on test_vcore_fs_open only (missing _CRT_SECURE_NO_WARNINGS in the fixture), the same as on the merge base; the other drivers skip Windows. host/nn_fs.c compiles for Windows (syntax only)
the game on Linux, killed during its own autosave passes: seven kills (below)

A kill at every file call. One autosave runs through your real nn_fs.c over host/posix/win32_posix.c. The process is stopped before each call that changes the user folder (23 calls in the mount and 38 in the autosave for an overwrite; 56 in all for a first save), then the next start runs and the three files are compared byte for byte with the old and new ones.

stops old / new / mixed or torn, after the next start
merge base, overwrite 13 6 / 0 / 7
your head, overwrite 61 52 / 9 / 0
merge base, first save 34 13 / 0 / 21
your head, first save 56 46 / 10 / 0

Writes cut in half: 32 runs, all old. The next start killed at each of its own calls: 2,894 runs, 2,568 old and 326 new, none mixed or torn. No stray or zero-filled file is left. A second program with random game calls: 6,269 kills, always the tree before or after.

In the real game (built from e7e7e368 and its merge base 225c37f8; killed from outside). A normal autosave goes through the working copy: fs: Commit: 3 files, 3 ops, 0 failed paths, 0 open writers, result 0 (16 and 35 ms in my two complete autosaves). Killed at the first write into the working copy, at the first staged file, or when journal.tmp is made, the next start loads the old save. Killed when the journal is renamed in (step 52), at the first or last apply rename, or when the journal is removed, it loads the new one (all but the last log the replay at the mount). Each time the three files equal the old or new bytes and no stray is left. Both apply kills came after all three renames, so the mixed window is only in the sweep. The merge base killed in its own write keeps caption.sav empty, progress.sav and option.sav new, and the next start leaves it so.

Found (each reproduced against your real nn_fs.c)

  1. host/nn_fs.c:922, :936: when the working copy cannot be made whole (disk nearly full), the half copy stays, the mount writes in place instead, and the half copy takes the room those writes need. With a 304 KB save the merge base tears at up to 32 KB free; your head tears at up to 300 KB, keeps the old save from 304 to 548, and saves from 552. One line after the copy, if (!ok) save_remove(work);, brings it back to the merge base's 32 KB, and your test still passes.
  2. :401, :922: one committed entry whose name save_relative refuses (a:b, x|y, what?, valid on Linux) fails the whole copy, and the session runs in place unprotected. Leave such entries out of the copy, as links are.
  3. :400, :559, :584, :784: a link inside save/<uid> (a slot on another disk) hides that slot from the game and makes every Commit fail, so option.sav is not published either. The merge base followed the link. Mount in place when the copy skips a link.
  4. :906-917: a replay that fails at the mount after a partial apply retires the journal and deletes the staged files, so the save stays half new for good. Keep the journal and mount in place, and a later start can finish it.
  5. :1281-1284: after a failed write whose put-back also failed, the next good rewrite of that file is undone at its CloseFile. Restoring in OpenFile for write would fix it.

Smaller: on Linux the copies lose the source's mode (a 0600 save is 0644 after the first Commit). Between the journal's rename and the last (steps 55 and 56) the folder holds a new caption.sav beside an old progress.sav. Read, not run, on Windows: every reparse point counts as a link (OneDrive placeholders), the journal's rename and delete get no retry, the lock file opens with sharing 0. Whether the game tolerates a non-zero Commit (0x2EE202) I could not read.

Not covered, and a separate change could: the settings files. On main longshot_options.ini is replaced whole by #550, but its new file is not flushed to the disk before the move and a kill leaves its .new behind; language.txt and mouse_sens.txt are written in place, and #729's one-time options copy is a plain CopyFileA. I will take those in their own change, so yours stays one topic.

Rebase: main (f637b42d) has moved since 0f30a75f and now conflicts in host/hos_main.c (a line of the saves-move loop that #557 changed) and tests/test_linux_saves_move.py. Keeping both sides resolves both, and the focused tests pass that way.

Not tested: Windows, apart from your one stop in a save (the forge skipped its Python checks on this head; its Guide screenshots check fails the same way on the base), a power cut, a second copy of the game on a real save.

Your test lets 16 of 28 one-line breakages of nn_fs.c through, six of them removed flushes, which only a check of the flush order sees. If you want them, I will send that check and the kill test for your branch (Linux only).

Thanks for taking this on. A save lost halfway through its write is about the worst bug a player can meet; a working copy with a journal applied at `Commit` is a clear way to stop it. I read the diff and tested e7e7e368 and its rebase onto main, 0f30a75f (same changed lines, `host/nn_fs.c` the same file byte for byte), on Linux. In every kill test I made on your head, a save ends whole old or whole new. | Check | Result | |---|---| | `tests/test_fs_save_commit.py` | passes; against the merge base's `nn_fs.c` it fails at case (a), as you wrote | | `test_guest_copies`, `test_vcore_fs_open`, `test_linux_saves_move`, `test_longshot_saves`, `test_fs_links` | pass | | whole suite, `run_all.py --strict` | 577 passed, 14 failed, 16 skipped; the merge base 576 passed, 14 failed, 16 skipped. The same 14 fail on both; none is a test this change touches | | Windows-target syntax check of the changed fixtures | fails on `test_vcore_fs_open` only (missing `_CRT_SECURE_NO_WARNINGS` in the fixture), the same as on the merge base; the other drivers skip Windows. `host/nn_fs.c` compiles for Windows (syntax only) | | the game on Linux, killed during its own autosave | passes: seven kills (below) | **A kill at every file call.** One autosave runs through your real `nn_fs.c` over `host/posix/win32_posix.c`. The process is stopped before each call that changes the user folder (23 calls in the mount and 38 in the autosave for an overwrite; 56 in all for a first save), then the next start runs and the three files are compared byte for byte with the old and new ones. | | stops | old / new / mixed or torn, after the next start | |---|---|---| | merge base, overwrite | 13 | 6 / 0 / 7 | | your head, overwrite | 61 | 52 / 9 / 0 | | merge base, first save | 34 | 13 / 0 / 21 | | your head, first save | 56 | 46 / 10 / 0 | Writes cut in half: 32 runs, all old. The next start killed at each of its own calls: 2,894 runs, 2,568 old and 326 new, none mixed or torn. No stray or zero-filled file is left. A second program with random game calls: 6,269 kills, always the tree before or after. **In the real game** (built from e7e7e368 and its merge base 225c37f8; killed from outside). A normal autosave goes through the working copy: `fs: Commit: 3 files, 3 ops, 0 failed paths, 0 open writers, result 0` (16 and 35 ms in my two complete autosaves). Killed at the first write into the working copy, at the first staged file, or when `journal.tmp` is made, the next start loads the old save. Killed when the journal is renamed in (step 52), at the first or last apply rename, or when the journal is removed, it loads the new one (all but the last log the replay at the mount). Each time the three files equal the old or new bytes and no stray is left. Both apply kills came after all three renames, so the mixed window is only in the sweep. The merge base killed in its own write keeps `caption.sav` empty, `progress.sav` and `option.sav` new, and the next start leaves it so. **Found** (each reproduced against your real `nn_fs.c`) 1. `host/nn_fs.c:922`, `:936`: when the working copy cannot be made whole (disk nearly full), the half copy stays, the mount writes in place instead, and the half copy takes the room those writes need. With a 304 KB save the merge base tears at up to 32 KB free; your head tears at up to 300 KB, keeps the old save from 304 to 548, and saves from 552. One line after the copy, `if (!ok) save_remove(work);`, brings it back to the merge base's 32 KB, and your test still passes. 2. `:401`, `:922`: one committed entry whose name `save_relative` refuses (`a:b`, `x|y`, `what?`, valid on Linux) fails the whole copy, and the session runs in place unprotected. Leave such entries out of the copy, as links are. 3. `:400`, `:559`, `:584`, `:784`: a link inside `save/<uid>` (a slot on another disk) hides that slot from the game and makes every `Commit` fail, so `option.sav` is not published either. The merge base followed the link. Mount in place when the copy skips a link. 4. `:906-917`: a replay that fails at the mount after a partial apply retires the journal and deletes the staged files, so the save stays half new for good. Keep the journal and mount in place, and a later start can finish it. 5. `:1281-1284`: after a failed write whose put-back also failed, the next good rewrite of that file is undone at its `CloseFile`. Restoring in `OpenFile` for write would fix it. Smaller: on Linux the copies lose the source's mode (a 0600 save is 0644 after the first `Commit`). Between the journal's rename and the last (steps 55 and 56) the folder holds a new `caption.sav` beside an old `progress.sav`. Read, not run, on Windows: every reparse point counts as a link (OneDrive placeholders), the journal's rename and delete get no retry, the lock file opens with sharing 0. Whether the game tolerates a non-zero `Commit` (0x2EE202) I could not read. **Not covered, and a separate change could:** the settings files. On main `longshot_options.ini` is replaced whole by #550, but its new file is not flushed to the disk before the move and a kill leaves its `.new` behind; `language.txt` and `mouse_sens.txt` are written in place, and #729's one-time options copy is a plain `CopyFileA`. I will take those in their own change, so yours stays one topic. **Rebase:** main (f637b42d) has moved since 0f30a75f and now conflicts in `host/hos_main.c` (a line of the saves-move loop that #557 changed) and `tests/test_linux_saves_move.py`. Keeping both sides resolves both, and the focused tests pass that way. **Not tested:** Windows, apart from your one stop in a save (the forge skipped its Python checks on this head; its Guide screenshots check fails the same way on the base), a power cut, a second copy of the game on a real save. Your test lets 16 of 28 one-line breakages of `nn_fs.c` through, six of them removed flushes, which only a check of the flush order sees. If you want them, I will send that check and the kill test for your branch (Linux only).
Contributor

A Steam Deck run, as a tester's report: pass on everything we could reach. No save file is written in place, every kill during a save left the saves whole, and main's controls lose a file each time.

Hardware: Steam Deck OLED, SteamOS 3.9.5 (kernel 7.2.7-valve2), saves on the internal SSD (ext4). Headless over ssh with the control bridge, scratch copies of a save only.
Build: your head 0f30a75f cherry-picked onto an older main (9c9d69ed) that we have a warm Deck build of; host/nn_fs.c, host/posix/win32_posix.c and your test are byte-identical to your head. The save tool's part (scripts/longshot_saves.py) isn't in that build. Control: main 9c9d69ed itself.
Method: strace of the game's file calls with HOS_FS_TRACE=1; the kills are SIGKILL injected by strace on entry to an exact call on an exact path. After each kill the game is started again and every file is checked against the before and after hashes, and the slot list and Continue are checked through the bridge.

The file calls of a save

this PR main
a manual save, new slot 324 ms: rename 5, fsync 12, fdatasync 8; nothing written in place in save/ 216 ms: ftruncate(0) + pwrite64 in place on progress.sav, caption.sav, option.sav; no rename
a manual save over a slot 333 ms, nothing in place 285 ms, in place on the same three
a load (account.sav) written in the work copy only; Commit: 0 files ... result 0 cut to 0 and rewritten in place in save/
start-up 5.5 to 10.6 ms for the copy into save-work/ 0.1 ms

Without strace the two Commits of a save take 20.8 to 26.0 ms each (fs: Commit: 2 files, 2 ops ... result 0 in 26.031 ms, then 1 files ... 20.754 ms). So the cost is about 45 ms a save and under 11 ms at start-up.

One thing worth knowing: the game saves in two Commits: the slot (progress.sav, caption.sav) first, then option.sav, each with its own journal. A kill between them leaves the slot new and option.sav old. That is what the PR promises (each Commit whole), and the game loaded it fine, but "a save" as the player sees it is not one transaction.

Kills during a save (a manual overwrite of a slot), then the next start

kill point on disk after the kill next start result Continue
the write into the work copy nothing staged no replay whole, old loads
after Commit 1, during option.sav's write slot published, option.sav cut to 0 in the work copy only no replay slot new, option.sav old loads
the first staged file's create no staged file no replay whole, old loads
the second staged file's flush both staged staged files removed at the mount whole, old loads
the journal's write both staged, journal temp 0 bytes no replay whole, old loads
the journal's rename both staged, journal temp complete no replay whole, old loads
the first rename into place both staged, journal in place published 2 files in 12.3 ms before the mount whole, new loads
the same, and the replay killed at its first rename as above a third start: published 2 files in 14.4 ms whole, new loads
the second rename one file renamed, one staged published 2 files in 13.4 ms whole, new loads
option.sav's rename (Commit 2) slot new, option.sav staged published 1 files in 12.9 ms whole, new loads
the journal's removal journal only published 2 files in 8.9 ms (finds them done) whole, new loads

Eleven points, eleven passes. No staged file or journal was left after any next start, and none of the PR's failure lines appeared in any run.

main, the same kills between the cut to 0 and the write:

file hit on disk what the player gets
progress.sav 0 bytes the slot is still listed; Continue crashes the game (CRASH: exception 0xc0000005) and it freezes
caption.sav 0 bytes the slot is listed with no scene; Continue loads a different, older slot
option.sav 0 bytes the save loads; option.sav stays empty

Not covered

  • Autosaves. The Market teleport wrote no autosave on our test save, even after 120 s there, so the new-slot autosave path and its kills were not run. Two manual overwrites in one session without strace were fine (four Commits, all result 0).
  • exFAT and FAT. The Deck has no such drive mounted. The publish is a rename() over the existing file, and on those file systems a rename over an existing file is not atomic on disk: a pulled card or a power cut during it can leave neither name. A kill of the game cannot cause that, only a stop of the drive. Neither the description nor docs/saves.md mentions it; one line there would set the right expectation for SD cards.
  • A real power cut; a second running copy of the game; frame times around a save; Game Mode.
  • No fsync of the user/ folder or its parent was seen in the traces (the save folder, the profile folder, the slot folder and save-work are flushed). We don't know that it matters; noting it in case you expected one.

Of the five bugs in mooki's review, none can be triggered by this test (plenty of disk, only the game's own file names, no links in the save, and a kill cannot make a rename or a write fail), so this run says nothing about them either way.

Posted by an AI agent (Claude Code) for zeldaootr.

A Steam Deck run, as a tester's report: **pass on everything we could reach.** No save file is written in place, every kill during a save left the saves whole, and main's controls lose a file each time. **Hardware:** Steam Deck OLED, SteamOS 3.9.5 (kernel 7.2.7-valve2), saves on the internal SSD (ext4). Headless over ssh with the control bridge, scratch copies of a save only. **Build:** your head 0f30a75f cherry-picked onto an older main (9c9d69ed) that we have a warm Deck build of; `host/nn_fs.c`, `host/posix/win32_posix.c` and your test are byte-identical to your head. The save tool's part (`scripts/longshot_saves.py`) isn't in that build. Control: main 9c9d69ed itself. **Method:** `strace` of the game's file calls with `HOS_FS_TRACE=1`; the kills are `SIGKILL` injected by strace on entry to an exact call on an exact path. After each kill the game is started again and every file is checked against the before and after hashes, and the slot list and Continue are checked through the bridge. ### The file calls of a save | | this PR | main | |---|---|---| | a manual save, new slot | 324 ms: `rename` 5, `fsync` 12, `fdatasync` 8; nothing written in place in `save/` | 216 ms: `ftruncate(0)` + `pwrite64` in place on `progress.sav`, `caption.sav`, `option.sav`; no rename | | a manual save over a slot | 333 ms, nothing in place | 285 ms, in place on the same three | | a load (`account.sav`) | written in the work copy only; `Commit: 0 files ... result 0` | cut to 0 and rewritten in place in `save/` | | start-up | 5.5 to 10.6 ms for the copy into `save-work/` | 0.1 ms | Without strace the two Commits of a save take 20.8 to 26.0 ms each (`fs: Commit: 2 files, 2 ops ... result 0 in 26.031 ms`, then `1 files ... 20.754 ms`). So the cost is about 45 ms a save and under 11 ms at start-up. **One thing worth knowing:** the game saves in **two Commits**: the slot (`progress.sav`, `caption.sav`) first, then `option.sav`, each with its own journal. A kill between them leaves the slot new and `option.sav` old. That is what the PR promises (each Commit whole), and the game loaded it fine, but "a save" as the player sees it is not one transaction. ### Kills during a save (a manual overwrite of a slot), then the next start | kill point | on disk after the kill | next start | result | Continue | |---|---|---|---|---| | the write into the work copy | nothing staged | no replay | **whole, old** | loads | | after Commit 1, during `option.sav`'s write | slot published, `option.sav` cut to 0 in the work copy only | no replay | **slot new, `option.sav` old** | loads | | the first staged file's create | no staged file | no replay | **whole, old** | loads | | the second staged file's flush | both staged | staged files removed at the mount | **whole, old** | loads | | the journal's write | both staged, journal temp 0 bytes | no replay | **whole, old** | loads | | the journal's rename | both staged, journal temp complete | no replay | **whole, old** | loads | | the first rename into place | both staged, journal in place | `published 2 files in 12.3 ms` before the mount | **whole, new** | loads | | the same, and the replay killed at its first rename | as above | a third start: `published 2 files in 14.4 ms` | **whole, new** | loads | | the second rename | one file renamed, one staged | `published 2 files in 13.4 ms` | **whole, new** | loads | | `option.sav`'s rename (Commit 2) | slot new, `option.sav` staged | `published 1 files in 12.9 ms` | **whole, new** | loads | | the journal's removal | journal only | `published 2 files in 8.9 ms` (finds them done) | **whole, new** | loads | Eleven points, eleven passes. No staged file or journal was left after any next start, and none of the PR's failure lines appeared in any run. **main, the same kills between the cut to 0 and the write:** | file hit | on disk | what the player gets | |---|---|---| | `progress.sav` | 0 bytes | the slot is still listed; **Continue crashes the game** (`CRASH: exception 0xc0000005`) and it freezes | | `caption.sav` | 0 bytes | the slot is listed with no scene; Continue loads a different, older slot | | `option.sav` | 0 bytes | the save loads; `option.sav` stays empty | ### Not covered - **Autosaves.** The Market teleport wrote no autosave on our test save, even after 120 s there, so the new-slot autosave path and its kills were not run. Two manual overwrites in one session without strace were fine (four Commits, all `result 0`). - **exFAT and FAT.** The Deck has no such drive mounted. The publish is a `rename()` over the existing file, and on those file systems a rename over an existing file is not atomic on disk: a pulled card or a power cut during it can leave neither name. A kill of the game cannot cause that, only a stop of the drive. Neither the description nor `docs/saves.md` mentions it; one line there would set the right expectation for SD cards. - A real power cut; a second running copy of the game; frame times around a save; Game Mode. - No `fsync` of the `user/` folder or its parent was seen in the traces (the save folder, the profile folder, the slot folder and `save-work` are flushed). We don't know that it matters; noting it in case you expected one. Of the five bugs in mooki's review, none can be triggered by this test (plenty of disk, only the game's own file names, no links in the save, and a kill cannot make a rename or a write fail), so this run says nothing about them either way. *Posted by an AI agent (Claude Code) for zeldaootr.*
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 8s
CI / Conventional Commit title (pull_request) Successful in 6s
CI / Workflow lint (actionlint) (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 10s
Third-party parts / As their notes say (pull_request) Successful in 18s
Website / Website on Cloudflare (pull_request_target) Has been skipped
This pull request has changes conflicting with the target branch.
  • host/hos_main.c
  • tests/test_linux_saves_move.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/save-staged-commit:jarynclouatre-fix/save-staged-commit'
git switch 'jarynclouatre-fix/save-staged-commit'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
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
MagicBeanDev/Longshot!607
No description provided.