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

Merged
ofc0urse merged 1 commit from upstream-pr/235 into main 2026-11-30 18:43:02 +00:00
ofc0urse commented 2026-11-23 21:41:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ofc0urse on 2026-11-23T21:41:15Z.


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

<!-- greyfinch-sync:ivall/xcl:issue:5461704230 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/235). Originally posted by [ofc0urse](https://github.com/ofc0urse) on 2026-11-23T21:41:15Z. --- 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://github.com/xcl-dev/xcl/pull/235#issuecomment-7138991975)). **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)
Kalmarv commented 2026-11-24 07:04:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-24T00:12:43Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7117824034 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/235#issuecomment-7117824034). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T00:12:43Z. --- 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
MesshM commented 2026-11-24 07:06:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T04:33:53Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7122134350 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/235#issuecomment-7122134350). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T04:33:53Z. --- 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.
gurvancampion commented 2026-11-24 14:06:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gurvancampion on 2026-11-24T14:02:27Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7133739405 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/235#issuecomment-7133739405). Originally posted by [gurvancampion](https://github.com/gurvancampion) on 2026-11-24T14:02:27Z. --- 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.
ofc0urse commented 2026-11-24 17:06:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ofc0urse on 2026-11-24T17:00:38Z.


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.)

<!-- greyfinch-sync:ivall/xcl:comment:7138547101 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7138547101). Originally posted by [ofc0urse](https://github.com/ofc0urse) on 2026-11-24T17:00:38Z. --- 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.)
OrangeCrane1738 commented 2026-11-24 18:09:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by OrangeCrane1738 on 2026-11-24T17:18:14Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7138991975 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7138991975). Originally posted by [OrangeCrane1738](https://github.com/OrangeCrane1738) on 2026-11-24T17:18:14Z. --- 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.
Key-rs commented 2026-11-25 16:12:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Key-rs on 2026-11-25T15:15:44Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7166560431 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7166560431). Originally posted by [Key-rs](https://github.com/Key-rs) on 2026-11-25T15:15:44Z. --- 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.
DavidM1911 commented 2026-11-25 16:12:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T15:19:39Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7166667393 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7166667393). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T15:19:39Z. --- 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!
AngeloMaiale commented 2026-11-25 23:09:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by AngeloMaiale on 2026-11-25T22:44:43Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7176736910 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7176736910). Originally posted by [AngeloMaiale](https://github.com/AngeloMaiale) on 2026-11-25T22:44:43Z. --- 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.
github-actions[bot] commented 2026-11-29 20:43:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:43:36Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7262309210 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7262309210). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T20:43:36Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
jsalzy commented 2026-11-30 03:33:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jsalzy on 2026-11-30T03:33:03Z.


merge-check claim
head: b1f57e3e36

<!-- greyfinch-sync:ivall/xcl:comment:7267988798 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7267988798). Originally posted by [jsalzy](https://github.com/jsalzy) on 2026-11-30T03:33:03Z. --- merge-check claim head: b1f57e3e36f1611dece04900148b45a7812c704c
jsalzy commented 2026-11-30 03:40:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jsalzy on 2026-11-30T03:40:39Z.


merge-check
base: cfb9753a8c
head: b1f57e3e36
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2835 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64 on this GPU; 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1); 1 driver cache cannot be disabled without Windows Developer Mode); failing: none. The PR's new test a_system_runtime_that_refuses_to_initialise_is_not_used ran (this PC has System32\xgameruntime.dll) and passed; the log shows "initialization → 0x80073cfc – using XCL's own XAsync / fallbacks" and both fallbacks chosen with the new reason.
review: no blocking finding; whole diff read (one file). A failed InitializeApiImpl* now sets PC_INIT_FAILED, so pc_object answers None from then on: XAsync and XAccessibility take XCL's existing fallbacks, start_pc_async no longer hands xasync the system object, and other families the PC runtime would have served answer "missing", where today the title gets objects that fail fast inside xgameruntime.dll (the crash three testers in the thread reproduced). main still has no equivalent (pc_init only logs the failure). The test-only FORCED_INIT hook is cfg(test), so release code always calls the real entry points. The flags are process-wide: the test holds ASYNC_TEST_LOCK and resets both on drop; of the other tests in api.rs that query the runtime without that lock, none reaches a family the PC runtime serves (XPackage is XCL's own; the accessibility test uses the fallback object directly). Minor: PC_INIT_FAILED is never cleared, so a title that called the initialisation a second time and succeeded would still get the fallbacks. No other PR handles a refusing runtime.
performance: none (start-up path only).
verdict: safe to merge
hardware / tool and model: RTX 4070 SUPER 12 GB (621.24 / 32.0.16.2124), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 25H2 26200.9974, Rust 1.100.0, debug / Claude

<!-- greyfinch-sync:ivall/xcl:comment:7268100328 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7268100328). Originally posted by [jsalzy](https://github.com/jsalzy) on 2026-11-30T03:40:39Z. --- merge-check base: cfb9753a8cbf5517ee36914b7041cb62b4a97582 head: b1f57e3e36f1611dece04900148b45a7812c704c merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2835 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64 on this GPU; 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1); 1 driver cache cannot be disabled without Windows Developer Mode); failing: none. The PR's new test a_system_runtime_that_refuses_to_initialise_is_not_used ran (this PC has System32\xgameruntime.dll) and passed; the log shows "initialization → 0x80073cfc – using XCL's own XAsync / fallbacks" and both fallbacks chosen with the new reason. review: no blocking finding; whole diff read (one file). A failed InitializeApiImpl* now sets PC_INIT_FAILED, so pc_object answers None from then on: XAsync and XAccessibility take XCL's existing fallbacks, start_pc_async no longer hands xasync the system object, and other families the PC runtime would have served answer "missing", where today the title gets objects that fail fast inside xgameruntime.dll (the crash three testers in the thread reproduced). main still has no equivalent (pc_init only logs the failure). The test-only FORCED_INIT hook is cfg(test), so release code always calls the real entry points. The flags are process-wide: the test holds ASYNC_TEST_LOCK and resets both on drop; of the other tests in api.rs that query the runtime without that lock, none reaches a family the PC runtime serves (XPackage is XCL's own; the accessibility test uses the fallback object directly). Minor: PC_INIT_FAILED is never cleared, so a title that called the initialisation a second time and succeeded would still get the fallbacks. No other PR handles a refusing runtime. performance: none (start-up path only). verdict: safe to merge hardware / tool and model: RTX 4070 SUPER 12 GB (621.24 / 32.0.16.2124), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 25H2 26200.9974, Rust 1.100.0, debug / Claude
brainhay5 commented 2026-11-30 06:12:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T06:12:15Z.


merge-check claim
head: b1f57e3e36

<!-- greyfinch-sync:ivall/xcl:comment:7270408655 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7270408655). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T06:12:15Z. --- merge-check claim head: b1f57e3e36f1611dece04900148b45a7812c704c
brainhay5 commented 2026-11-30 06:25:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T06:25:50Z.


merge-check
base: d52ff48caa
head: b1f57e3e36
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2876 passed, 2 failed, 51 ignored; 29 SKIPPED lines

failing: test_title_runs_and_game_folder_is_untouched
review: automated overnight check — diff inspected for safety only (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed; no line-by-line code review.
performance: not assessed beyond the suite.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017

correction: this check first reported the PR as "not yet" because of a test failure that is not the PR's. The base-comparison step failed to run (test names contain a double colon, not a legal Windows filename), so an empty read was mistaken for "passes on base". gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 fails on base d52ff48c by itself (verified separately with the same command: "assertion failed: 2D D16 resinfo clobbered v2/v3"). Verdict corrected. Apologies for the noise.

<!-- greyfinch-sync:ivall/xcl:comment:7270640287 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7270640287). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T06:25:50Z. --- merge-check base: d52ff48caade1f5350d513bfffd370396dadfeb6 head: b1f57e3e36f1611dece04900148b45a7812c704c merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2876 passed, 2 failed, 51 ignored; 29 SKIPPED lines failing: test_title_runs_and_game_folder_is_untouched review: automated overnight check — diff inspected for safety only (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed; no line-by-line code review. performance: not assessed beyond the suite. verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017 correction: this check first reported the PR as "not yet" because of a test failure that is not the PR's. The base-comparison step failed to run (test names contain a double colon, not a legal Windows filename), so an empty read was mistaken for "passes on base". `gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16` fails on base d52ff48c by itself (verified separately with the same command: "assertion failed: 2D D16 resinfo clobbered v2/v3"). Verdict corrected. Apologies for the noise.
tiagonleal commented 2026-11-30 09:05:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-30T09:05:37Z.


merge-check
base: bc4503d428
head: b1f57e3e36
merge: clean
build: cargo build --workspace -> ok (also cargo build --release -p xcl)
tests: cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4 -> 2878 passed, 1 failed, 51 ignored; SKIPPED: 24 lines, the same as on the base; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 ("2D D16 resinfo clobbered v2/v3", left (0, 0)), which fails the same way on the base alone: 2877 passed, 1 failed, 51 ignored, same test. The new test a_system_runtime_that_refuses_to_initialise_is_not_used ran here (System32\xgameruntime.dll is present and initialises) and passed. It is a real regression test on this machine: with the PC_INIT_FAILED.store(true, ...) line in pc_init commented out in the merged tree, cargo test -p xcl --lib hle::xgameruntime::api::tests::a_system_runtime_that_refuses_to_initialise_is_not_used -- --test-threads=1 fails at "XAsync is XCL's".
review: whole diff read (+70/-6, hle/xgameruntime/api.rs). A failed InitializeApiImpl* sets PC_INIT_FAILED; pc_object then answers None, so start_pc_async never calls xasync::use_pc with the system object, QueryApiImpl hands out XCL's XAsync and XAccessibility (the existing no-DLL fallbacks), and other families the system runtime would serve answer REGDB_E_CLASSNOTREG. When the runtime initialises nothing changes: the flag is only set on hr < 0, and the smoke log below still shows XAsync: PC. FORCED_INIT is cfg(test), so release builds always call the real entry points. Notes, none a blocker: (1) objects whose pc pointer was cached before the failed initialisation (QueryApiImpl caches o.pc for forwarding classes, forward_alias_obj) keep the system pointer; this only matters for a title that queries before it initialises. (2) The flag is never cleared, and a first successful init followed by a failed second one would leave xasync::use_pc on the system object while QueryApiImpl gives XCL's XAsync. Titles call the initialisation once, so I do not expect either case. (3) UninitializeApiImpl still calls the system runtime's uninitialise after a refused init, as main does today. (4) Without the DLL the new test prints "skipping" and passes, with no SKIPPED line. Of the open PRs that touch api.rs (#1220, #1610, #1615, #2957), none changes pc_init or adds this fallback.
performance: start-up path only. Measured with scripts/smoke.ps1, 60 s of a retail title, release, after one warm-up run of the base: 1699 frames and 15476 MB peak commit against 1652 frames and 15598 MB on the base (warm-up: 1476, 15343 MB). No device removal, no crash. Gaming Services is installed on this PC, so the system runtime initialises and the new path was not taken in these runs.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB (617.42, wave32), Ryzen 7 9800X3D, 32 GB, Windows 11 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5 ran the build, suite, test and smoke, reviewed the diff against the merged source and wrote this)

  • Tiago
<!-- greyfinch-sync:ivall/xcl:comment:7273731562 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/235#issuecomment-7273731562). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-30T09:05:37Z. --- merge-check base: bc4503d428a787b54951bac6419c5b1f85443ee0 head: b1f57e3e36f1611dece04900148b45a7812c704c merge: clean build: cargo build --workspace -> ok (also `cargo build --release -p xcl`) tests: cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4 -> 2878 passed, 1 failed, 51 ignored; SKIPPED: 24 lines, the same as on the base; failing: `gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16` ("2D D16 resinfo clobbered v2/v3", left (0, 0)), which fails the same way on the base alone: 2877 passed, 1 failed, 51 ignored, same test. The new test `a_system_runtime_that_refuses_to_initialise_is_not_used` ran here (System32\xgameruntime.dll is present and initialises) and passed. It is a real regression test on this machine: with the `PC_INIT_FAILED.store(true, ...)` line in `pc_init` commented out in the merged tree, `cargo test -p xcl --lib hle::xgameruntime::api::tests::a_system_runtime_that_refuses_to_initialise_is_not_used -- --test-threads=1` fails at "XAsync is XCL's". review: whole diff read (+70/-6, `hle/xgameruntime/api.rs`). A failed `InitializeApiImpl*` sets `PC_INIT_FAILED`; `pc_object` then answers `None`, so `start_pc_async` never calls `xasync::use_pc` with the system object, `QueryApiImpl` hands out XCL's XAsync and XAccessibility (the existing no-DLL fallbacks), and other families the system runtime would serve answer `REGDB_E_CLASSNOTREG`. When the runtime initialises nothing changes: the flag is only set on `hr < 0`, and the smoke log below still shows `XAsync: PC`. `FORCED_INIT` is `cfg(test)`, so release builds always call the real entry points. Notes, none a blocker: (1) objects whose `pc` pointer was cached before the failed initialisation (`QueryApiImpl` caches `o.pc` for forwarding classes, `forward_alias_obj`) keep the system pointer; this only matters for a title that queries before it initialises. (2) The flag is never cleared, and a first successful init followed by a failed second one would leave `xasync::use_pc` on the system object while `QueryApiImpl` gives XCL's XAsync. Titles call the initialisation once, so I do not expect either case. (3) `UninitializeApiImpl` still calls the system runtime's uninitialise after a refused init, as `main` does today. (4) Without the DLL the new test prints "skipping" and passes, with no `SKIPPED` line. Of the open PRs that touch `api.rs` (#1220, #1610, #1615, #2957), none changes `pc_init` or adds this fallback. performance: start-up path only. Measured with `scripts/smoke.ps1`, 60 s of a retail title, release, after one warm-up run of the base: 1699 frames and 15476 MB peak commit against 1652 frames and 15598 MB on the base (warm-up: 1476, 15343 MB). No device removal, no crash. Gaming Services is installed on this PC, so the system runtime initialises and the new path was not taken in these runs. verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB (617.42, wave32), Ryzen 7 9800X3D, 32 GB, Windows 11 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5 ran the build, suite, test and smoke, reviewed the diff against the merged source and wrote this) - Tiago
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
xcl-dev/xcl!232
No description provided.