startup-runtime: first-run setup state is not persisted between runs #1193

Open
opened 2026-11-24 03:29:33 +00:00 by denn0x · 3 comments
denn0x commented 2026-11-24 03:29:33 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-24T03:29:33Z.


Each startup run of a console executable repeats its first-run setup: five setup pages, a legal notices page and a terms page that needs two checkboxes and a confirmation. That adds about two minutes of input to every test run.

Observed (local build of the #1135 stand-ins, -StoragePath on a separate volume):

  • The executable writes its system settings file under the storage path's settings folder, and that file survives between runs.
  • The game-save service is created ("SGameSaveImpl Created" in the debug output), but the cloud-save folders under the storage path (cloudpers, cloudcache) stay empty. One NtCreateFile on the cloudpers folder fails with STATUS_OBJECT_NAME_COLLISION (0xc0000035).
  • So the first-run state (setup completed, terms accepted) most likely goes through the game-save API (XGameSave), and the stand-in does not keep what is written there.

Proposed: make the XGameSave stand-in persist containers and blobs under the storage path (one directory per container, one file per blob), and treat an existing directory as success when it is opened again.

Done when a source-built fixture writes a blob through the XGameSave stand-in, a second process reads the same bytes back, and a startup run started twice in a row skips first-run setup the second time.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6573963761 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1200). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-24T03:29:33Z. --- Each startup run of a console executable repeats its first-run setup: five setup pages, a legal notices page and a terms page that needs two checkboxes and a confirmation. That adds about two minutes of input to every test run. **Observed** (local build of the #1135 stand-ins, `-StoragePath` on a separate volume): - The executable writes its system settings file under the storage path's `settings` folder, and that file survives between runs. - The game-save service is created ("SGameSaveImpl Created" in the debug output), but the cloud-save folders under the storage path (`cloudpers`, `cloudcache`) stay empty. One `NtCreateFile` on the `cloudpers` folder fails with `STATUS_OBJECT_NAME_COLLISION` (0xc0000035). - So the first-run state (setup completed, terms accepted) most likely goes through the game-save API (XGameSave), and the stand-in does not keep what is written there. **Proposed:** make the XGameSave stand-in persist containers and blobs under the storage path (one directory per container, one file per blob), and treat an existing directory as success when it is opened again. **Done when** a source-built fixture writes a blob through the XGameSave stand-in, a second process reads the same bytes back, and a startup run started twice in a row skips first-run setup the second time. AI-assisted (Claude Code).
tedin7 commented 2026-11-24 06:50:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T05:06:09Z.


Claiming this: I will make the XGameSave stand-in in src/startup_stubs/runtime_proxy.cpp keep containers and blobs under the storage path (one directory per container, one file per blob), with a source-built fixture that writes in one process and reads back in a second. I will not claim that this alone makes a startup run skip first-run setup: that is only checked if a fixture can show it. Draft PR to follow.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7122624807 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1200#issuecomment-7122624807). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T05:06:09Z. --- Claiming this: I will make the XGameSave stand-in in `src/startup_stubs/runtime_proxy.cpp` keep containers and blobs under the storage path (one directory per container, one file per blob), with a source-built fixture that writes in one process and reads back in a second. I will not claim that this alone makes a startup run skip first-run setup: that is only checked if a fixture can show it. Draft PR to follow.
R0Y00 commented 2026-11-24 23:03:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T22:43:04Z.


#1976 is on main at 454af100. Windows Release passed both the synthetic persistence and enumeration checks. Closing the final container handle now rejects a new update even while an earlier update pins the name. That earlier update still resolves its original container. Keep this issue open for the independent second-start result. Please record whether persisted setup is actually loaded and the first screen reached on the second run.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7146561798 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1200#issuecomment-7146561798). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T22:43:04Z. --- #1976 is on main at 454af100. Windows Release passed both the synthetic persistence and enumeration checks. Closing the final container handle now rejects a new update even while an earlier update pins the name. That earlier update still resolves its original container. Keep this issue open for the independent second-start result. Please record whether persisted setup is actually loaded and the first screen reached on the second run.
R0Y00 commented 2026-11-25 03:01:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T02:22:29Z.


Synchronous discovery and readback landed in #2159 (815877da). Local Windows Release passed the two-process restart after both synchronous and async submit, and the locked publication case kept a coherent generation. The deliberately unlocked control caught a mixed generation. Keep this open for the actual second-start observation: whether persisted setup is consumed and which screen responds first.

ctest --preset release --no-tests=error -R '^startup_gamesave_read($|_after_async_submit$|_publish_(locked|unlocked)$)' --output-on-failure

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7150640326 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1200#issuecomment-7150640326). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T02:22:29Z. --- Synchronous discovery and readback landed in #2159 (815877da). Local Windows Release passed the two-process restart after both synchronous and async submit, and the locked publication case kept a coherent generation. The deliberately unlocked control caught a mixed generation. Keep this open for the actual second-start observation: whether persisted setup is consumed and which screen responds first. `ctest --preset release --no-tests=error -R '^startup_gamesave_read($|_after_async_submit$|_publish_(locked|unlocked)$)' --output-on-failure`
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows#1193
No description provided.