XGameSave: stage all blob writes before renaming (#324) #486

Closed
Grimkaaah wants to merge 1 commit from upstream-pr/491 into main
Grimkaaah commented 2026-11-24 01:00:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Grimkaaah on 2026-11-24T01:00:03Z.


Summary

  • XGameSaveSubmitUpdate / apply now stages every write (display + blobs) to sibling temp files, and only renames them into place after all stages succeed.
  • Deletes run after the renames. A failed stage removes temps and returns E_FAIL without changing the container (GDK all-or-nothing).
  • Unit test: injected failure on the 3rd stage leaves display Old and blob a = old, with no blob b.

Fixes #324

Test plan

  • cargo test -p xcl --lib hle::xgameruntime::gamesave:: (11 passed)
<!-- greyfinch-sync:ivall/xcl:issue:6572167638 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/491). Originally posted by [Grimkaaah](https://github.com/Grimkaaah) on 2026-11-24T01:00:03Z. --- ## Summary - `XGameSaveSubmitUpdate` / `apply` now **stages** every write (display + blobs) to sibling temp files, and only **renames** them into place after all stages succeed. - Deletes run after the renames. A failed stage removes temps and returns `E_FAIL` without changing the container (GDK all-or-nothing). - Unit test: injected failure on the 3rd stage leaves display `Old` and blob `a = old`, with no blob `b`. Fixes #324 ## Test plan - [x] `cargo test -p xcl --lib hle::xgameruntime::gamesave::` (11 passed)
futurepro62 commented 2026-11-24 07:05:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T03:04:04Z.


Tested exact head 60930bb (on its base 2997c9a).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 677 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.

Not tested

  • A retail title or scripts/smoke.ps1 (no title on this machine), AMD, wave64 hardware, a release build.

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7120740102 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/491#issuecomment-7120740102). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T03:04:04Z. --- Tested exact head `60930bb` (on its base `2997c9a`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **677 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. **Not tested** - A retail title or `scripts/smoke.ps1` (no title on this machine), AMD, wave64 hardware, a release build. **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
H0UNDZER0 commented 2026-11-24 07:05:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by H0UNDZER0 on 2026-11-24T03:05:46Z.


Tested on an RTX 5080, release build: pass, 677 passed, 0 failed.

  • Commit 60930bb057093bd7b2d89f1a95ee4d38aacb6aa3, this PR's head as is (on its base 2997c9a), release build.
  • NVIDIA GeForce RTX 5080 16 GB, driver 621.24 (32.0.16.2124), 32-lane waves; Ryzen 7 9700X; Windows 11 Pro 24H2 (26100.9711); Rust 1.100.0 MSVC; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0). No XCL_* variables set.
  • cargo build --release --workspace --locked: OK, with 2 warnings more than main's one: unused import AtomicUsize (gamesave.rs:7, used only under cfg(test)), and write_atomic is never used (gamesave.rs:190).
  • cargo test --workspace --release --no-fail-fast --locked -- --test-threads=4, run twice (the second with --show-output): 677 passed, 0 failed, 41 ignored both times. main 2997c9a gives 676 / 0 / 41 on this PC: the difference is the new failed_submit_leaves_container_untouched, which passes.
  • SKIPPED: the usual 2, gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64).
  • The test title (e2e), its save-storage check included, ends with failures: 0.

Not tested

  • This PR merged onto a newer main. When this was written that was dd2ae9a; git merge-tree showed no conflict.
  • Debug build, retail titles, scripts/smoke.ps1.

AI use: Claude Code (Claude Opus 5.5, Claude Fable 5.2)

<!-- greyfinch-sync:ivall/xcl:comment:7120766456 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/491#issuecomment-7120766456). Originally posted by [H0UNDZER0](https://github.com/H0UNDZER0) on 2026-11-24T03:05:46Z. --- **Tested** on an RTX 5080, release build: **pass**, 677 passed, 0 failed. - Commit `60930bb057093bd7b2d89f1a95ee4d38aacb6aa3`, this PR's head as is (on its base `2997c9a`), release build. - NVIDIA GeForce RTX 5080 16 GB, driver 621.24 (32.0.16.2124), 32-lane waves; Ryzen 7 9700X; Windows 11 Pro 24H2 (26100.9711); Rust 1.100.0 MSVC; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0). No `XCL_*` variables set. - `cargo build --release --workspace --locked`: OK, with 2 warnings more than `main`'s one: unused import `AtomicUsize` (`gamesave.rs:7`, used only under `cfg(test)`), and `write_atomic` is never used (`gamesave.rs:190`). - `cargo test --workspace --release --no-fail-fast --locked -- --test-threads=4`, run twice (the second with `--show-output`): **677 passed, 0 failed, 41 ignored** both times. `main` `2997c9a` gives 676 / 0 / 41 on this PC: the difference is the new `failed_submit_leaves_container_untouched`, which passes. - `SKIPPED`: the usual 2, `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64). - The test title (`e2e`), its save-storage check included, ends with `failures: 0`. **Not tested** - This PR merged onto a newer `main`. When this was written that was `dd2ae9a`; `git merge-tree` showed no conflict. - Debug build, retail titles, `scripts/smoke.ps1`. **AI use:** Claude Code (Claude Opus 5.5, Claude Fable 5.2)
MesshM commented 2026-11-24 07:06:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T05:24:02Z.


Test run of 60930bb057093bd7b2d89f1a95ee4d38aacb6aa3 on AMD RDNA4. I merged it onto current main d208e14 locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 705 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 664 passed, 0 failed, 21 ignored
  • 0 SKIPPED; the gamesave tests pass, atomic_writes_preserve_xcltmp_blobs_and_skip_leftover_temps included.

Review: Staging every write to a sibling temp and renaming only after all stages succeed makes a failed update leave the container as it was, which is what #324 asks for (the GDK's all-or-nothing). The renames themselves are still separate, so a failure between two renames can leave a partial update; that window is much smaller than before but not zero.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

<!-- greyfinch-sync:ivall/xcl:comment:7122911380 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/491#issuecomment-7122911380). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T05:24:02Z. --- Test run of `60930bb057093bd7b2d89f1a95ee4d38aacb6aa3` on AMD RDNA4. I merged it onto current `main` `d208e14` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **705 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 664 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; the `gamesave` tests pass, `atomic_writes_preserve_xcltmp_blobs_and_skip_leftover_temps` included. **Review:** Staging every write to a sibling temp and renaming only after all stages succeed makes a failed update leave the container as it was, which is what #324 asks for (the GDK's all-or-nothing). The renames themselves are still separate, so a failure between two renames can leave a partial update; that window is much smaller than before but not zero. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
upstream-sync closed this pull request 2026-11-24 11:04:46 +00:00
raylitebull commented 2026-11-24 11:05:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-24T10:44:10Z.


Closing as a duplicate of #543 for #324, which passes the PR description check (whereas this PR fails PR description).

<!-- greyfinch-sync:ivall/xcl:comment:7129174918 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/491#issuecomment-7129174918). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-24T10:44:10Z. --- Closing as a duplicate of #543 for #324, which passes the `PR description` check (whereas this PR fails `PR description`).

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
xcl-dev/xcl!486
No description provided.