runtime: read a persisted blob through async save slots 21 and 22 #1439
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!1439
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1439/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?
@SimSalabimse on GitHub · 2026-11-24 11:31 UTC · original
SimSalabimse:x2w-gamesave-read-async→main· +656 −9 · 7 files · 2 commits · merged 2026-11-24 12:11 UTCSlots 21 and 22 (
XGameSaveReadBlobDataAsync/XGameSaveReadBlobDataResult) now read committed blobs through the same system XAsync service as slots 28/29 and pack them into the caller's buffer.Fixes #1355
Change
Slot 21 reserves the async block with its own identity (
local XGameSaveReadBlobData). IfXAsyncBeginrejects it, slot 21 returns before reading. Once accepted, it snapshots the named blobs withsave_store().read_blobsunder the existing shared file lock, packs them, and completes with the status and the byte size slot 22 needs. No user service, and no save lock is held acrossXAsyncComplete.The layout is the one from draft #1334 (24-byte records, payload pointer at offset 16, then each name, a NUL and the payload), in a small helper
src/startup_stubs/save_blob_pack.hon top of main'sread_blobs. #1334 is not changed, and itspublication_lock()/entries()are not used. When #1334 lands I can switch this to its helper so there's one copy of the layout.Slot 22: short buffer
0x80830007, missing blob0x80830008, and neither writes the caller's count or bytes. Busy and other storage failures are0x80004005, a bad name is0x80070057. Slots 13, 14, 18 and 20 are unchanged.Verification
Windows 11 26200, MSVC 19.42, commit
bb4272f, Debug (--preset dev) and Release (--preset release), same results in both:ctest --preset dev --no-tests=error -R startup_gamesave -V: 8 tests, 0 failed. Passed persist, publish_locked, publish_unlocked, lock_errors, submit_controlled, read_async_controlled. Skipped submit_system, read_async_system.ctest --preset dev --no-tests=error -R '^startup_gamesave_read_async_' -V: controlled passed, system skipped.ctest --preset dev --no-tests=error -R startup_gamesave_submit_controlled -V: passed.The system variants skipped (exit 77) because
xgameruntime.dllisn't installed here. The system read variant has not run anywhere yet.Evidence and follow-up
New fixture
tests/startup_gamesave_read_async.cppis source-built: one process commits two blobs, a second reads them through 21/22. It checks the callback, required size, count and exact bytes, a missing blob, a short buffer that leaves output unchanged, and two overlapping reads. Docs: Game saves section ofdocs/startup-runtime.md.Follow-up anyone can pick up: run
ctest --preset dev -R '^startup_gamesave_read_async_system$' -Von a PC with the Windows gaming runtime.Checklist
AI-assisted (Grok Build)
@R0Y00 on GitHub · 2026-11-24 12:06 UTC · original
310ad973catches construction failure before reserving the async block. I independently ran Windows Debug and Release: all five persist, submit and read tests passed in each, with no skips. In the system-runtime round a fresh process read back the committed blobs, and the missing result, short output and overlapping blocks were distinguished.@tedin7 on GitHub · 2026-11-24 11:47 UTC · original · reviewed
Reviewed at
bb4272f5:git diff --checkclean.XAsyncBeginprecedessnapshot_read(rejected blocks leave storage untouched),save_lockis released beforeread_blobsandXAsyncComplete,remember_readruns beforeXAsyncComplete(safe for immediate callbacks), and slot 22 returns0x80830007beforeXAsyncGetResulton short buffers without modifying caller memory or consuming the pending result.docs_links_check.py(322 links) andbidi_controls_check.py(1184 files) passed.--preset dev,startup_gamesave_read_async):startup_gamesave_read_async_controlledPASS (0.14s);startup_gamesave_read_async_systemSkipped (77) (capability skip,xgameruntime.dllunavailable)./O2(--preset release,startup_gamesave_read_async):startup_gamesave_read_async_controlledPASS (0.12s);startup_gamesave_read_async_systemSkipped (77).