startup: implement XUserAddAsync and XUserAddResult in xgameruntime #2201
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!2201
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2201/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@tedin7 on GitHub · 2026-11-25 04:21 UTC · original
tedin7:x2w-w4-xuser-add-async→main· +623 −75 · 11 files · 2 commits · merged 2026-11-25 05:39 UTCPart of #1334
What this unblocks: startup code that signs in the default user through
XUserAddAsync/XUserAddResulton a manual task queue can now complete in the xgameruntime stand-in instead of hittingE_NOTIMPL.Builds on #2179 (manual queue and async slot table) and #2170 (completion-port contract). Public docs: https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/system/xuser/functions/xuseraddasync?view=gdk-2604
Contract:
AddDefaultUserSilentlyorAddDefaultUserAllowingUI, alone. Anything else (None,AllowGuests, combinations) returnsE_NOTIMPL.XTaskQueueCreate. Null or foreign queues returnE_NOTIMPL. A null block returnsE_INVALIDARG. All refusals leave the block and capacity untouched.XUserAddResultreturnsE_PENDINGbeforeXTaskQueueDispatch(without consuming), thenS_OKwith one validXUserHandle, claimed once. Untracked block, second claim, or a game-save block:E_INVALIDARG.E_OUTOFMEMORY, slot and block released.XGameSaveInitializeProviderAsync(kind-tagged); that path is refactored onto the same helpers with unchanged behavior.XUserAddResultis a new table row;xgameruntime_table_check.pynow requires both rows as implemented. The thunk/identity/PLS tests keepXUserAddAsync(None)as anE_NOTIMPLcontrol; the thunk test no longer lists it as a stub.New test:
xgameruntime_user_async(both options, early vs. after-dispatch result, in-callback claim, null callback and in-flight reuse, option/queue/null refusals, wrong-kind result, close guard, user-table exhaustion and recovery).Verification (Linux):
python3 -B tests/xgameruntime_table_check.py-> PASSpython3 -B tests/docs_links_check.py-> PASSpython3 -B tests/run_checks_parallel_check.py-> okxgameruntime_user_async,_gamesave_async,_identity,_thunks,_contracts,_pls_xpackageall PASS (not a Windows result).Win2025 (Build 26100, MSVC 14.44.35207, D3D12 WARP), commit 86939d7d, 3-slot pool:
python3 /root/.local/state/xbox2windows/pipeline/x2w_pipe.py win2025 2201 --force --regex "^xgameruntime_"ctest --preset dev -R "^xgameruntime_": 8/8 passed, 0 skipped.ctest --preset release -R "^xgameruntime_": 8/8 passed, 0 skipped.AI-assisted; commands listed were executed locally.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 04:30 UTC · original · edited 2026-11-25 04:34 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
86939d7ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@tedin7 on GitHub · 2026-11-25 05:31 UTC · original
Rebased onto merged #2200 (
XAsyncGetStatus/XAsyncGetResultSize); heada9ea7b62. Win2025 (MSVC 14.44, D3D12 WARP)python3 x2w_pipe.py win2025 2201 --force --regex "^xgameruntime_": dev 9/9 and release 9/9 passed, zero skips.AI-assisted; commands listed were executed locally.
@R0Y00 on GitHub · 2026-11-25 04:50 UTC · original · reviewed
The default-user options and refusal cases fit the synthetic-user scope. This shares the async table with #2200. Please keep this candidate on hold until the two status queries distinguish operation completion from callback dispatch and the combined fixture can verify the user-handle result size. One useful cross-kind control is to complete save and user-add blocks on one manual queue, observe their separate status/size before dispatch, then claim each typed Result exactly once after dispatch. The existing unsupported options and queue refusals should still leave both blocks untouched.
@R0Y00 on GitHub · 2026-11-25 05:35 UTC · original · approved these changes
Re-reviewed the current author implementation and restored the two additional controls on
769f509a. One Manual/Manual queue carries a user-add block and a save-provider block at the same time. Both status/size queries succeed before dispatch. The callbacks are ordered, each typed Result rejects the other block, and each handle can be claimed once. Strict package preflight still refuses the remaining unimplemented package-mount import. Windows Release xgameruntime suite passed 9/9 with zero skips.