XGameRuntime: XCL's own XAsync when the system runtime refuses to initialise #235

Open
github-bot wants to merge 1 commit from github-bot/gh-235 into main AGit
Owner

@⁠ofc0urse on GitHub · 2026-11-23 21:41 UTC · original
ofc0urse:fix/xgameruntime-init-failure → main · +70 −6 · 1 files · 1 commits · open

When System32\xgameruntime.dll loads but its InitializeApiImpl* calls fail (seen: 0x80073cfc on a Windows 11 machine where the Gaming Services package was not installed, only its service entry), XCL still handed the title the PC runtime's XAsync object. Its first use fails fast inside the system DLL and the title dies about 1.5 s into its boot (Application event log: faulting module xgameruntime.dll, exception 0xc0000409). Seen with a retail title, every run, until Gaming Services was installed.

What is in it

  • crates/xcl/src/hle/xgameruntime/api.rs: a failed InitializeApiImpl* now counts like a missing DLL. pc_object() returns None, so XAsync and XAccessibility take XCL's built-in fallbacks (the path that already exists for machines without the DLL). Their notes say which of the two it is ("no system xgameruntime.dll" or "the system xgameruntime.dll refused to initialise"). When initialisation succeeds nothing changes.
  • Test a_system_runtime_that_refuses_to_initialise_is_not_used: a test-only result for the InitializeApiImpl* calls (FORCED_INIT, cfg(test)) forces the refusal on a PC whose runtime initialises; XAsync and XAccessibility must be XCL's objects. It fails without the change ("XAsync is XCL's"). It holds ASYNC_TEST_LOCK and puts the runtime state back for the other tests.

Tested

  • NVIDIA GeForce RTX 4060 Ti 8 GB (driver 621.24), Intel Core i5-14400F, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0. Tests in debug, runs in release.
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4 on b1f57e3: 681 passed, 0 failed, 41 ignored. SKIPPED on this adapter (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new test with the fix removed from pc_init: fails at the XAsync assertion. With it: passes, and thunk_protocol_with_xcl_objects_on_pc_queues run after it in the same process still gets the PC runtime's XAsync.
  • Before Gaming Services was installed on this PC, main died 1.5 s into the retail title's boot every run and this branch reached the title's menus (earlier head 3ff557d).
  • Other testers on b1f57e3:
    • MesshM, AMD Radeon RX 9060 XT 16 GB (RDNA4), Windows 11: workspace tests pass on the merge with main, 0 SKIPPED, forced-refusal test included (comment).
    • gurvancampion, RTX 5090 under Wine (GE-Proton11-12), where the system runtime refuses with a different result, 0x80040154 (REGDB_E_CLASSNOTREG): without this PR the title dies in xgameruntime.dll at 5.5 s, with it the menus run for the full 75 s (comment).
    • OrangeCrane1738, RTX 5060 Ti on Windows 11 Pro without Gaming Services, where the system runtime refuses with 0x80070424 (ERROR_SERVICE_DOES_NOT_EXIST): without this PR the title stops with a fail-fast (0xc0000409) about 30 s in; with it the fallback is taken and the title runs the full 120 s of a smoke run, 0 crashes, 0 device removals (comment).

Regression run
Both runs on this PC with Gaming Services installed and running, so the system runtime initialises in both and the new path is not taken.

xcl-smoke v1
commit: 508a0c74d7c0625d6d2de8d24494e69dc2e1926f
gpu: NVIDIA GeForce RTX 4060 Ti
title: 83d1f0b1
seconds: 60
exit: 0x0
frames shown: 1408 (PresentX 1408)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14577 MB
xcl-smoke v1
commit: b1f57e3e36f1611dece04900148b45a7812c704c
gpu: NVIDIA GeForce RTX 4060 Ti
title: 83d1f0b1
seconds: 60
exit: 0x0
frames shown: 1391 (PresentX 1391)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14733 MB

Not tested

  • A retail title on AMD (the AMD report ran the tests only).

AI use

  • Claude Code with Claude Opus 5.5: found the cause in the logs, wrote the change, the test, the commit message and this description, ran the tests and the smoke runs. I checked the results on my machine.

🤖 Generated with Claude Code

**@⁠ofc0urse** on GitHub · 2026-11-23 21:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/235) `ofc0urse:fix/xgameruntime-init-failure` → `main` · +70 −6 · 1 files · 1 commits · open When `System32\xgameruntime.dll` loads but its `InitializeApiImpl*` calls fail (seen: `0x80073cfc` on a Windows 11 machine where the Gaming Services package was not installed, only its service entry), XCL still handed the title the PC runtime's `XAsync` object. Its first use fails fast inside the system DLL and the title dies about 1.5 s into its boot (Application event log: faulting module `xgameruntime.dll`, exception `0xc0000409`). Seen with a retail title, every run, until Gaming Services was installed. **What is in it** - `crates/xcl/src/hle/xgameruntime/api.rs`: a failed `InitializeApiImpl*` now counts like a missing DLL. `pc_object()` returns `None`, so `XAsync` and `XAccessibility` take XCL's built-in fallbacks (the path that already exists for machines without the DLL). Their notes say which of the two it is ("no system xgameruntime.dll" or "the system xgameruntime.dll refused to initialise"). When initialisation succeeds nothing changes. - Test `a_system_runtime_that_refuses_to_initialise_is_not_used`: a test-only result for the `InitializeApiImpl*` calls (`FORCED_INIT`, `cfg(test)`) forces the refusal on a PC whose runtime initialises; `XAsync` and `XAccessibility` must be XCL's objects. It fails without the change ("XAsync is XCL's"). It holds `ASYNC_TEST_LOCK` and puts the runtime state back for the other tests. **Tested** - NVIDIA GeForce RTX 4060 Ti 8 GB (driver 621.24), Intel Core i5-14400F, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0. Tests in debug, runs in release. - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4` on `b1f57e3`: 681 passed, 0 failed, 41 ignored. SKIPPED on this adapter (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new test with the fix removed from `pc_init`: fails at the `XAsync` assertion. With it: passes, and `thunk_protocol_with_xcl_objects_on_pc_queues` run after it in the same process still gets the PC runtime's `XAsync`. - Before Gaming Services was installed on this PC, `main` died 1.5 s into the retail title's boot every run and this branch reached the title's menus (earlier head `3ff557d`). - Other testers on `b1f57e3`: - MesshM, AMD Radeon RX 9060 XT 16 GB (RDNA4), Windows 11: workspace tests pass on the merge with `main`, 0 `SKIPPED`, forced-refusal test included ([comment](https://github.com/ivall/xcl/pull/235#issuecomment-7122134350)). - gurvancampion, RTX 5090 under Wine (GE-Proton11-12), where the system runtime refuses with a different result, `0x80040154` (`REGDB_E_CLASSNOTREG`): without this PR the title dies in `xgameruntime.dll` at 5.5 s, with it the menus run for the full 75 s ([comment](https://github.com/ivall/xcl/pull/235#issuecomment-7133739405)). - OrangeCrane1738, RTX 5060 Ti on Windows 11 Pro without Gaming Services, where the system runtime refuses with `0x80070424` (`ERROR_SERVICE_DOES_NOT_EXIST`): without this PR the title stops with a fail-fast (`0xc0000409`) about 30 s in; with it the fallback is taken and the title runs the full 120 s of a smoke run, 0 crashes, 0 device removals ([comment](https://git.gtahub.st/github/xcl-dev--xcl/pulls/235)). **Regression run** Both runs on this PC with Gaming Services installed and running, so the system runtime initialises in both and the new path is not taken. ``` xcl-smoke v1 commit: 508a0c74d7c0625d6d2de8d24494e69dc2e1926f gpu: NVIDIA GeForce RTX 4060 Ti title: 83d1f0b1 seconds: 60 exit: 0x0 frames shown: 1408 (PresentX 1408) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14577 MB ``` ``` xcl-smoke v1 commit: b1f57e3e36f1611dece04900148b45a7812c704c gpu: NVIDIA GeForce RTX 4060 Ti title: 83d1f0b1 seconds: 60 exit: 0x0 frames shown: 1391 (PresentX 1391) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14733 MB ``` **Not tested** - A retail title on AMD (the AMD report ran the tests only). **AI use** - Claude Code with Claude Opus 5.5: found the cause in the logs, wrote the change, the test, the commit message and this description, ran the tests and the smoke runs. I checked the results on my machine. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
When System32\xgameruntime.dll loads but its InitializeApiImpl* calls fail (seen:
0x80073cfc on a Windows 11 machine where Gaming Services was not installed), XCL still
handed the title the PC runtime's XAsync object. Its first use then fails fast inside
xgameruntime.dll (0xC0000409) and the title dies about a second into its boot.

A failed initialisation now counts like a missing DLL: pc_object() returns None, so
XAsync / XAccessibility take XCL's built-in fallbacks, as they already do without
the DLL. Their notes say which of the two it is.

Test: a_system_runtime_that_refuses_to_initialise_is_not_used forces the refusal through
a test-only result for the InitializeApiImpl* calls (FORCED_INIT) and fails without the
change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:17:02 +00:00
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 00:12 UTC · original

Tested 3ff557d merged onto main 4017f8f (merge c699a09, no conflicts).

There is no test of the refusing path, and one is possible without faking the DLL.

  • The description says so. thunk_protocol_with_xcl_objects_on_pc_queues already drives InitializeApiImplEx2 and the thunks against the system runtime. With a local switch that makes pc_init skip the runtime's entry points and take 0x80073cfc as their result, that test passes on this branch with XAsync: XCL: XUser's async calls complete on XCL's own XAsync. A test-only way to force that result would give the PR its test.
  • I could not reproduce the crash this way. With the same switch and the flag left unset (main's behaviour) the test also passes, with XAsync: PC: here a runtime that was never initialised still hands out a working XAsync. The fail-fast needs a runtime that really refuses.
  • The repository's test title does not reach this code: it logs XGameRuntimeInitialize (XCL offline runtime) and never calls InitializeApiImpl*, so the e2e tests and a smoke run of it say nothing about this change.

From reading: every use of the system runtime's objects goes through pc_object (api.rs 172, 267, 288, 300), so after a failed initialisation XAsync and XAccessibility are XCL's and every class XCL does not implement answers REGDB_E_CLASSNOTREG, as on a PC without the DLL. Two small things:

  • The notes for the two fallbacks still read "(fallback – no system xgameruntime.dll)" when the DLL is there and refused.
  • scripts/pr_check.py on main refuses the description: "the PR's run commits much more memory than main's (14655 MB against 4354 MB)". The description explains why (main's run ends at 1.5 s); the check has no exception for that.

Tested

RTX 5070 Ti (NVIDIA 610.74), Ryzen 9 9950X, Windows 11 26200, debug. System32\xgameruntime.dll is present on this PC and initialises.

  • cargo build --workspace, then cargo test --workspace -- --test-threads=4 on the merge c699a09: 652 passed, 0 failed, 40 ignored. SKIPPED on this card: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64).
  • thunk_protocol_with_xcl_objects_on_pc_queues alone, on the merge plus the local switch (not part of the PR), one process each: runtime as it is, 1 passed (XAsync: PC, the path the description lists as not rerun); forced refusal with the flag left unset, 1 passed (XAsync: PC); forced refusal as in the PR, 1 passed (XAsync: XCL).

Not tested

  • A PC where the system runtime really refuses (0x80073cfc): the refusal above is forced, and the crash the PR fixes did not happen here.
  • The retail game.
  • AMD and Intel.

🤖 Claude Fable 5.2

**@⁠Kalmarv** on GitHub · 2026-11-24 00:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7117824034) Tested 3ff557d merged onto main 4017f8f (merge c699a09, no conflicts). **There is no test of the refusing path, and one is possible without faking the DLL.** - The description says so. `thunk_protocol_with_xcl_objects_on_pc_queues` already drives `InitializeApiImplEx2` and the thunks against the system runtime. With a local switch that makes `pc_init` skip the runtime's entry points and take 0x80073cfc as their result, that test passes on this branch with `XAsync: XCL`: XUser's async calls complete on XCL's own XAsync. A test-only way to force that result would give the PR its test. - I could not reproduce the crash this way. With the same switch and the flag left unset (main's behaviour) the test also passes, with `XAsync: PC`: here a runtime that was never initialised still hands out a working XAsync. The fail-fast needs a runtime that really refuses. - The repository's test title does not reach this code: it logs `XGameRuntimeInitialize (XCL offline runtime)` and never calls `InitializeApiImpl*`, so the e2e tests and a smoke run of it say nothing about this change. From reading: every use of the system runtime's objects goes through `pc_object` (`api.rs` 172, 267, 288, 300), so after a failed initialisation `XAsync` and `XAccessibility` are XCL's and every class XCL does not implement answers `REGDB_E_CLASSNOTREG`, as on a PC without the DLL. Two small things: - The notes for the two fallbacks still read "(fallback – no system xgameruntime.dll)" when the DLL is there and refused. - `scripts/pr_check.py` on main refuses the description: "the PR's run commits much more memory than main's (14655 MB against 4354 MB)". The description explains why (main's run ends at 1.5 s); the check has no exception for that. **Tested** RTX 5070 Ti (NVIDIA 610.74), Ryzen 9 9950X, Windows 11 26200, debug. `System32\xgameruntime.dll` is present on this PC and initialises. - `cargo build --workspace`, then `cargo test --workspace -- --test-threads=4` on the merge c699a09: 652 passed, 0 failed, 40 ignored. SKIPPED on this card: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64). - `thunk_protocol_with_xcl_objects_on_pc_queues` alone, on the merge plus the local switch (not part of the PR), one process each: runtime as it is, 1 passed (`XAsync: PC`, the path the description lists as not rerun); forced refusal with the flag left unset, 1 passed (`XAsync: PC`); forced refusal as in the PR, 1 passed (`XAsync: XCL`). **Not tested** - A PC where the system runtime really refuses (0x80073cfc): the refusal above is forced, and the crash the PR fixes did not happen here. - The retail game. - AMD and Intel. 🤖 Claude Fable 5.2
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 04:33 UTC · original

Test run of b1f57e3e36f1611dece04900148b45a7812c704c on AMD RDNA4. I merged it onto current main 64b3f35 locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 702 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 661 passed, 0 failed, 21 ignored
  • 0 SKIPPED; the xgameruntime tests pass, including the forced-refusal path (FORCED_INIT, test-only).

Review: When the system runtime's InitializeApiImpl* fails, XCL's own XAsync is handed out instead of the PC runtime's object that would fail on first use. I found nothing to change.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

**@⁠MesshM** on GitHub · 2026-11-24 04:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7122134350) Test run of `b1f57e3e36f1611dece04900148b45a7812c704c` on AMD RDNA4. I merged it onto current `main` `64b3f35` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **702 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 661 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; the `xgameruntime` tests pass, including the forced-refusal path (`FORCED_INIT`, test-only). **Review:** When the system runtime's `InitializeApiImpl*` fails, XCL's own `XAsync` is handed out instead of the PC runtime's object that would fail on first use. I found nothing to change. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Author
Owner

@⁠gurvancampion on GitHub · 2026-11-24 14:02 UTC · original

Test report for b1f57e3 under Wine, where the system runtime fails with a different HRESULT (0x80040154, REGDB_E_CLASSNOTREG) than the 0x80073cfc in the description. Same outcome: without the PR the title dies in xgameruntime.dll, and with it the title runs.

Tested: RTX 5090 (32-lane waves), NVIDIA 615.78.08, Ryzen 7 9800X3D, Arch-based Linux (kernel 7.2), GE-Proton11-12 (its Wine and vkd3d-proton 3.1). Retail 1.0.2.1, menus only, no input, 75 s per run. The Windows 11 xgameruntime.dll from Gaming Services is copied into the prefix's system32. That copy is how the system runtime gets loaded under Wine. Release builds, MSVC target.

Tree: this is not a clean head. Stock main can't reach this point under Wine without the native-vtable work in #867, so both builds are main 67a3735 plus the same local patches: a subset of #867, the #976 XG stack, and a no-op for ListX slot 101. A is that tree. B is the same tree with this PR merged (api.rs only, no conflicts).

A (without #235) B (with #235)
Init XGameRuntime PC: initialization → 0x80040154 same, – using XCL's own XAsync / fallbacks
XAsync → XAsync: PC → XAsync: XCL (fallback – the system xgameruntime.dll refused to initialise)
Result 0xc0000005 in xgameruntime.dll+0x1098ce (read at address 0x0) at 5.5 s, process ends full 75 s, menus at 30 fps (60 presents per 2 s), 0 unhandled exceptions

Each variant ran once. Not tested: a clean PR head on Windows, and the case where the system runtime initialises (I have no working Gaming Services under Wine).

AI use: Claude Code (Claude Opus 5.5) built the A/B, ran it and wrote this comment. I reviewed it before posting.

**@⁠gurvancampion** on GitHub · 2026-11-24 14:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7133739405) Test report for `b1f57e3` under Wine, where the system runtime fails with a different HRESULT (`0x80040154`, `REGDB_E_CLASSNOTREG`) than the `0x80073cfc` in the description. Same outcome: without the PR the title dies in `xgameruntime.dll`, and with it the title runs. **Tested:** RTX 5090 (32-lane waves), NVIDIA 615.78.08, Ryzen 7 9800X3D, Arch-based Linux (kernel 7.2), GE-Proton11-12 (its Wine and vkd3d-proton 3.1). Retail 1.0.2.1, menus only, no input, 75 s per run. The Windows 11 `xgameruntime.dll` from Gaming Services is copied into the prefix's `system32`. That copy is how the system runtime gets loaded under Wine. Release builds, MSVC target. **Tree:** this is not a clean head. Stock `main` can't reach this point under Wine without the native-vtable work in #867, so both builds are `main` `67a3735` plus the same local patches: a subset of #867, the #976 XG stack, and a no-op for ListX slot 101. A is that tree. B is the same tree with this PR merged (`api.rs` only, no conflicts). | | A (without #235) | B (with #235) | |---|---|---| | Init | `XGameRuntime PC: initialization → 0x80040154` | same, `– using XCL's own XAsync / fallbacks` | | `XAsync` | `→ XAsync: PC` | `→ XAsync: XCL (fallback – the system xgameruntime.dll refused to initialise)` | | Result | `0xc0000005 in xgameruntime.dll+0x1098ce (read at address 0x0)` at 5.5 s, process ends | full 75 s, menus at 30 fps (`60 presents` per 2 s), 0 unhandled exceptions | Each variant ran once. Not tested: a clean PR head on Windows, and the case where the system runtime initialises (I have no working Gaming Services under Wine). AI use: Claude Code (Claude Opus 5.5) built the A/B, ran it and wrote this comment. I reviewed it before posting.
Author
Owner

@⁠ofc0urse on GitHub · 2026-11-24 17:00 UTC · original

Thanks for the A/B. The fallback is taken for any failed InitializeApiImpl* result, not only 0x80073cfc, so 0x80040154 going the same way is what the change is meant to do. I added your run and the AMD report to the description. Still not covered: a real refusal on Windows with this head, since Gaming Services is installed here now.

(Written with Claude Code, checked by me.)

**@⁠ofc0urse** on GitHub · 2026-11-24 17:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7138547101) Thanks for the A/B. The fallback is taken for any failed `InitializeApiImpl*` result, not only `0x80073cfc`, so `0x80040154` going the same way is what the change is meant to do. I added your run and the AMD report to the description. Still not covered: a real refusal on Windows with this head, since Gaming Services is installed here now. (Written with Claude Code, checked by me.)
Author
Owner

@⁠OrangeCrane1738 on GitHub · 2026-11-24 17:18 UTC · original · edited 2026-11-24 17:50 UTC

Real Windows run of this PR's head on a PC without Gaming Services, where the system runtime fails with another HRESULT: 0x80070424 (ERROR_SERVICE_DOES_NOT_EXIST, the service isn't installed).

Tested

  • b1f57e3 as it is (no merge, no local changes), Windows 11 Pro, NVIDIA GeForce RTX 5060 Ti, release build, scripts/smoke.ps1 -Seconds 120, no input. The title: line is the game folder's name, shortened.
  • Without the PR (main 6efdabc on this PC) XAsync goes to the system runtime after the failed initialisation, and the title stops with a fail-fast (0xC0000409) about 30 s in.
  • With it, the log shows the fallback:
    XGameRuntime PC: initialization → 0x80070424 – using XCL's own XAsync / fallbacks
    XAsync: XCL (fallback – the system xgameruntime.dll refused to initialise)
    
    and the title ran the full 120 s:
    xcl-smoke v1
    commit: b1f57e3e36f1611dece04900148b45a7812c704c
    gpu: NVIDIA GeForce RTX 5060 Ti
    title: GTA6.Xbox.v1.0.2.1
    seconds: 120
    exit: 0x0
    frames shown: 977 (PresentX 977)
    presents per 2 s (last 3): 6 5 6
    device removals: 0
    crashes: 0
    peak commit: 15031 MB
    

Not tested

  • A main block from this machine: without this PR, main can't run here, which is the bug.

AI use

  • Claude Opus 5.5 (in the Claude app): read the log and wrote this report. The run was made on my own machine with my own copy; nothing from the game is attached.
**@⁠OrangeCrane1738** on GitHub · 2026-11-24 17:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7138991975) · edited 2026-11-24 17:50 UTC Real Windows run of this PR's head on a PC without Gaming Services, where the system runtime fails with another HRESULT: `0x80070424` (ERROR_SERVICE_DOES_NOT_EXIST, the service isn't installed). **Tested** - `b1f57e3` as it is (no merge, no local changes), Windows 11 Pro, NVIDIA GeForce RTX 5060 Ti, release build, `scripts/smoke.ps1 -Seconds 120`, no input. The `title:` line is the game folder's name, shortened. - Without the PR (main `6efdabc` on this PC) XAsync goes to the system runtime after the failed initialisation, and the title stops with a fail-fast (`0xC0000409`) about 30 s in. - With it, the log shows the fallback: ``` XGameRuntime PC: initialization → 0x80070424 – using XCL's own XAsync / fallbacks XAsync: XCL (fallback – the system xgameruntime.dll refused to initialise) ``` and the title ran the full 120 s: ``` xcl-smoke v1 commit: b1f57e3e36f1611dece04900148b45a7812c704c gpu: NVIDIA GeForce RTX 5060 Ti title: GTA6.Xbox.v1.0.2.1 seconds: 120 exit: 0x0 frames shown: 977 (PresentX 977) presents per 2 s (last 3): 6 5 6 device removals: 0 crashes: 0 peak commit: 15031 MB ``` **Not tested** - A `main` block from this machine: without this PR, `main` can't run here, which is the bug. **AI use** - Claude Opus 5.5 (in the Claude app): read the log and wrote this report. The run was made on my own machine with my own copy; nothing from the game is attached.
Author
Owner

@⁠Key-rs on GitHub · 2026-11-25 15:15 UTC · original

A data point that separates "this PR is needed" from "current main already fixed it", because on one machine both statements can look true depending on the order you do things in.

Machine: Ryzen 7 8845H, RTX 4060 Laptop 8 GB, Windows 11 26300.

Without Microsoft.GamingServices installed

System32\xgameruntime.dll is present (10.0.26100.9656) but InitializeApiImpl fails with 0x80070424. Unmodified main then dies on every run about 1.5 s into boot:

xcl: XGameRuntime: InitializeApiImplEx2 …
xcl: unhandled exception 0xc0000005 in xgameruntime.dll+0x1098ce (read at address 0x0)

(same path as your 0xc0000409, different fault inside the same call.)

With this PR's head merged onto main locally (0aca19f, one file touched, hle/xgameruntime/api.rs), the same package with the same settings ran 30 fps for 16 minutes and presented 14,100 frames, no first-chance exception, no crash log.

After installing Gaming Services 39.118.30001.0

Services GamingServices, GamingServicesNet and XblAuthManager running. Now unmodified main (06c9f55) also does not crash — and the log says why:

XGameRuntime: InitializeApiImplEx2(…) – title goes through the GDK thunks
XGameRuntime: APIs XCL does not implement come from the system xgameruntime.dll
QueryApiImpl … → XAsync: PC

So on this machine the newer main is only fine because the system runtime now initialises; the object it hands over is still the PC one, and the failure mode this PR addresses has simply moved out of reach. Anyone reading "main does not crash any more" as "this PR is redundant" would be reading the environment, not the code.

What I take from that

  • The PR is worth having for the machines that do refuse to initialise, which is not an exotic state: mine was exactly that this morning, with the DLL present and only the service entry missing — the case your description names.
  • If you want a cheap regression check for it later, on a machine with Gaming Services installed the FORCED_INIT path in your test is the only way to keep exercising it; the real-world path will silently stop being tested the moment Gaming Services is present.

Nothing else from me — I only ran it, I did not write it.

**@⁠Key-rs** on GitHub · 2026-11-25 15:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7166560431) A data point that separates "this PR is needed" from "current `main` already fixed it", because on one machine both statements can look true depending on the order you do things in. **Machine:** Ryzen 7 8845H, RTX 4060 Laptop 8 GB, Windows 11 26300. ### Without `Microsoft.GamingServices` installed `System32\xgameruntime.dll` is present (10.0.26100.9656) but `InitializeApiImpl` fails with `0x80070424`. Unmodified `main` then dies on every run about 1.5 s into boot: ``` xcl: XGameRuntime: InitializeApiImplEx2 … xcl: unhandled exception 0xc0000005 in xgameruntime.dll+0x1098ce (read at address 0x0) ``` (same path as your `0xc0000409`, different fault inside the same call.) With this PR's head merged onto `main` locally (`0aca19f`, one file touched, `hle/xgameruntime/api.rs`), the same package with the same settings ran **30 fps for 16 minutes** and presented 14,100 frames, no first-chance exception, no crash log. ### After installing Gaming Services 39.118.30001.0 Services `GamingServices`, `GamingServicesNet` and `XblAuthManager` running. Now **unmodified `main` (`06c9f55`) also does not crash** — and the log says why: ``` XGameRuntime: InitializeApiImplEx2(…) – title goes through the GDK thunks XGameRuntime: APIs XCL does not implement come from the system xgameruntime.dll QueryApiImpl … → XAsync: PC ``` So on this machine the newer `main` is only fine because the system runtime now initialises; the object it hands over is still the PC one, and the failure mode this PR addresses has simply moved out of reach. Anyone reading "main does not crash any more" as "this PR is redundant" would be reading the environment, not the code. ### What I take from that * The PR is worth having for the machines that *do* refuse to initialise, which is not an exotic state: mine was exactly that this morning, with the DLL present and only the service entry missing — the case your description names. * If you want a cheap regression check for it later, on a machine with Gaming Services installed the `FORCED_INIT` path in your test is the only way to keep exercising it; the real-world path will silently stop being tested the moment Gaming Services is present. Nothing else from me — I only ran it, I did not write it.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 15:19 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 15:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7166667393) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠AngeloMaiale on GitHub · 2026-11-25 22:44 UTC · original

Tested #235 (b1f57e3e36f1) merged cleanly onto main (689f2db477c3, merge commit 2e7dcd39d975) on a native Windows 11 Home machine without the Microsoft.GamingServices package installed (Get-AppxPackage *GamingServices* empty).

On this machine System32\xgameruntime.dll fails both InitializeApiImplEx2 calls with 0x80040154 (REGDB_E_CLASSNOTREG) — confirming that 0x80040154 occurs on native Windows 11 too, not only under Wine. On main (689f2db477c3) the retail title crashes deterministically at 19.3 s with 0xc0000005 inside xgameruntime.dll+0x107fae (read at address 0x0) right after the second failed InitializeApiImplEx2. With #235 merged, XAsync and XAccessibility switch to XCL's built-in fallbacks and the title runs the full 60 s smoke window with 0 crashes and 0 device removals.

Tested

  • NVIDIA GeForce RTX 4050 Laptop GPU (driver 32.0.16.2124), 12th Gen Intel Core i7-12650H, 16 GB RAM, Windows 11 Home 26200, rustc 1.100.0, DXC 1.9.2609.5 (tests in debug, smoke runs in release)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4) on 2e7dcd39d975: 976 passed, 0 failed, 45 ignored (a_system_runtime_that_refuses_to_initialise_is_not_used passes)
  • SKIPPED GPU tests/subcases on this wave32 adapter: 18 no wave64 (a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, plus 11 wave64 subcases in lower_dxil::tests), 3 wave32 per-lane f16 refusals (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32), 1 no heap windows

Regression run
main (689f2db477c3):

xcl-smoke v1
commit: 689f2db477c3c062cf162649781640ef8a977c18
gpu: NVIDIA GeForce RTX 4050 Laptop GPU
title: 419239bf
seconds: 60
exit: 0xc0000005
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 31 60 41
device removals: 0
crashes: 2
peak commit: 8145 MB

#235 merged onto main (2e7dcd39d975):

xcl-smoke v1
commit: 2e7dcd39d975b2d97ff1af6b11c00f9c8763de85
gpu: NVIDIA GeForce RTX 4050 Laptop GPU
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 567 (PresentX 568)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 11898 MB

Not tested

  • With Microsoft.GamingServices installed on this PC
  • AMD GPUs (wave64)

AI use

  • Antigravity with Gemini 4 Carbon: ran the merged build, full test suite, and smoke runs, inspected xcl.log, and drafted this test report.
**@⁠AngeloMaiale** on GitHub · 2026-11-25 22:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7176736910) Tested `#235` (`b1f57e3e36f1`) merged cleanly onto `main` (`689f2db477c3`, merge commit `2e7dcd39d975`) on a native Windows 11 Home machine without the `Microsoft.GamingServices` package installed (`Get-AppxPackage *GamingServices*` empty). On this machine `System32\xgameruntime.dll` fails both `InitializeApiImplEx2` calls with `0x80040154` (`REGDB_E_CLASSNOTREG`) — confirming that `0x80040154` occurs on native Windows 11 too, not only under Wine. On `main` (`689f2db477c3`) the retail title crashes deterministically at 19.3 s with `0xc0000005` inside `xgameruntime.dll+0x107fae` (`read at address 0x0`) right after the second failed `InitializeApiImplEx2`. With `#235` merged, `XAsync` and `XAccessibility` switch to XCL's built-in fallbacks and the title runs the full 60 s smoke window with 0 crashes and 0 device removals. **Tested** - NVIDIA GeForce RTX 4050 Laptop GPU (driver 32.0.16.2124), 12th Gen Intel Core i7-12650H, 16 GB RAM, Windows 11 Home 26200, `rustc 1.100.0`, DXC `1.9.2609.5` (tests in debug, smoke runs in release) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`) on `2e7dcd39d975`: 976 passed, 0 failed, 45 ignored (`a_system_runtime_that_refuses_to_initialise_is_not_used` passes) - `SKIPPED` GPU tests/subcases on this wave32 adapter: 18 `no wave64` (`a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, plus 11 wave64 subcases in `lower_dxil::tests`), 3 wave32 per-lane f16 refusals (`V_MUL_F16`, `V_PK_MUL_F16`, `V_CVT_F16_F32`), 1 `no heap windows` **Regression run** main (`689f2db477c3`): ``` xcl-smoke v1 commit: 689f2db477c3c062cf162649781640ef8a977c18 gpu: NVIDIA GeForce RTX 4050 Laptop GPU title: 419239bf seconds: 60 exit: 0xc0000005 frames shown: none logged (the run did not reach its end) presents per 2 s (last 3): 31 60 41 device removals: 0 crashes: 2 peak commit: 8145 MB ``` `#235` merged onto `main` (`2e7dcd39d975`): ``` xcl-smoke v1 commit: 2e7dcd39d975b2d97ff1af6b11c00f9c8763de85 gpu: NVIDIA GeForce RTX 4050 Laptop GPU title: 419239bf seconds: 60 exit: 0x0 frames shown: 567 (PresentX 568) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 11898 MB ``` **Not tested** - With `Microsoft.GamingServices` installed on this PC - AMD GPUs (wave64) **AI use** - Antigravity with Gemini 4 Carbon: ran the merged build, full test suite, and smoke runs, inspected `xcl.log`, and drafted this test report.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/235/head:github-bot/gh-235'
git switch 'github-bot/gh-235'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-235'
git switch 'github-bot/gh-235'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-235'
git switch 'github-bot/gh-235'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-235'
git switch 'main'
git merge --squash 'github-bot/gh-235'
git switch 'main'
git merge --ff-only 'github-bot/gh-235'
git switch 'main'
git merge 'github-bot/gh-235'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.