store: offline *Async slots start and complete their XAsyncBlock with E_FAIL (RT-STORE-ASYNC-COMPLETE) #458

Manually merged
github merged 1 commit from gh-pr/458/head into gh-pr/458/base 2026-11-26 09:01:28 +00:00
Owner

@⁠Kokonotcu on GitHub · 2026-11-24 05:42 UTC · original
Kokonotcu:pr/store-async-complete → main · +55 −16 · 2 files · 1 commits · merged 2026-11-24 06:33 UTC

Claim: RT-STORE-ASYNC-COMPLETE (#14).

What was wrong: the offline XStoreImpl table answers every *Async slot with offline_failure<Slot>. That returns E_FAIL straight away and never starts or completes the caller's XAsyncBlock. A caller that already queued its block and then waits on it (XAsyncGetStatus(block, true), or the completion callback on its task queue) never wakes up: the store call is a silent hang instead of an offline failure.

What changed: each *Async slot except 82 (XStoreShowGiftingUIAsync, whose block position I have not confirmed; it stays as before) now uses offline_failure_async<Slot, AsyncArg>. It finds the block by its position in that function's GDK signature and runs it through XAsyncRun with a work callback that returns E_FAIL. The block starts, completes on its queue, and XAsyncGetStatus reports E_FAIL. A null block returns E_POINTER.

The matching *Result / *ResultSize slots keep returning E_FAIL, so a caller reading the result after completion gets the same offline answer as before.

Block position per slot (GDK XStore.h): 33(3), 35(5), 37(4), 40(4), 43(5), 49(5), 51(2), 53(6), 58(4), 60(4), 62(4), 71(3), 73(4), 75(3). Slot 53 takes its block as the 6th argument, which is passed on the stack, and the test covers that case.

Tests (xgameruntime_store_test, new checks):

  • slots 49 (block 5th), 51 (block 2nd) and 53 (block 6th, on the stack) each get a real XAsyncBlock, which finishes with XAsyncGetStatus(..., true) == E_FAIL;
  • slot 50 (a Result) still returns E_FAIL.

Tested on Windows 10, i7-11800H, RTX 3080 Laptop (no GPU needed), on main 8f481cf16: xgameruntime_store passes (27 checks).

🤖 Generated with Claude Code

**@⁠Kokonotcu** on GitHub · 2026-11-24 05:42 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/458) `Kokonotcu:pr/store-async-complete` → `main` · +55 −16 · 2 files · 1 commits · merged 2026-11-24 06:33 UTC Claim: RT-STORE-ASYNC-COMPLETE (#14). **What was wrong:** the offline `XStoreImpl` table answers every `*Async` slot with `offline_failure<Slot>`. That returns `E_FAIL` straight away and never starts or completes the caller's `XAsyncBlock`. A caller that already queued its block and then waits on it (`XAsyncGetStatus(block, true)`, or the completion callback on its task queue) never wakes up: the store call is a silent hang instead of an offline failure. **What changed:** each `*Async` slot except 82 (`XStoreShowGiftingUIAsync`, whose block position I have not confirmed; it stays as before) now uses `offline_failure_async<Slot, AsyncArg>`. It finds the block by its position in that function's GDK signature and runs it through `XAsyncRun` with a work callback that returns `E_FAIL`. The block starts, completes on its queue, and `XAsyncGetStatus` reports `E_FAIL`. A null block returns `E_POINTER`. The matching `*Result` / `*ResultSize` slots keep returning `E_FAIL`, so a caller reading the result after completion gets the same offline answer as before. Block position per slot (GDK `XStore.h`): 33(3), 35(5), 37(4), 40(4), 43(5), 49(5), 51(2), 53(6), 58(4), 60(4), 62(4), 71(3), 73(4), 75(3). Slot 53 takes its block as the 6th argument, which is passed on the stack, and the test covers that case. **Tests (`xgameruntime_store_test`, new checks):** - slots 49 (block 5th), 51 (block 2nd) and 53 (block 6th, on the stack) each get a real `XAsyncBlock`, which finishes with `XAsyncGetStatus(..., true) == E_FAIL`; - slot 50 (a `Result`) still returns `E_FAIL`. Tested on Windows 10, i7-11800H, RTX 3080 Laptop (no GPU needed), on `main` `8f481cf16`: `xgameruntime_store` passes (27 checks). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The offline XStore table returned E_FAIL synchronously without ever starting the caller's XAsyncBlock, so a title that waits on the block (XAsyncGetStatus wait=true) or on its completion callback hung forever. Each *Async slot now locates its block by argument position and runs it through XAsyncRun, failing with E_FAIL; the Result partners keep returning E_FAIL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:01:27 +00:00
github manually merged commit 1c69700851 into gh-pr/458/base 2026-11-26 09:01:28 +00:00
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 06:33 UTC · original

Merging. Why merged: the XGameRuntime store slots find their XAsyncBlock argument at the right position.
Why it's good: security-reviewed (runtime shim only). Built with VS 2022 + Ninja on main 8f481cf plus this PR and ran ctest: xgameruntime_store_test 24 -> 27 checks, 0 failures; all 13 XAsyncBlock positions checked against the GDK signatures. Nit for later: the comment says a4-a6 come from the 32-byte home area, but for slots with fewer arguments they're read from the caller's frame beyond it (harmless, they're unused).

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-24 06:33 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/458#issuecomment-7124053442) Merging. Why merged: the XGameRuntime store slots find their XAsyncBlock argument at the right position. Why it's good: security-reviewed (runtime shim only). Built with VS 2022 + Ninja on main 8f481cf plus this PR and ran ctest: xgameruntime_store_test 24 -> 27 checks, 0 failures; all 13 XAsyncBlock positions checked against the GDK signatures. Nit for later: the comment says a4-a6 come from the 32-byte home area, but for slots with fewer arguments they're read from the caller's frame beyond it (harmless, they're unused). AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.