Skip to content

XGameUi: handle the Xbox Live and account dialogs explicitly, completing with E_NOTIMPL - #2779

Open
timesecay wants to merge 1 commit into
xcl-dev:mainfrom
timesecay:xgameui-refuse-dialogs
Open

timesecay wants to merge 1 commit into
xcl-dev:mainfrom
timesecay:xgameui-refuse-dialogs

Conversation

@timesecay

@timesecay timesecay commented Nov 26, 2026 •

Copy link
Copy Markdown

XGameUi: handle the Xbox Live and account dialogs explicitly, completing with E_NOTIMPL

Seven XGameUi dialog types that need Xbox Live or an account (player picker, profile card, send
game invite, state share, multiplayer activity invite, achievements, web authentication; 17
entry points in all) were unknown slots on XCL's XGameUi class. They are now handled
explicitly: each *Async completes its XAsyncBlock at once with E_NOTIMPL, and each
*Result returns that status.

What is in it

  • crates/xcl/src/hle/xgameruntime/api.rs: ui_refused, ui_refused_fns! and xgameui_refused()
    register the 17 functions on the XGameUi class (built on the existing begin_with and
    empty_result helpers). The class's impls was empty before.
  • api.rs header comment: says which XGameUi dialogs XCL refuses and which still go to the PC runtime.
  • api.rs tests: the new refused_xgameui_dialogs_complete_with_e_notimpl_and_leave_outputs_alone,
    and the old E_NOTIMPL + unimplemented assertion in thunk_protocol_with_xcl_objects_on_pc_queues
    rewritten for the new behaviour.
  • HANDOFF.md (~L1029): its "not implemented in XCL classes" counts are now stale for these
    functions. Left unedited, as the repository rules ask.

The 17 functions

Async entry points (8):
XGameUiShowAchievementsAsync, XGameUiShowPlayerPickerAsync, XGameUiShowPlayerProfileCardAsync,
XGameUiShowSendGameInviteAsync, XGameUiShowStateShareAsync,
XGameUiShowMultiplayerActivityGameInviteAsync, XGameUiShowWebAuthenticationAsync,
XGameUiShowWebAuthenticationWithOptionsAsync

Result / status entry points (9):
XGameUiShowAchievementsResult, XGameUiShowPlayerPickerResultCount, XGameUiShowPlayerPickerResult,
XGameUiShowPlayerProfileCardResult, XGameUiShowSendGameInviteResult, XGameUiShowStateShareResult,
XGameUiShowMultiplayerActivityGameInviteResult, XGameUiShowWebAuthenticationResultSize,
XGameUiShowWebAuthenticationResult

Behaviour

  • Every *Async returns S_OK, completes the block with E_NOTIMPL and delivers the completion
    callback once. It logs XGameRuntime: <name> - no UI offline (completes with E_NOTIMPL).
  • Every *Result returns the call's status (E_NOTIMPL) and does not write its output
    arguments (counts, sizes, player ids, result pointer, buffer).
  • The handlers read only the first argument, the XAsyncBlock*; every GDK signature for these
    functions has it first. The slot shims pass the remaining arguments through, which relies on
    the Win64 caller cleaning up its stack, as
    @'
    XGameUi: handle the Xbox Live and account dialogs explicitly, completing with E_NOTIMPL

Seven XGameUi dialog types that need Xbox Live or an account (player picker, profile card, send
game invite, state share, multiplayer activity invite, achievements, web authentication; 17
entry points in all) were unknown slots on XCL's XGameUi class. They are now handled
explicitly: each *Async completes its XAsyncBlock at once with E_NOTIMPL, and each
*Result returns that status.

What is in it

  • crates/xcl/src/hle/xgameruntime/api.rs: ui_refused, ui_refused_fns! and xgameui_refused()
    register the 17 functions on the XGameUi class (built on the existing begin_with and
    empty_result helpers). The class's impls was empty before.
  • api.rs header comment: says which XGameUi dialogs XCL refuses and which still go to the PC runtime.
  • api.rs tests: the new refused_xgameui_dialogs_complete_with_e_notimpl_and_leave_outputs_alone,
    and the old E_NOTIMPL + unimplemented assertion in thunk_protocol_with_xcl_objects_on_pc_queues
    rewritten for the new behaviour.
  • HANDOFF.md (~L1029): its "not implemented in XCL classes" counts are now stale for these
    functions. Left unedited, as the repository rules ask.

The 17 functions

Async entry points (8):
XGameUiShowAchievementsAsync, XGameUiShowPlayerPickerAsync, XGameUiShowPlayerProfileCardAsync,
XGameUiShowSendGameInviteAsync, XGameUiShowStateShareAsync,
XGameUiShowMultiplayerActivityGameInviteAsync, XGameUiShowWebAuthenticationAsync,
XGameUiShowWebAuthenticationWithOptionsAsync

Result / status entry points (9):
XGameUiShowAchievementsResult, XGameUiShowPlayerPickerResultCount, XGameUiShowPlayerPickerResult,
XGameUiShowPlayerProfileCardResult, XGameUiShowSendGameInviteResult, XGameUiShowStateShareResult,
XGameUiShowMultiplayerActivityGameInviteResult, XGameUiShowWebAuthenticationResultSize,
XGameUiShowWebAuthenticationResult

Behaviour

  • Every *Async returns S_OK, completes the block with E_NOTIMPL and delivers the completion
    callback once. It logs XGameRuntime: <name> - no UI offline (completes with E_NOTIMPL).
  • Every *Result returns the call's status (E_NOTIMPL) and does not write its output
    arguments (counts, sizes, player ids, result pointer, buffer).
  • The handlers read only the first argument, the XAsyncBlock*; every GDK signature for these
    functions has it first. The slot shims pass the remaining arguments through, which relies on
    the Win64 caller cleaning up its stack, as the existing completed() handlers do. That is an
    assumption about the existing dispatch machinery; no test isolates it.
  • The message, error and text dialogs are unchanged (still forwarded to the PC runtime).

Side effect on report.json

These calls are no longer counted under xgameruntime.unimplemented, because they are no longer
unknown slots. Anyone using that list to find gaps will stop seeing them; the log line above is
the replacement.

Tested

  • Hardware: NVIDIA GeForce RTX 5060 Ti, driver 610.88 (WDDM); Windows 11 Pro 25H2 (OS build 26200);
    stable-x86_64-pc-windows-msvc, rustc 1.100.0 (0ef1bc386 2026-11-09). Debug build for tests,
    release build for smoke. The machine was not idle during the runs (browsers, capture and
    chat apps were open).
  • Based on main b49be18 plus one commit,
    58eb182.
  • cargo test --workspace -j 1 --no-fail-fast -- --test-threads=1: cargo exit 0;
    1,436 passed, 0 failed, 47 ignored (37 test binaries). The log has 45 SKIPPED lines;
    those tests pass without running and are not coverage.
  • Coverage of the 17 names:
    • thunk_protocol_with_xcl_objects_on_pc_queues (existing, edited) covers 3:
      XGameUiShowAchievementsAsync, XGameUiShowAchievementsResult and
      XGameUiShowWebAuthenticationWithOptionsAsync. It runs on the PC runtime's queues.
    • refused_xgameui_dialogs_complete_with_e_notimpl_and_leave_outputs_alone (new) covers all 17
      through their vtable slots on XCL's own queues. It checks S_OK from each Async, one
      completion callback per call, XAsyncGetStatus = E_NOTIMPL, every Result = E_NOTIMPL,
      untouched output buffers, E_INVALIDARG for a never-started block and for a null block.
    • Mutation check: a handler completing with S_OK, and a missing WithOptions registration,
      each made the new test fail; both were reverted.
  • Cleanup of a failed block's payload is covered by the existing
    errors_propagate_and_release_active_state, not by the new test.

Regression run

Same game folder, 60 seconds, same title for both. main first:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 5060 Ti
title: TestGame
seconds: 60
exit: 0x0
frames shown: 1483 (PresentX 1483)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16027 MB

This change:

xcl-smoke v1
commit: 58eb182e73edd5c3f241bcd2e982ce55cc92d729
gpu: NVIDIA GeForce RTX 5060 Ti
title: TestGame
seconds: 60
exit: 0x0
frames shown: 1329 (PresentX 1329)
presents per 2 s (last 3): 60 60 59
device removals: 0
crashes: 0
peak commit: 16229 MB

Not tested

AI use
Claude Code, model: not recorded. It wrote the handlers, the tests and a draft of this description, read the
function signatures from the public GDK reference, and ran the build and test commands. timesecay
reviewed the diff and is the author.

@timesecay
timesecay marked this pull request as ready for review November 26, 2026 12:16
@Decodere

Copy link
Copy Markdown
Contributor

Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2779 at 58eb182e73edd5c3f241bcd2e982ce55cc92d729 (exact parent origin/main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). Measurements and targeted test results only; not a full source review.

Setup

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6 cores / 12 threads), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200
  • Toolchain / caches: rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5, release builds, warm DXIL/pipeline caches, quiet machine (zero concurrent builds/tests during timed runs)
  • Workload: Retail workload title: 29640639 via scripts/smoke.ps1 -Seconds 60 (XCL_NETWORK=0 XCL_ACTIVITY=1, default flags, no input)

Targeted Win11 / RTX 4060 release unit tests (58eb182e)

  • cargo test --release -p xcl --lib refused_xgameui_dialogs_complete_with_e_notimpl_and_leave_outputs_alone -- --nocapture: 1 passed, 0 failed, 0 ignored (0.21 s, exit 0).
  • cargo test --release -p xcl --lib hle::xgameruntime:: -- --test-threads=4: 76 passed, 0 failed, 0 ignored (0.78 s, 0 skipped, exit 0).

Observations

  • The new XGameUi dialog refusal regression test (refused_xgameui_dialogs_complete_with_e_notimpl_and_leave_outputs_alone) and all 76 hle::xgameruntime:: tests passed cleanly in --release on native Windows 11 26200 with 0 skips.
  • Quiet 60 s retail smoke ran cleanly (exit: 0x0, 1546 frames shown, 60 60 60 steady-state presents per 2 s, 0 device removals, 0 crashes, 14000 MB peak commit vs parent b49be183's 14018 MB / 1518 frames).

Paired 60 s RTX 4060 smoke (b49be183 vs 58eb182e)

Parent origin/main (b49be183):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1518 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14018 MB

PR #2779 head (58eb182e):

xcl-smoke v1
commit: 58eb182e73edd5c3f241bcd2e982ce55cc92d729
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1546 (PresentX 1547)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14000 MB

Limits of coverage

  • Full workspace test suite was not re-run on 58eb182e (only targeted hle::xgameruntime:: release tests plus paired quiet 60 s smoke).
  • The 60 s no-input offline retail smoke (XCL_NETWORK=0) verifies zero runtime regression; live title invocations of the 17 Xbox Live / account XGameUi*Async / *Result dialogs are covered by the unit test refused_xgameui_dialogs_complete_with_e_notimpl_and_leave_outputs_alone.
  • Native Windows 11 (26200) / x86-64 only; no Wine/Linux run on this host.

AI use

Ran the targeted release unit tests and paired quiet 60 s smoke runs with assistance from Google Antigravity (Gemini 4 Neon); all test counts and smoke blocks were taken directly from cargo test and scripts/smoke.ps1 outputs.

@gut0to gut0to left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted review (OpenAI GPT-6). I checked the changed test against its stated contract; I did not run tests or the game.

let mut b: Box<XAsyncBlock> = Box::new(std::mem::zeroed());
b.callback = refused_cb as usize;
let before = REFUSED_CB.load(Ordering::SeqCst);
assert_eq!(begin(ui, &mut *b, args, args, args, args, args, args), S_OK, "{name}");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every Async slot is called with the same zero in all six trailing positions. A handler that accidentally depends on a pointer or takes a null/default branch can still pass, and identical values do not expose an argument-order mismatch. Could this fixture pass distinct scalar sentinels and distinct non-null invalid pointer sentinels, so the test proves these refused entry points depend only on the XAsyncBlock? AI-assisted review (OpenAI GPT-6); I checked the test contract in this diff and did not run tests or the game.

rootw0rm pushed a commit to rootw0rm/xcl that referenced this pull request Nov 26, 2026
…ialized dispatch-on-caller, XGameUi refused dialogs)

xcl-dev#2806: submit() merges serialized+manual into one enqueue+notify arm (worker
spawn only for SERIALIZED, win64 twin keeps its terminating notify_all
nuance); dispatch() also claims queued work for SERIALIZED ports. Test
serialized_work_port_can_dispatch_on_the_caller ported with win64 ABI.

xcl-dev#2779: ui_refused + xgameui_refused table (win64, xu::begin_with) into the
GDK-thunk routing; XGameUi impls Vec::new() -> xgameui_refused(). Twin
tests: unimplemented_slots now covers refused-completes-E_NOTIMPL plus a
still-unimplemented slot; new refused_xgameui_dialogs test (no PC runtime
/ no ASYNC_TEST_LOCK on the twin).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants