Discover containers and read committed blobs through the save provider #1334

Open
github-bot wants to merge 2 commits from github-bot/gh-1334 into main AGit
Owner

@⁠R0Y00 on GitHub · 2026-11-24 08:25 UTC · original
R0Y00:codex/gamesave-enumerate-read → main · +1434 −15 · 10 files · 7 commits · draft

Refs #1200. Depends on @⁠tedin7's #1246. Please merge that PR first. Its latest head is 97a63a54 in the author's fork. This branch integrates that commit at 25aa7467. Review only the new change.

On the matched save class/interface pair, slot 13 performs exact container lookup, 14 enumerates containers, 18 enumerates blobs, and 20 reads the committed data. Callbacks run after a metadata snapshot has released the storage lock. The synchronous output contains record headers, terminated names, and payloads inside caller-owned memory. The local store reports its directory name as its display name.

The source-built Windows writer creates a container with a process-generated name, writes two binary preferences, submits and exits. A second process enumerates two containers, chooses the one reporting two blobs, verifies exact lookup, and obtains the names and sizes from blob enumeration. It reads 6 payload bytes in a 74-byte buffer and also checks early stop, a mismatched interface ID and a read-all count of two. A 73-byte buffer returns 0x80830007, and a missing second blob returns 0x80830008. Neither failure changes the supplied output.

The restart test also runs with a system Gaming Runtime immediate queue. A rejected slot 28 leaves slot 20 reporting a missing blob. The same update then commits through slots 28 and 29, and the second process discovers and reads it. On Windows 11 build 26200.9974 both Debug and Release /O2 ran 5/5 tests, with no skips. This exercises the provider vtable and a source-built QueryApiImpl service. The second-start setup behavior in #1200 and asynchronous reads remain open.

cmake --build --preset dev --target startup_stub_gameinput startup_gamesave_submit startup_gamesave_read startup_gamesave_persist
ctest --preset dev --no-tests=error -R '^startup_gamesave_' -V
cmake --build --preset release --target startup_stub_gameinput startup_gamesave_submit startup_gamesave_read startup_gamesave_persist
ctest --preset release --no-tests=error -R '^startup_gamesave_' -V

Microsoft documents the enumeration buffer calculation and synchronous read. XCL's table generated from the public PC GDK supplies the slot and identity cross-check.

**@⁠R0Y00** on GitHub · 2026-11-24 08:25 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1334) `R0Y00:codex/gamesave-enumerate-read` → `main` · +1434 −15 · 10 files · 7 commits · draft Refs #1200. Depends on @⁠tedin7's #1246. Please merge that PR first. Its latest head is 97a63a54 in the author's fork. This branch integrates that commit at 25aa7467. [Review only the new change](https://github.com/R0Y00/Xbox2Windows/compare/97a63a54...25aa7467). On the matched save class/interface pair, slot 13 performs exact container lookup, 14 enumerates containers, 18 enumerates blobs, and 20 reads the committed data. Callbacks run after a metadata snapshot has released the storage lock. The synchronous output contains record headers, terminated names, and payloads inside caller-owned memory. The local store reports its directory name as its display name. The source-built Windows writer creates a container with a process-generated name, writes two binary preferences, submits and exits. A second process enumerates two containers, chooses the one reporting two blobs, verifies exact lookup, and obtains the names and sizes from blob enumeration. It reads 6 payload bytes in a 74-byte buffer and also checks early stop, a mismatched interface ID and a read-all count of two. A 73-byte buffer returns 0x80830007, and a missing second blob returns 0x80830008. Neither failure changes the supplied output. The restart test also runs with a system Gaming Runtime immediate queue. A rejected slot 28 leaves slot 20 reporting a missing blob. The same update then commits through slots 28 and 29, and the second process discovers and reads it. On Windows 11 build 26200.9974 both Debug and Release /O2 ran 5/5 tests, with no skips. This exercises the provider vtable and a source-built QueryApiImpl service. The second-start setup behavior in #1200 and asynchronous reads remain open. ```powershell cmake --build --preset dev --target startup_stub_gameinput startup_gamesave_submit startup_gamesave_read startup_gamesave_persist ctest --preset dev --no-tests=error -R '^startup_gamesave_' -V cmake --build --preset release --target startup_stub_gameinput startup_gamesave_submit startup_gamesave_read startup_gamesave_persist ctest --preset release --no-tests=error -R '^startup_gamesave_' -V ``` Microsoft documents the [enumeration buffer calculation](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/system/xgamesave/functions/xgamesaveenumerateblobinfo) and [synchronous read](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/system/xgamesave/functions/xgamesavereadblobdata). XCL's [table generated from the public PC GDK](https://github.com/ivall/xcl/blob/64b3f35599bb7102f55d640e1a791e7d6dd3b175/crates/xcl/src/hle/xgameruntime/gdk_table.rs#L261-L270) supplies the slot and identity cross-check.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:58:59 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 09:09 UTC · original

#1246 is on main at 843f8d4b. The draft conflicts in CMakeLists.txt and save_store.h; please preserve both the new read fixture and the upstream publication tests. In the combined code, slot 20 reads each blob separately under a process-local mutex. Please use one shared publication lock for the entire requested set, including capacity validation against the snapshot. The upstream read_blobs primitive can snapshot an explicit batch. Container/blob enumeration also needs a coherent per-container metadata view. Add a source-built control where a second process publishes between reads; slot 20 should observe one generation or return busy with the destination untouched. The existing restart test remains useful.

**@⁠R0Y00** on GitHub · 2026-11-24 09:09 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1334#issuecomment-7127037529) #1246 is on main at 843f8d4b. The draft conflicts in CMakeLists.txt and save_store.h; please preserve both the new read fixture and the upstream publication tests. In the combined code, slot 20 reads each blob separately under a process-local mutex. Please use one shared publication lock for the entire requested set, including capacity validation against the snapshot. The upstream read_blobs primitive can snapshot an explicit batch. Container/blob enumeration also needs a coherent per-container metadata view. Add a source-built control where a second process publishes between reads; slot 20 should observe one generation or return busy with the destination untouched. The existing restart test remains useful.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 02:58 UTC · original

Claiming a focused slice: XGameSaveInitializeProviderAsync plus XGameSaveInitializeProviderResult in the xgameruntime stand-in (completes through the existing synchronous provider path; XAsyncGetStatus and task queues stay out of scope).

**@⁠tedin7** on GitHub · 2026-11-25 02:58 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1334#issuecomment-7151440870) Claiming a focused slice: XGameSaveInitializeProviderAsync plus XGameSaveInitializeProviderResult in the xgameruntime stand-in (completes through the existing synchronous provider path; XAsyncGetStatus and task queues stay out of scope).
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 10:26 UTC · original

Claiming a focused slice: XGameSaveEnumerateBlobInfo and XGameSaveEnumerateBlobInfoByName in the xgameruntime stand-in (synchronous callback walk over the existing in-process store; container enumeration and async reads stay out of scope).

**@⁠tedin7** on GitHub · 2026-11-25 10:26 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1334#issuecomment-7159691856) Claiming a focused slice: XGameSaveEnumerateBlobInfo and XGameSaveEnumerateBlobInfoByName in the xgameruntime stand-in (synchronous callback walk over the existing in-process store; container enumeration and async reads stay out of scope).
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-28 00:34 UTC · original

The enumeration and synchronous read scope from this draft is on main through #1761 and #2159. In particular, #2159 carries the read-side work and attribution from this draft, and it uses one shared-publication snapshot for the requested set. Main still covers short buffers and missing blobs without modifying the caller's output. Keeping the draft available as a record of the original proposal.

**@⁠R0Y00** on GitHub · 2026-11-28 00:34 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1334#issuecomment-7231018535) The enumeration and synchronous read scope from this draft is on main through #1761 and #2159. In particular, #2159 carries the read-side work and attribution from this draft, and it uses one shared-publication snapshot for the requested set. Main still covers short buffers and missing blobs without modifying the caller's output. Keeping the draft available as a record of the original proposal.
This pull request has changes conflicting with the target branch.
  • CMakeLists.txt
  • docs/startup-runtime.md
  • src/startup_stubs/runtime_proxy.cpp
  • src/startup_stubs/save_read.inl
  • src/startup_stubs/save_store.h
  • tests/startup_gamesave_read.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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