startup: discover and read committed save containers synchronously #2159

Manually merged
github merged 6 commits from gh-pr/2159/head into gh-pr/2159/base 2026-11-27 00:01:35 +00:00
Owner

@⁠NiiRoZz on GitHub · 2026-11-25 01:53 UTC · original
NiiRoZz:startup/gamesave-read-back → main · +731 −15 · 8 files · 6 commits · merged 2026-11-25 02:19 UTC

Change

This answers the synchronous game-save queries from the persisted store. Until now a caller could write saves but not discover or read them back on a second start. It applies to provider 704c3f58-e629-4cc2-b197-30511b996fe2 and interface 1bfff3af-f14a-40a3-8e35-9ada906593f9; other interface identities keep the empty results.

  • Container lookup (13) and enumeration (14): they call back with the container name, the blob count, the byte total and the modification time. For each container, the count and total come from one list_blobs call under its shared publication lock. No store lock is held while a callback runs. A container created through slot 16 but never submitted exists and is reported with 0 blobs.
  • Blob enumeration (18) and enumeration by name prefix (19): they call back with names and sizes from one list_blobs call. Before this change, slot 19 returned success without calling back, so a populated container looked empty.
  • Synchronous read (20): the whole requested set is read under one shared lock with upstream's read_blobs. A count of 0 means every blob; that case lists and reads under the same lock through list_blobs(..., &payloads, read_if), optional arguments this PR adds to save_store.h. With a count of 0, the needed size is computed from the listing and checked against the capacity before any payload is read. The records are packed with the existing save_blob_pack.h (shared with slots 21 and 22). The caller's buffer is written only on success, so a short buffer, a missing blob or a lock timeout leave it untouched. A closed container handle is refused.
  • Name matching: names are compared case-insensitively, the same way the store's Windows directory and file names behave.
  • Missing container (unverified): a lookup of a name with no container directory returns 0x80830010 without calling back. That code, and the absence of a callback, are not verified against the platform API; the previous stub returned 0. Follow-up issue draft: see below.

This supersedes draft #1334 by rebasing its read side onto current main; its author is credited with Co-authored-by on the commit that carries that code. The persistence and asynchronous read written since then are reused as they are. It reads what the existing save work produces: the persisted store from tedin7 (#1246) and its locked container and blob listing (#1761), and the closed-container rule from avt0m4t48 (#1976).

The four points from the review note on #1334:

  1. Both the new read fixture and the upstream publication tests are kept. The draft's startup_gamesave_read_async_system name is already used on main (startup_gamesave_read_async_{controlled,system}), so that variant is registered as startup_gamesave_read_after_async_submit.
  2. Slot 20 takes one shared publication lock for the entire requested set, with the capacity validated against that snapshot. It uses read_blobs and no process-local mutex.
  3. Enumeration (13/14/18/19) gives a coherent per-container view: names, count and sizes come from one listing under the container's lock.
  4. startup_gamesave_read_publish_locked is a new source-built control with two kinds of case.
    • Paused writer: a second process pauses at each step of a two-blob publication. Slot 20 must then fail with its destination untouched, and a read that waits must return the whole new generation.
    • Racing reader: the generated test copy of save_store.h also gets a reader hook, at each store read and between two blob reads. The hook is null unless this test sets it; production builds keep only the anchor comments. While the reader is stopped there, a second process commits a whole new generation. Slot 20 (by name, and for every blob) and slot 14 must stay on the old generation.
    • startup_gamesave_read_publish_unlocked runs the same checks on the copy whose lock is a no-op and must be caught (reader saw a mixed generation).

The existing restart test stays.

Refs #1200

Verification

Base 6fb434d8, branch head 63d38093 (merges cleanly with origin/main 94337881), Windows 11 x64, MSVC 14.44, Ninja, Release:

cmake -S . -B out\build\pr-read -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=cl -DINTAKE_PYTHON=<repo>\out\pe-env\Scripts\python.exe
cmake --build out\build\pr-read --target <the targets of the tests below>
ctest --test-dir out\build\pr-read --no-tests=error -R '^startup_(gamesave|save|runtime_local)' --output-on-failure

Result: 18 passed, 0 failed, 0 skipped (100% tests passed, 0 tests failed out of 18). The two _system variants and startup_gamesave_read_after_async_submit ran (no 77 skip) on this machine.

Negative controls:

  • With the slot 19 check added but before the slot 19 change, startup_gamesave_read fails with exit code 14.
  • I applied three mutants to save_read.inl and ran startup_gamesave_read_publish_locked against them; each was caught, and the file was then restored:
    • slot 20 calling read_blob once per name: racing named, exit 22 (mixed);
    • a count of 0 listing first and then reading with a separate read_blobs: racing all, exit 21 (new generation);
    • slot 14 taking the byte total from a second listing: racing list, exit 22.
      The paused-writer cases alone pass all three mutants, which is why the racing cases were added.
  • startup_gamesave_read_publish_unlocked passes only through its required failure text: at pause point 0 a read without the lock returns 0x80830008 for a blob that is mid-publication, and at point 1 it returns a mix of the two generations.

Evidence and follow-up

The fixtures are source-built with synthetic payloads (two short preference blobs; two 4096-byte generated blobs per generation). No platform files or captures are used.

An independent two-start check was run locally (counts and codes only):

  • First start on an empty store: 2 containers committed, with 2 blobs each.
  • Second start on that store: save slots 13, 14, 16, 17, 19, 20, 21 and 22 were called. The slot 22 sizes equal the packed sizes of the committed blobs (2 blobs, 1 blob and 2 blobs). The run stopped on a C++ exception that also occurs on main without saves.

This shows the stand-in returns committed data on a restart. It does not establish full-game startup.

Assumptions and follow-up:

  • Slot numbers and argument layouts follow the public header order. They are checked against the logged argument shapes, not against a platform reference.
  • Slots 12 and 15 still report nothing.
  • The missing-container result (0x80830010, no callback) needs a platform check. A follow-up issue proposes how to pin it with a fixture.

AI-assisted (Claude Code).

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed (docs/startup-runtime.md).
  • I did not include game files, dumps, distribution links or secrets.

🤖 Generated with Claude Code

**@⁠NiiRoZz** on GitHub · 2026-11-25 01:53 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2159) `NiiRoZz:startup/gamesave-read-back` → `main` · +731 −15 · 8 files · 6 commits · merged 2026-11-25 02:19 UTC ## Change This answers the synchronous game-save queries from the persisted store. Until now a caller could write saves but not discover or read them back on a second start. It applies to provider `704c3f58-e629-4cc2-b197-30511b996fe2` and interface `1bfff3af-f14a-40a3-8e35-9ada906593f9`; other interface identities keep the empty results. - **Container lookup (13) and enumeration (14):** they call back with the container name, the blob count, the byte total and the modification time. For each container, the count and total come from one `list_blobs` call under its shared publication lock. No store lock is held while a callback runs. A container created through slot 16 but never submitted exists and is reported with 0 blobs. - **Blob enumeration (18) and enumeration by name prefix (19):** they call back with names and sizes from one `list_blobs` call. Before this change, slot 19 returned success without calling back, so a populated container looked empty. - **Synchronous read (20):** the whole requested set is read under one shared lock with upstream's `read_blobs`. A count of 0 means every blob; that case lists and reads under the same lock through `list_blobs(..., &payloads, read_if)`, optional arguments this PR adds to `save_store.h`. With a count of 0, the needed size is computed from the listing and checked against the capacity before any payload is read. The records are packed with the existing `save_blob_pack.h` (shared with slots 21 and 22). The caller's buffer is written only on success, so a short buffer, a missing blob or a lock timeout leave it untouched. A closed container handle is refused. - **Name matching:** names are compared case-insensitively, the same way the store's Windows directory and file names behave. - **Missing container (unverified):** a lookup of a name with no container directory returns `0x80830010` without calling back. That code, and the absence of a callback, are **not verified** against the platform API; the previous stub returned 0. Follow-up issue draft: see below. This supersedes draft #1334 by rebasing its read side onto current `main`; its author is credited with `Co-authored-by` on the commit that carries that code. The persistence and asynchronous read written since then are reused as they are. It reads what the existing save work produces: the persisted store from tedin7 (#1246) and its locked container and blob listing (#1761), and the closed-container rule from avt0m4t48 (#1976). The four points from the review note on #1334: 1. Both the new read fixture and the upstream publication tests are kept. The draft's `startup_gamesave_read_async_system` name is already used on `main` (`startup_gamesave_read_async_{controlled,system}`), so that variant is registered as `startup_gamesave_read_after_async_submit`. 2. Slot 20 takes one shared publication lock for the entire requested set, with the capacity validated against that snapshot. It uses `read_blobs` and no process-local mutex. 3. Enumeration (13/14/18/19) gives a coherent per-container view: names, count and sizes come from one listing under the container's lock. 4. `startup_gamesave_read_publish_locked` is a new source-built control with two kinds of case. - Paused writer: a second process pauses at each step of a two-blob publication. Slot 20 must then fail with its destination untouched, and a read that waits must return the whole new generation. - Racing reader: the generated test copy of `save_store.h` also gets a reader hook, at each store read and between two blob reads. The hook is null unless this test sets it; production builds keep only the anchor comments. While the reader is stopped there, a second process commits a whole new generation. Slot 20 (by name, and for every blob) and slot 14 must stay on the old generation. - `startup_gamesave_read_publish_unlocked` runs the same checks on the copy whose lock is a no-op and must be caught (`reader saw a mixed generation`). The existing restart test stays. Refs #1200 ## Verification Base `6fb434d8`, branch head `63d38093` (merges cleanly with origin/main `94337881`), Windows 11 x64, MSVC 14.44, Ninja, Release: ``` cmake -S . -B out\build\pr-read -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=cl -DINTAKE_PYTHON=<repo>\out\pe-env\Scripts\python.exe cmake --build out\build\pr-read --target <the targets of the tests below> ctest --test-dir out\build\pr-read --no-tests=error -R '^startup_(gamesave|save|runtime_local)' --output-on-failure ``` Result: 18 passed, 0 failed, 0 skipped (`100% tests passed, 0 tests failed out of 18`). The two `_system` variants and `startup_gamesave_read_after_async_submit` ran (no 77 skip) on this machine. Negative controls: - With the slot 19 check added but before the slot 19 change, `startup_gamesave_read` fails with exit code 14. - I applied three mutants to `save_read.inl` and ran `startup_gamesave_read_publish_locked` against them; each was caught, and the file was then restored: - slot 20 calling `read_blob` once per name: racing named, exit 22 (mixed); - a count of 0 listing first and then reading with a separate `read_blobs`: racing all, exit 21 (new generation); - slot 14 taking the byte total from a second listing: racing list, exit 22. The paused-writer cases alone pass all three mutants, which is why the racing cases were added. - `startup_gamesave_read_publish_unlocked` passes only through its required failure text: at pause point 0 a read without the lock returns `0x80830008` for a blob that is mid-publication, and at point 1 it returns a mix of the two generations. ## Evidence and follow-up The fixtures are source-built with synthetic payloads (two short preference blobs; two 4096-byte generated blobs per generation). No platform files or captures are used. An independent two-start check was run locally (counts and codes only): - **First start on an empty store:** 2 containers committed, with 2 blobs each. - **Second start on that store:** save slots 13, 14, 16, 17, 19, 20, 21 and 22 were called. The slot 22 sizes equal the packed sizes of the committed blobs (2 blobs, 1 blob and 2 blobs). The run stopped on a C++ exception that also occurs on `main` without saves. This shows the stand-in returns committed data on a restart. It does not establish full-game startup. Assumptions and follow-up: - Slot numbers and argument layouts follow the public header order. They are checked against the logged argument shapes, not against a platform reference. - Slots 12 and 15 still report nothing. - The missing-container result (`0x80830010`, no callback) needs a platform check. A follow-up issue proposes how to pin it with a fixture. AI-assisted (Claude Code). ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed (`docs/startup-runtime.md`). - [x] I did not include game files, dumps, distribution links or secrets. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
For the public save interface identity, container lookup (13), container enumeration (14) and blob
enumeration (18) call back with committed metadata, and the synchronous read (20) packs records,
names and payloads into the caller's buffer. Every answer comes from the store's shared publication
lock: slot 20 reads the requested set with read_blobs (a count of 0 lists and reads under one lock
through list_blobs) and checks the capacity against that snapshot before writing anything. Other
interface identities keep the empty results.

Based on the read side of draft #1334, rebased onto the persistence that merged since.

Co-authored-by: Royoo <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The stub returned success without calling back, so a populated container looked empty to a caller
that asks for one blob by prefix. Slot 19 now uses slot 18's single listing and keeps the blobs
whose names start with the prefix, compared case-insensitively because the store's blob names are
Windows file names. The read fixture checks it with a prefix in another case; before this change
that check fails (exit 14).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
startup_gamesave_read_publish_{locked,unlocked} are built from the same generated publication copies
of the store headers as startup_gamesave_publish. A second process pauses at each step of a two-blob
publication. Slot 20, by name and for every blob, must then fail with its destination untouched, and
a read that waits must return the whole new generation. The copy whose lock does nothing must be
caught with a mixed or incomplete generation.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The paused-writer cases could not tell one shared lock per call from one lock per blob: the writer
pauses while holding the exclusive lock, so both readers wait. The generated test copy of
save_store.h now also gets a reader hook (null unless startup_gamesave_read_publish sets it;
production keeps only the anchor comments) between two blob reads and at each store read. There a
second process commits a whole new generation, and slot 20 (by name and for every blob) and slot 14
must stay on the old one.

Also from review: slot 20 packs through save_blob_pack.h; a count of 0 checks the needed size
from the listing against the capacity under the same lock before reading payloads; the read fixture
checks that slot 13 does not call back for an absent name, that no store lock is held during a slot
18 callback, a count-0 short buffer, and that slots 18-20 refuse a closed handle; proxy_query keeps
one cached proxy per interface kind instead of allocating one per alternating query.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The racing cases now fail when the reader never reached the store read seam, and for slot 20 when
it never stopped between two blob reads, so a read path that bypasses the hook cannot pass.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:01:28 +00:00
github manually merged commit 8aa0244bcb into gh-pr/2159/base 2026-11-27 00:01:35 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-25 02:16 UTC · original

I kept the existing empty result for an absent container instead of assigning an undocumented platform HRESULT. The local Windows Release selection passed 4/4: synchronous and async-submitted restart readbacks, the locked publication test, and the unlocked mixed-generation control. The published read and enumeration paths remain covered. The platform missing-name HRESULT can be compared independently if a native result becomes available.

**@⁠R0Y00** on GitHub · 2026-11-25 02:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2159#issuecomment-7150511710) I kept the existing empty result for an absent container instead of assigning an undocumented platform HRESULT. The local Windows Release selection passed 4/4: synchronous and async-submitted restart readbacks, the locked publication test, and the unlocked mixed-generation control. The published read and enumeration paths remain covered. The platform missing-name HRESULT can be compared independently if a native result becomes available.
Author
Owner

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

Review of head 63d38093652de9afd8e988f9cfc3fde592c5d49e (comment only, no approval).

Scope read: src/startup_stubs/save_read.inl (new), save_store.h (list_blobs payload/read_if overload and two seams), runtime_proxy.cpp (interface gating), CMakeLists.txt (seam anchors, new tests), docs, tests.

Checked, no problem found

  • Title is neutral; the PR is mergeable; CI is green (Linux Python checks, gfx1013 fixtures, Windows build and test; the /O2 job is skipped).
  • Slot 19 now calls back; before it returned success with nothing. Prefix matching is case-insensitive, like the store's Windows names. A null prefix lists everything.
  • Slot 20 with count 0: listing, size check and payload read all happen under one list_blobs call. read_if runs before any payload is read, and payloads stays empty when it returns false. The caller buffer is written only after every check passes (capacity, writable, alignment).
  • Slots 13/14 take a snapshot with no store lock held during callbacks. A container deleted between the list and the read is skipped (not_found). A container that was created but never submitted is reported with 0 blobs.
  • The interface gate (public_save_interface) keeps other interface identities on the old empty results. The per-kind proxy cache fixes the repeated allocation and log noise.
  • The CMake seam anchors are checked with FATAL_ERROR if they go missing. The seams compile to nothing in the production header.

Findings

  • P1: none.
  • P2: none.
  • nit src/startup_stubs/save_read.inl in blobs(): static_cast<std::uint32_t>(entry.bytes) truncates a blob over 4 GiB. The count in slot 13/14 is guarded (blobs.size() > UINT32_MAX), but the size is not. The platform blob limit is far lower, so this is theoretical. A guard returning e_fail would make it consistent.
  • nit save_read.inl modified_time(): on error it returns the current time, so a failed stat looks like "just modified". Fine for a stand-in, but the comment could say so.

Commands executed locally (Linux worktree at the head SHA)

  • git diff --stat origin/main...HEAD: 8 files, +734 -15.
  • python3 tests/docs_links_check.py: self-test passed, 18 Markdown files, 395 links OK.
  • python3 tests/bidi_controls_check.py: 1427 files, no bidirectional controls.
  • git diff --check origin/main...HEAD: clean.
  • gh pr checks 2159: Windows build/test, Linux Python checks and gfx1013 fixtures pass.
  • x86_64-w64-mingw32-g++ -fsyntax-only tests/startup_gamesave_read.cpp: fails on MSVC-only __try in local_log.h. This is pre-existing and not caused by this PR.

Not done: the new tests need the MSVC Windows toolchain, so I could not run them or a logic mutation on Linux. I did not run the Windows 2025 job, because the CI Windows job already built and ran these tests at this head and the PR touches no shader or HLSL code. A mutation check (for example dropping the fits capacity check or the read_if call) on Windows is still open.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 02:08 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2159#pullrequestreview-6050591342) · **reviewed** Review of head `63d38093652de9afd8e988f9cfc3fde592c5d49e` (comment only, no approval). **Scope read:** `src/startup_stubs/save_read.inl` (new), `save_store.h` (`list_blobs` payload/`read_if` overload and two seams), `runtime_proxy.cpp` (interface gating), `CMakeLists.txt` (seam anchors, new tests), docs, tests. **Checked, no problem found** - Title is neutral; the PR is mergeable; CI is green (Linux Python checks, gfx1013 fixtures, Windows build and test; the /O2 job is skipped). - Slot 19 now calls back; before it returned success with nothing. Prefix matching is case-insensitive, like the store's Windows names. A null prefix lists everything. - Slot 20 with count 0: listing, size check and payload read all happen under one `list_blobs` call. `read_if` runs before any payload is read, and `payloads` stays empty when it returns false. The caller buffer is written only after every check passes (capacity, writable, alignment). - Slots 13/14 take a snapshot with no store lock held during callbacks. A container deleted between the list and the read is skipped (`not_found`). A container that was created but never submitted is reported with 0 blobs. - The interface gate (`public_save_interface`) keeps other interface identities on the old empty results. The per-kind proxy cache fixes the repeated allocation and log noise. - The CMake seam anchors are checked with `FATAL_ERROR` if they go missing. The seams compile to nothing in the production header. **Findings** - P1: none. - P2: none. - nit `src/startup_stubs/save_read.inl` in `blobs()`: `static_cast<std::uint32_t>(entry.bytes)` truncates a blob over 4 GiB. The count in slot 13/14 is guarded (`blobs.size() > UINT32_MAX`), but the size is not. The platform blob limit is far lower, so this is theoretical. A guard returning `e_fail` would make it consistent. - nit `save_read.inl` `modified_time()`: on error it returns the current time, so a failed stat looks like "just modified". Fine for a stand-in, but the comment could say so. **Commands executed locally (Linux worktree at the head SHA)** - `git diff --stat origin/main...HEAD`: 8 files, +734 -15. - `python3 tests/docs_links_check.py`: self-test passed, 18 Markdown files, 395 links OK. - `python3 tests/bidi_controls_check.py`: 1427 files, no bidirectional controls. - `git diff --check origin/main...HEAD`: clean. - `gh pr checks 2159`: Windows build/test, Linux Python checks and gfx1013 fixtures pass. - `x86_64-w64-mingw32-g++ -fsyntax-only tests/startup_gamesave_read.cpp`: fails on MSVC-only `__try` in `local_log.h`. This is pre-existing and not caused by this PR. **Not done:** the new tests need the MSVC Windows toolchain, so I could not run them or a logic mutation on Linux. I did not run the Windows 2025 job, because the CI Windows job already built and ran these tests at this head and the PR touches no shader or HLSL code. A mutation check (for example dropping the `fits` capacity check or the `read_if` call) on Windows is still open. AI-assisted; commands listed were executed locally.
Author
Owner

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

Review of head 8aa0244bcb0c88a9eeb393e4bae8d8fda641c998 (comment only, no approval).

Scope read: save_read.inl (slots 13, 14, 18, 19, 20), the proxy_query / forward routing for the public save interface, the list_blobs payload/read_if extension in save_store.h, the new seams in CMakeLists.txt, and both new tests.

Commands run locally (Linux worktree of the PR head)

  • git diff --stat origin/main...HEAD: 8 files, +731 / -15.
  • python3 tests/docs_links_check.py: self-test passed, 18 Markdown files / 395 links OK.
  • python3 tests/bidi_controls_check.py: self-test passed, 1427 files, no bidirectional controls.
  • git diff --check origin/main...HEAD: clean.
  • gh pr checks: Linux Python checks, Windows build and test, and gfx1013 fixtures are all green. The /O2 job and the chart publish job were skipped.
  • Attempted a local MinGW build of tests/startup_gamesave_read.cpp. It fails because local_log.h uses MSVC __try/__except, so these C++ tests cannot be run on Linux. I did not run them locally and I did not do a mutation run. The only evidence that they pass is the Windows CI job above. I did not request a separate Win2025 run.

Findings

P1: none. P2: none.

What I checked and found correct:

  • The slot 20 capacity checks come before any write to the caller buffer. requested > capacity / sizeof(Blob) is rejected before allocation, and names is validated as readable before the pieces and wanted vectors are sized. A hostile *count is therefore bounded by real memory, and bad_alloc maps to e_outofmemory.
  • For count 0 ("all blobs"), names, sizes and payloads are taken under one list_blobs lock, and the capacity predicate runs before any payload is read. That gives a single-generation snapshot, which is what the publish tests exercise.
  • The callbacks (13, 14, 18, 19) run after the store locks are released (snapshots for 13 and 14; 18 and 19 iterate a local copy). A callback that re-enters the store cannot deadlock.
  • Public-interface gating: by_kind[public_save][index] keeps one cached proxy per interface kind. Other interface revisions keep the old empty answers through save_call. This is consistent with the updated comment in runtime_proxy.cpp and docs/startup-runtime.md.
  • static_cast<std::uint32_t>(entry.bytes) in slots 18/19 cannot truncate, since max_blob_bytes is 64 MiB.

Nits (non-blocking):

  1. save_read.inl, containers(): the container list and each container's list_blobs are separate lock acquisitions, so the enumeration is not one cross-container generation. The not_found skip handles deletions. A one-line note that per-container consistency is the intended guarantee would help.
  2. save_read.inl, modified_time(): on last_write_time failure it returns "now", which can hide an error. A short comment saying that this is deliberate would help.
  3. runtime_proxy.cpp, by_kind cache: it is a plain static array with no lock, as proxies[] already is. This matches existing behavior, but it is worth keeping in mind if proxy queries ever become multi-threaded.
  4. The new CMake seams (store-read, blob-read) are checked by the existing anchor loop, which is good. The test hook is null outside startup_gamesave_read_publish.

Clean-room, MIT and a neutral title look fine. The PR is mergeable.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 02:20 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2159#pullrequestreview-6050732651) · **reviewed** Review of head `8aa0244bcb0c88a9eeb393e4bae8d8fda641c998` (comment only, no approval). **Scope read:** `save_read.inl` (slots 13, 14, 18, 19, 20), the `proxy_query` / `forward` routing for the public save interface, the `list_blobs` payload/`read_if` extension in `save_store.h`, the new seams in `CMakeLists.txt`, and both new tests. **Commands run locally (Linux worktree of the PR head)** - `git diff --stat origin/main...HEAD`: 8 files, +731 / -15. - `python3 tests/docs_links_check.py`: self-test passed, 18 Markdown files / 395 links OK. - `python3 tests/bidi_controls_check.py`: self-test passed, 1427 files, no bidirectional controls. - `git diff --check origin/main...HEAD`: clean. - `gh pr checks`: Linux Python checks, Windows build and test, and gfx1013 fixtures are all green. The `/O2` job and the chart publish job were skipped. - Attempted a local MinGW build of `tests/startup_gamesave_read.cpp`. It fails because `local_log.h` uses MSVC `__try/__except`, so these C++ tests cannot be run on Linux. I did **not** run them locally and I did **not** do a mutation run. The only evidence that they pass is the Windows CI job above. I did not request a separate Win2025 run. **Findings** P1: none. P2: none. What I checked and found correct: - The slot 20 capacity checks come before any write to the caller buffer. `requested > capacity / sizeof(Blob)` is rejected before allocation, and `names` is validated as readable before the `pieces` and `wanted` vectors are sized. A hostile `*count` is therefore bounded by real memory, and `bad_alloc` maps to `e_outofmemory`. - For count 0 ("all blobs"), names, sizes and payloads are taken under one `list_blobs` lock, and the capacity predicate runs before any payload is read. That gives a single-generation snapshot, which is what the publish tests exercise. - The callbacks (13, 14, 18, 19) run after the store locks are released (snapshots for 13 and 14; 18 and 19 iterate a local copy). A callback that re-enters the store cannot deadlock. - Public-interface gating: `by_kind[public_save][index]` keeps one cached proxy per interface kind. Other interface revisions keep the old empty answers through `save_call`. This is consistent with the updated comment in `runtime_proxy.cpp` and `docs/startup-runtime.md`. - `static_cast<std::uint32_t>(entry.bytes)` in slots 18/19 cannot truncate, since `max_blob_bytes` is 64 MiB. Nits (non-blocking): 1. `save_read.inl`, `containers()`: the container list and each container's `list_blobs` are separate lock acquisitions, so the enumeration is not one cross-container generation. The `not_found` skip handles deletions. A one-line note that per-container consistency is the intended guarantee would help. 2. `save_read.inl`, `modified_time()`: on `last_write_time` failure it returns "now", which can hide an error. A short comment saying that this is deliberate would help. 3. `runtime_proxy.cpp`, `by_kind` cache: it is a plain static array with no lock, as `proxies[]` already is. This matches existing behavior, but it is worth keeping in mind if proxy queries ever become multi-threaded. 4. The new CMake seams (`store-read`, `blob-read`) are checked by the existing anchor loop, which is good. The test hook is null outside `startup_gamesave_read_publish`. Clean-room, MIT and a neutral title look fine. The PR is mergeable. AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.