XGameSave: five fixes, built and tested on Windows (replaces #461) #470

Open
github-bot wants to merge 5 commits from github-bot/gh-470 into main AGit
Owner

@⁠GiovanniFadanelli on GitHub · 2026-11-27 14:22 UTC · original
GiovanniFadanelli:fixes/saves-tested → main · +166 −14 · 1 files · 5 commits · open

Replaces #461 (zocram4cc). The same five commits, unchanged, with their original authors (EatCodeSleep2, quaternion, DocBlack89, Duff, towiice): validate a save's blob count before reading it, refuse a second change of one blob in an update, keep a quota excess across replacements, null the handle on a failed create, and abort the legacy container migration when a blob read fails.

Testing (Windows 11, RX 9070 XT, native MSVC 1.98.1; base 126acb35 vs this head)

  • cargo check (gpu, hle, loader, shader, victory, --all-targets): rc 0 at base and head.
  • victory-hle lib (--test-threads 1): 155 / 0 / 2 ign at base, 158 / 0 / 2 ign at head. The three new GDK tests run and pass (a_failed_create_leaves_a_null_handle, migration_aborts_without_deleting_old_when_a_blob_cannot_be_read, replacements_do_not_hide_an_existing_quota_excess).
  • Red first, run on the same five diffs in the megafork branch: each test fails with its fix reverted and passes with it. The blob-count and duplicate-blob fixes extend saves_persist_across_providers.
  • victory-gpu, loader, victory and shader are unchanged from base (the PR touches only xgamesave.rs).
  • clippy and the shader-suite crash on RDNA 4 are pre-existing on main (see #469).

Not verified in game. AI-assisted testing; the code is the original authors'.

🤖 Generated with Claude Code

**@⁠GiovanniFadanelli** on GitHub · 2026-11-27 14:22 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/470) `GiovanniFadanelli:fixes/saves-tested` → `main` · +166 −14 · 1 files · 5 commits · open Replaces #461 (zocram4cc). The same five commits, unchanged, with their original authors (EatCodeSleep2, quaternion, DocBlack89, Duff, towiice): validate a save's blob count before reading it, refuse a second change of one blob in an update, keep a quota excess across replacements, null the handle on a failed create, and abort the legacy container migration when a blob read fails. ### Testing (Windows 11, RX 9070 XT, native MSVC 1.98.1; base 126acb35 vs this head) - `cargo check` (gpu, hle, loader, shader, victory, `--all-targets`): rc 0 at base and head. - victory-hle lib (`--test-threads 1`): 155 / 0 / 2 ign at base, 158 / 0 / 2 ign at head. The three new GDK tests run and pass (`a_failed_create_leaves_a_null_handle`, `migration_aborts_without_deleting_old_when_a_blob_cannot_be_read`, `replacements_do_not_hide_an_existing_quota_excess`). - Red first, run on the same five diffs in the megafork branch: each test fails with its fix reverted and passes with it. The blob-count and duplicate-blob fixes extend `saves_persist_across_providers`. - victory-gpu, loader, victory and shader are unchanged from base (the PR touches only `xgamesave.rs`). - clippy and the shader-suite crash on RDNA 4 are pre-existing on main (see #469). Not verified in game. AI-assisted testing; the code is the original authors'. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
XGameSave permits only one write or delete per blob in an update. WriteBlob and DeleteBlob accepted repeats and submit silently kept the last one, so a title could pass locally but fail on a console. Refuse a second change to a blob already in the update, update the existing test that relied on write-then-delete, and keep the first change.
Keep existing quota excess in the accounting when replacing blobs. Cover quota recovery boundaries, deletions and disk-space errors with a pure regression. AI-assisted.
XGameSaveCreateContainer, XGameSaveCreateUpdate and
XGameSaveInitializeProviderResult left the title's handle untouched when
they failed. The GDK documents those handles as null on failure, and
its own sample closes them on that basis ("if (containerContext)
XGameSaveCloseContainer(...)" on a variable it never initialized), so
a failed call made the title close whatever was on its stack: a heap
corruption far from the failure that caused it.

Each of the three now nulls the handle before anything can fail.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 14:27:30 +00:00
Author
Owner

@⁠UwUCammie on GitHub · 2026-11-27 14:40 UTC · original

I reproduced this on linux-wine-pr under Wine 11.22 using the temporary-container test. The original was removed on the old code. With your patch it was kept, no version was committed, and retrying after repair recovered both blobs. I’ve carried the same patch over in borntofrag34/VIctory-7900XTX#13.

**@⁠UwUCammie** on GitHub · 2026-11-27 14:40 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/470#issuecomment-7221076940) I reproduced this on `linux-wine-pr` under Wine 11.22 using the temporary-container test. The original was removed on the old code. With your patch it was kept, no version was committed, and retrying after repair recovered both blobs. I’ve carried the same patch over in borntofrag34/VIctory-7900XTX#13.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/470/head:github-bot/gh-470'
git switch 'github-bot/gh-470'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-470'
git switch 'github-bot/gh-470'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-470'
git switch 'github-bot/gh-470'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-470'
git switch 'main'
git merge --squash 'github-bot/gh-470'
git switch 'main'
git merge --ff-only 'github-bot/gh-470'
git switch 'main'
git merge 'github-bot/gh-470'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.