XGameRuntime: a save update applies all its steps or none #621

Closed
github-bot wants to merge 1 commit from gh-pr/621/head into gh-pr/621/base
Owner

@⁠milas6669 on GitHub · 2026-11-24 02:37 UTC · original
milas6669:xgameruntime-atomic-save-update → main · +188 −23 · 1 files · 1 commits · closed without merging

XGameSaveSubmitUpdate wrote each blob with its own temp-and-rename, so a write that failed halfway left the container with part of the update applied. Every blob is now staged under a ~xcltmp. name first and then renamed in order; if a step fails, the steps already applied are rolled back. write_atomic had no other caller and is removed.

Fixes #324

What is in it

  • gamesave.rs: stage_file, Step, the staged/rollback apply(); one existing test adapted
  • tests a_failing_write_leaves_the_whole_update_undone (fails without the fix) and an_update_applies_its_steps_in_order

Tested

  • RTX 3070, Windows 11 Pro 10.0.26200, MSVC 19.44, Rust 1.100.0, debug build
  • cargo test --workspace -- --test-threads=4: 647 passed, 0 failed, 21 ignored
  • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64)

Regression run

  • not run: no title on this machine to run scripts/smoke.ps1 against

Not tested

  • AMD, a retail title, scripts/smoke.ps1 main vs PR head

AI use

  • Claude Code, Claude Sonnet 5.5: wrote the code, the tests and this description. Reviewed and opened by the person submitting.
**@⁠milas6669** on GitHub · 2026-11-24 02:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/621) `milas6669:xgameruntime-atomic-save-update` → `main` · +188 −23 · 1 files · 1 commits · closed without merging XGameSaveSubmitUpdate wrote each blob with its own temp-and-rename, so a write that failed halfway left the container with part of the update applied. Every blob is now staged under a `~xcltmp.` name first and then renamed in order; if a step fails, the steps already applied are rolled back. `write_atomic` had no other caller and is removed. Fixes #324 **What is in it** - `gamesave.rs`: `stage_file`, `Step`, the staged/rollback `apply()`; one existing test adapted - tests `a_failing_write_leaves_the_whole_update_undone` (fails without the fix) and `an_update_applies_its_steps_in_order` **Tested** - RTX 3070, Windows 11 Pro 10.0.26200, MSVC 19.44, Rust 1.100.0, debug build - `cargo test --workspace -- --test-threads=4`: 647 passed, 0 failed, 21 ignored - SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64) **Regression run** - not run: no title on this machine to run `scripts/smoke.ps1` against **Not tested** - AMD, a retail title, `scripts/smoke.ps1` main vs PR head **AI use** - Claude Code, Claude Sonnet 5.5: wrote the code, the tests and this description. Reviewed and opened by the person submitting.
XGameSaveSubmitUpdate wrote each blob with its own temp-and-rename, so a write
that failed halfway left the container with some of the update applied.

Stage every blob of the update under a ~xcltmp. name first, then rename the
staged files into place in order; if a step fails, the steps already applied
are rolled back. The write_atomic helper had no other caller and is removed.

Fixes #324
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:27:32 +00:00
github-bot closed this pull request 2026-11-26 04:27:32 +00:00
Author
Owner

@⁠milas6669 on GitHub · 2026-11-24 03:22 UTC · original

Closing: #491 (and #543) already cover this and were opened earlier. Please review those instead.

**@⁠milas6669** on GitHub · 2026-11-24 03:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/621#issuecomment-7121028128) Closing: #491 (and #543) already cover this and were opened earlier. Please review those instead.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.