startup: implement XPackageMountWithUiAsync and XPackageMountWithUiResult in xgameruntime #2294

Manually merged
github merged 3 commits from gh-pr/2294/head into gh-pr/2294/base 2026-11-27 00:13:21 +00:00
Owner

@⁠tedin7 on GitHub · 2026-11-25 10:28 UTC · original
tedin7:x2w-w4-xpackage-mount-async → main · +557 −44 · 8 files · 3 commits · merged 2026-11-25 11:08 UTC

Part of #870

What this unblocks: callers of XPackageMountWithUiAsync / XPackageMountWithUiResult get a working manual-queue mount instead of E_NOTIMPL, removing the last explicit stub from the fixture-only xgameruntime table.

Change

  • src/xgameruntime_shim.cpp: XPackageMountWithUiAsync is now an implemented row and a new XPackageMountWithUiResult row is added. Both reuse ProviderAsyncSlot / reserve_async / complete_async (new AsyncKind::package_mount), in the style of #2179 and #2201. The identifier is validated like XPackageMount (E_INVALIDARG, nothing consumed). A null or foreign queue gives E_NOTIMPL. The result returns E_PENDING until the callback was dispatched, then one mount handle once. A second claim, an untracked block or a block of another kind gives E_INVALIDARG. No free mount gives E_OUTOFMEMORY and frees the block. XAsyncGetResultSize reports one mount handle.
  • New tests/xgameruntime_package_async_check.cpp (CTest xgameruntime_package_async): pending/result lifecycle, in-callback claim, double claim, reuse of an in-flight block, invalid identifiers, null block/queue/out pointer (negative control), wrong-kind and close guards against a user-add block, mount-table exhaustion and recovery, sentinel-padded block bytes untouched.
  • tests/xgameruntime_thunks_check.cpp, xgameruntime_contracts_check.cpp, xgameruntime_pls_xpackage_check.cpp, xgameruntime_table_check.py: the old stub negative control now expects E_INVALIDARG for a null block, and the table check requires both rows as implemented.
  • CMakeLists.txt registers the new test; docs/experiments.md documents the contract.

Verification

Linux only (Win2025 WARP dev + release is left to the independent verification stage):

  • python3 -B tests/xgameruntime_table_check.py -> PASS (34 exports, stub=0, duplicate control detected)
  • python3 -B tests/docs_links_check.py -> PASS
  • git diff --check -> clean
  • x86_64-w64-mingw32-g++ -std=c++17 -fsyntax-only -Isrc on src/xgameruntime_shim.cpp and the four touched/new C++ tests -> no errors

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 10:28 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2294) `tedin7:x2w-w4-xpackage-mount-async` → `main` · +557 −44 · 8 files · 3 commits · merged 2026-11-25 11:08 UTC Part of #870 What this unblocks: callers of `XPackageMountWithUiAsync` / `XPackageMountWithUiResult` get a working manual-queue mount instead of `E_NOTIMPL`, removing the last explicit stub from the fixture-only xgameruntime table. ## Change - `src/xgameruntime_shim.cpp`: `XPackageMountWithUiAsync` is now an implemented row and a new `XPackageMountWithUiResult` row is added. Both reuse `ProviderAsyncSlot` / `reserve_async` / `complete_async` (new `AsyncKind::package_mount`), in the style of #2179 and #2201. The identifier is validated like `XPackageMount` (`E_INVALIDARG`, nothing consumed). A null or foreign queue gives `E_NOTIMPL`. The result returns `E_PENDING` until the callback was dispatched, then one mount handle once. A second claim, an untracked block or a block of another kind gives `E_INVALIDARG`. No free mount gives `E_OUTOFMEMORY` and frees the block. `XAsyncGetResultSize` reports one mount handle. - New `tests/xgameruntime_package_async_check.cpp` (CTest `xgameruntime_package_async`): pending/result lifecycle, in-callback claim, double claim, reuse of an in-flight block, invalid identifiers, null block/queue/out pointer (negative control), wrong-kind and close guards against a user-add block, mount-table exhaustion and recovery, sentinel-padded block bytes untouched. - `tests/xgameruntime_thunks_check.cpp`, `xgameruntime_contracts_check.cpp`, `xgameruntime_pls_xpackage_check.cpp`, `xgameruntime_table_check.py`: the old stub negative control now expects `E_INVALIDARG` for a null block, and the table check requires both rows as implemented. - `CMakeLists.txt` registers the new test; `docs/experiments.md` documents the contract. ## Verification Linux only (Win2025 WARP dev + release is left to the independent verification stage): - `python3 -B tests/xgameruntime_table_check.py` -> PASS (34 exports, stub=0, duplicate control detected) - `python3 -B tests/docs_links_check.py` -> PASS - `git diff --check` -> clean - `x86_64-w64-mingw32-g++ -std=c++17 -fsyntax-only -Isrc` on `src/xgameruntime_shim.cpp` and the four touched/new C++ tests -> no errors AI-assisted; commands listed were executed locally.
The last explicit stub becomes a manual-queue async operation: the identifier is validated like XPackageMount, the mount completes before the call returns, the callback fires once on XTaskQueueDispatch, and the result hands over one mount handle exactly once.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:13:20 +00:00
github manually merged commit 24d1ce8ebf into gh-pr/2294/base 2026-11-27 00:13:21 +00:00
Author
Owner

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

Independent verification of head 389fa37c: PASS.

  • Diff audit: XPackageMountWithUiAsync / XPackageMountWithUiResult rows are implemented, with the same async slot lifecycle as the user-add path. The identifier is validated first (E_INVALIDARG, nothing consumed). The result gives E_PENDING until dispatch, then one handle once. A second claim, an untracked block or a wrong-kind block gives E_INVALIDARG. Null out pointer gives E_POINTER. XAsyncGetResultSize reports one mount handle. xgameruntime_thunks_check.cpp and the other checks are updated, and CMakeLists.txt registers xgameruntime_package_async.
  • Hygiene: no model names, no trailers, no private-probe mentions in title, body, commit or code.
  • GitHub CI: Windows build and test, Linux Python checks and gfx1013 fixtures all pass.
  • Win2025 (python3 x2w_pipe.py win2025 2294 --force, default 3-slot pool): dev 10/10 and release 10/10 passed (xgameruntime_package_async, _table, _thunks, _contracts, _pls_xpackage, _user_async, _gamesave_async, _async_status, _identity, _preflight_stub_refused).

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 10:44 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2294#issuecomment-7160106165) Independent verification of head `389fa37c`: PASS. - Diff audit: `XPackageMountWithUiAsync` / `XPackageMountWithUiResult` rows are implemented, with the same async slot lifecycle as the user-add path. The identifier is validated first (`E_INVALIDARG`, nothing consumed). The result gives `E_PENDING` until dispatch, then one handle once. A second claim, an untracked block or a wrong-kind block gives `E_INVALIDARG`. Null out pointer gives `E_POINTER`. `XAsyncGetResultSize` reports one mount handle. `xgameruntime_thunks_check.cpp` and the other checks are updated, and `CMakeLists.txt` registers `xgameruntime_package_async`. - Hygiene: no model names, no trailers, no private-probe mentions in title, body, commit or code. - GitHub CI: Windows build and test, Linux Python checks and gfx1013 fixtures all pass. - Win2025 (`python3 x2w_pipe.py win2025 2294 --force`, default 3-slot pool): dev 10/10 and release 10/10 passed (`xgameruntime_package_async`, `_table`, `_thunks`, `_contracts`, `_pls_xpackage`, `_user_async`, `_gamesave_async`, `_async_status`, `_identity`, `_preflight_stub_refused`). AI-assisted; commands listed were executed locally.
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-25 10:44 UTC · original · edited 2026-11-25 10:50 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T10:50:33.533550Z 389fa37 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-25 10:44 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2294#issuecomment-7160111742) · edited 2026-11-25 10:50 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"389fa37cddf2e0bab8094eb13efe15ed197522fc","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-25T10:50:33.533550Z">2026-11-25T10:50:33.533550Z</relative-time> | `389fa37` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
@ -12221,0 +12234,4 @@
exhaustion:
```sh
ctest --preset dev --no-tests=error -R '^xgameruntime_package_async$' -V
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-25 10:50 UTC · original

P2 Badge Build the new fixture in the reproduction recipe

After pulling this change into an existing dev build and running only the target-specific build recipe at line 12222, xgameruntime_package_async_check remains unbuilt because that recipe lists only the older targets. The cmake --build help describes --target as Build <tgt> instead of default targets. Consequently, this command and the broader ^xgameruntime_ invocation below select the new test but report it as Not Run rather than exercising the implementation. Add xgameruntime_package_async_check to the documented build command.

AGENTS.md reference: AGENTS.md:L262-L263

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-25 10:50 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2294#discussion_r4693793780) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Build the new fixture in the reproduction recipe** After pulling this change into an existing `dev` build and running only the target-specific build recipe at line 12222, `xgameruntime_package_async_check` remains unbuilt because that recipe lists only the older targets. The `cmake --build` help describes `--target` as `Build <tgt> instead of default targets.` Consequently, this command and the broader `^xgameruntime_` invocation below select the new test but report it as **Not Run** rather than exercising the implementation. Add `xgameruntime_package_async_check` to the documented build command. AGENTS.md reference: [AGENTS.md:L262-L263](https://github.com/R0Y00/Xbox2Windows/blob/389fa37cddf2e0bab8094eb13efe15ed197522fc/AGENTS.md#L262-L263) Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
@ -12221,0 +12234,4 @@
exhaustion:
```sh
ctest --preset dev --no-tests=error -R '^xgameruntime_package_async$' -V
Author
Owner

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

Fixed in abffecac: the documented cmake --build --preset dev --target ... command now lists xgameruntime_package_async_check, so the new test is built before ctest -R '^xgameruntime_' runs.

AI-assisted; commands listed were executed locally: git fetch fork, git log --oneline -1 fork/x2w-w4-xpackage-mount-async. Docs-only change; no build run.

**@⁠tedin7** on GitHub · 2026-11-25 10:57 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2294#discussion_r4693876881) Fixed in abffecac: the documented `cmake --build --preset dev --target ...` command now lists `xgameruntime_package_async_check`, so the new test is built before `ctest -R '^xgameruntime_'` runs. AI-assisted; commands listed were executed locally: `git fetch fork`, `git log --oneline -1 fork/x2w-w4-xpackage-mount-async`. Docs-only change; no build run.
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-25 10:50 UTC · original · reviewed

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 389fa37cdd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback".

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-25 10:50 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2294#pullrequestreview-6056185021) · **reviewed** <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `389fa37cdd` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback". </details>
This discussion has been locked. Commenting is limited to contributors.
No description provided.