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

Merged
Kokonotcu merged 1 commit from upstream-pr/458 into main 2026-11-24 06:33:22 +00:00
Kokonotcu commented 2026-11-24 05:42:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kokonotcu on 2026-11-24T05:42:40Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5466802631 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/458). Originally posted by [Kokonotcu](https://github.com/Kokonotcu) on 2026-11-24T05:42:40Z. --- 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)
QemmHD commented 2026-11-24 06:33:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T06:33:20Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7124053442 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/458#issuecomment-7124053442). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-24T06:33:20Z. --- 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).
Sign in to join this conversation.
No reviewers
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
ProjectLeonida/mandy!458
No description provided.