fix(xgameruntime): cheaper XGameSave quota and single submit per update #17
No reviewers
Labels
No labels
accessibility
bug
ci
docs
documentation
duplicate
enhancement
fixes issue
good first issue
help wanted
invalid
library request
libs
needs rebase
question
relinker
stale
tools
unblocks title
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Dark3581--AnyBox!17
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/17/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Callimann8 on GitHub · 2026-11-21 12:38 UTC · original
Callimann8:claude/project-thread-ivz8wb→main· +102 −23 · 3 files · 1 commits · merged 2026-11-21 12:45 UTCWhat
Follow-up to #14 for the two non-blocking review points.
Used(behindXGameSaveGetRemainingQuota*and the quota check in submit) no longer loads every container with its blob data. A newStoredBlobBytesopens each.xgsfile, reads the header and each blob's name length and data length, and seeks past the names and data. A file that does not parse still stops with the sameAbxUnsupported.LoadAllandUsedshare aForEachContainerenumeration.XGameSaveUpdate::submittedis nowstd::atomic<bool>and is set withexchange(true)whenXGameSaveSubmitUpdateorXGameSaveSubmitUpdateAsyncis called, not after the write finishes. A second submit (sync or async) or aXGameSaveSubmitBlobWrite/Deletewhile an asynchronous submit is pending now returnsE_GS_HANDLE_EXPIRED, instead of starting a second write or changingchangeswhile the worker reads it. A submit that fails (or an async submit that cannot start) clears the flag, so the update stays usable as before.fix-xgamesave-resubmit.mdrecords the pending-submit behaviour under the existing "behaviour the documentation does not state" entry.Tested
Cross-built
ab_xgameruntimeandfake_titlewith MinGW-w64 (GCC 13, posix threads) on Linux: no errors or warnings.fake_titlegains two checks: a secondXGameSaveSubmitUpdateAsyncwhile the first is pending, and another after it completed, both expectE_GS_HANDLE_EXPIRED. Not run on Windows: the e2e game-save test runs on CI.python tools/check_conventions.pyandpython tools/debt_fold.py --checkpass.Checklist
main; no other open PR implements the same functionspython tools/check_conventions.pypasses (no comments in code, one declaration per export, Conventional Commit subjects)AbxNotImplemented/AbxUnsupported); silent stubs are listed under Silent stubs through a debt fragmentdocs/dev/debt/changes/<branch>.mdE_GS_HANDLE_EXPIREDfrom the public GDK XGameSave documentation; the pending-submit case is not documented and is listed in the debt fragment@Dark3581 on GitHub · 2026-11-21 12:44 UTC · original · approved these changes
Reviewed — looks good
Both follow-ups from #14 are done. The quota walk reads the same layout
Storewrites, and a damaged file still stops with the same report.What I ran
Head
94926ed, based on currentmain(3f460fd). MinGW (WinLibs GCC 15.2 UCRT, Ninja, Release) on Windows 10, clean build directory.Results
e2e_gamesaverepeated.txtandupdate.tmpin the folder are not counted0xFFFFFFFF, blob count0xFFFFFFFFand an empty.xgseach stop asunsupportedinXGameSaveGetRemainingQuota(GameSave.cpp:358), same message asLoadcheck_conventions.pydebt_fold.py --checkFindings
Blocking
None.
Non-blocking
core/libs/tests/FakeTitle.cpp:835: the "while pending" check passes whether the first submit is still running or has already finished, because the flag stays set after a successful submit. That is the right behaviour; the check just does not prove that the pending case is reached. A worker held on a gate, ase2e_asyncdoes, would pin it down, if you want to.GameSave.cpp,XGameSaveCloseUpdate: closing an update while its asynchronous submit is still running frees the update the worker is reading. This was already the case before this PR, and the GDK documentation expects the title to wait for completion first. It's worth a debt line, or a stop, in a later PR.Not verified
On a console title: how the GDK handles a second submit while one is still pending. This is recorded in the debt fragment.
Thanks, this keeps quota checks cheap as saves grow.