startup: implement XPackageMountWithUiAsync and XPackageMountWithUiResult in xgameruntime #2286

Merged
tedin7 merged 3 commits from upstream-pr/2294 into main 2026-11-25 11:08:48 +00:00
tedin7 commented 2026-11-25 10:28:31 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T10:28:31Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6602394437 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2294). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T10:28:31Z. --- 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.
chatgpt-codex-connector[bot commented 2026-11-25 11:02:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T10:50:30Z.

Review: COMMENTED


💡 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".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6056185021 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2294#pullrequestreview-6056185021). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T10:50:30Z. **Review:** COMMENTED --- <!-- 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>
tedin7 commented 2026-11-25 11:02:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T10:57:43Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6056304910 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2294#pullrequestreview-6056304910). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T10:57:43Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-25 11:02:31 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T10:44:20Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7160106165 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2294#issuecomment-7160106165). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T10:44:20Z. --- 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.
chatgpt-codex-connector[bot commented 2026-11-25 11:02:33 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T10:44:36Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7160111742 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2294#issuecomment-7160111742). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T10:44:36Z. --- <!-- 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>
chatgpt-codex-connector[bot commented 2026-11-25 11:02:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T10:50:31Z.

Code review location: docs/experiments.md; line 12200

@@ -12181,6 +12182,24 @@ returns `E_PENDING` until then without consuming anything, then `S_OK` with one
 handle for `XUserCloseHandle`, once. An untracked block, a second claim or a
 game-save block gets `E_INVALIDARG`. A start that finds no free user handle
 fails with `E_OUTOFMEMORY` and frees its block.
+`XPackageMountWithUiAsync` and `XPackageMountWithUiResult` (part of #870) use the
+same manual-queue contract. The package identifier is validated like
+`XPackageMount` (`E_INVALIDARG`, nothing consumed); a null queue or a queue the
+shim did not make is refused with `E_NOTIMPL`; no UI is ever shown. The mount is
+made before the call returns and the callback fires once on `XTaskQueueDispatch`.
+`XPackageMountWithUiResult` returns `E_PENDING` until then without consuming
+anything, then `S_OK` with one mount handle for `XPackageCloseMountHandle`, once.
+An untracked block, a second claim or a block of another operation gets
+`E_INVALIDARG`; a start with no free mount fails with `E_OUTOFMEMORY` and frees
+its block. `XAsyncGetResultSize` reports one mount handle.
+`xgameruntime_package_async` covers the lifecycle, the in-callback claim, the
+refusals (negative control), the wrong-kind and close guards and mount-table
+exhaustion:
+
+```sh
+ctest --preset dev --no-tests=error -R '^xgameruntime_package_async$' -V

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 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4693793780 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2294#discussion_r4693793780). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T10:50:31Z. **Code review location:** `docs/experiments.md`; line 12200 ~~~~diff @@ -12181,6 +12182,24 @@ returns `E_PENDING` until then without consuming anything, then `S_OK` with one handle for `XUserCloseHandle`, once. An untracked block, a second claim or a game-save block gets `E_INVALIDARG`. A start that finds no free user handle fails with `E_OUTOFMEMORY` and frees its block. +`XPackageMountWithUiAsync` and `XPackageMountWithUiResult` (part of #870) use the +same manual-queue contract. The package identifier is validated like +`XPackageMount` (`E_INVALIDARG`, nothing consumed); a null queue or a queue the +shim did not make is refused with `E_NOTIMPL`; no UI is ever shown. The mount is +made before the call returns and the callback fires once on `XTaskQueueDispatch`. +`XPackageMountWithUiResult` returns `E_PENDING` until then without consuming +anything, then `S_OK` with one mount handle for `XPackageCloseMountHandle`, once. +An untracked block, a second claim or a block of another operation gets +`E_INVALIDARG`; a start with no free mount fails with `E_OUTOFMEMORY` and frees +its block. `XAsyncGetResultSize` reports one mount handle. +`xgameruntime_package_async` covers the lifecycle, the in-callback claim, the +refusals (negative control), the wrong-kind and close guards and mount-table +exhaustion: + +```sh +ctest --preset dev --no-tests=error -R '^xgameruntime_package_async$' -V ~~~~ --- **<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 -->
tedin7 commented 2026-11-25 11:02:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T10:57:43Z.

Code review location: docs/experiments.md; line 12200

@@ -12181,6 +12182,24 @@ returns `E_PENDING` until then without consuming anything, then `S_OK` with one
 handle for `XUserCloseHandle`, once. An untracked block, a second claim or a
 game-save block gets `E_INVALIDARG`. A start that finds no free user handle
 fails with `E_OUTOFMEMORY` and frees its block.
+`XPackageMountWithUiAsync` and `XPackageMountWithUiResult` (part of #870) use the
+same manual-queue contract. The package identifier is validated like
+`XPackageMount` (`E_INVALIDARG`, nothing consumed); a null queue or a queue the
+shim did not make is refused with `E_NOTIMPL`; no UI is ever shown. The mount is
+made before the call returns and the callback fires once on `XTaskQueueDispatch`.
+`XPackageMountWithUiResult` returns `E_PENDING` until then without consuming
+anything, then `S_OK` with one mount handle for `XPackageCloseMountHandle`, once.
+An untracked block, a second claim or a block of another operation gets
+`E_INVALIDARG`; a start with no free mount fails with `E_OUTOFMEMORY` and frees
+its block. `XAsyncGetResultSize` reports one mount handle.
+`xgameruntime_package_async` covers the lifecycle, the in-callback claim, the
+refusals (negative control), the wrong-kind and close guards and mount-table
+exhaustion:
+
+```sh
+ctest --preset dev --no-tests=error -R '^xgameruntime_package_async$' -V

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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4693876881 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2294#discussion_r4693876881). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T10:57:43Z. **Code review location:** `docs/experiments.md`; line 12200 ~~~~diff @@ -12181,6 +12182,24 @@ returns `E_PENDING` until then without consuming anything, then `S_OK` with one handle for `XUserCloseHandle`, once. An untracked block, a second claim or a game-save block gets `E_INVALIDARG`. A start that finds no free user handle fails with `E_OUTOFMEMORY` and frees its block. +`XPackageMountWithUiAsync` and `XPackageMountWithUiResult` (part of #870) use the +same manual-queue contract. The package identifier is validated like +`XPackageMount` (`E_INVALIDARG`, nothing consumed); a null queue or a queue the +shim did not make is refused with `E_NOTIMPL`; no UI is ever shown. The mount is +made before the call returns and the callback fires once on `XTaskQueueDispatch`. +`XPackageMountWithUiResult` returns `E_PENDING` until then without consuming +anything, then `S_OK` with one mount handle for `XPackageCloseMountHandle`, once. +An untracked block, a second claim or a block of another operation gets +`E_INVALIDARG`; a start with no free mount fails with `E_OUTOFMEMORY` and frees +its block. `XAsyncGetResultSize` reports one mount handle. +`xgameruntime_package_async` covers the lifecycle, the in-callback claim, the +refusals (negative control), the wrong-kind and close guards and mount-table +exhaustion: + +```sh +ctest --preset dev --no-tests=error -R '^xgameruntime_package_async$' -V ~~~~ --- 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.
upstream-sync closed this pull request 2026-11-25 12:01:40 +00:00
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
R0Y00/Xbox2Windows!2286
No description provided.