XGameRuntime: XCL's own XAsync when the system runtime refuses to initialise #235
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!235
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-235"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ofc0urse on GitHub · 2026-11-23 21:41 UTC · original
ofc0urse:fix/xgameruntime-init-failure→main· +70 −6 · 1 files · 1 commits · openWhen
System32\xgameruntime.dllloads but itsInitializeApiImpl*calls fail (seen:0x80073cfcon a Windows 11 machine where the Gaming Services package was not installed, only its service entry), XCL still handed the title the PC runtime'sXAsyncobject. Its first use fails fast inside the system DLL and the title dies about 1.5 s into its boot (Application event log: faulting modulexgameruntime.dll, exception0xc0000409). Seen with a retail title, every run, until Gaming Services was installed.What is in it
crates/xcl/src/hle/xgameruntime/api.rs: a failedInitializeApiImpl*now counts like a missing DLL.pc_object()returnsNone, soXAsyncandXAccessibilitytake 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.a_system_runtime_that_refuses_to_initialise_is_not_used: a test-only result for theInitializeApiImpl*calls (FORCED_INIT,cfg(test)) forces the refusal on a PC whose runtime initialises;XAsyncandXAccessibilitymust be XCL's objects. It fails without the change ("XAsync is XCL's"). It holdsASYNC_TEST_LOCKand puts the runtime state back for the other tests.Tested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4onb1f57e3: 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.pc_init: fails at theXAsyncassertion. With it: passes, andthunk_protocol_with_xcl_objects_on_pc_queuesrun after it in the same process still gets the PC runtime'sXAsync.maindied 1.5 s into the retail title's boot every run and this branch reached the title's menus (earlier head3ff557d).b1f57e3:main, 0SKIPPED, forced-refusal test included (comment).0x80040154(REGDB_E_CLASSNOTREG): without this PR the title dies inxgameruntime.dllat 5.5 s, with it the menus run for the full 75 s (comment).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.
Not tested
AI use
🤖 Generated with Claude Code
@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.
thunk_protocol_with_xcl_objects_on_pc_queuesalready drivesInitializeApiImplEx2and the thunks against the system runtime. With a local switch that makespc_initskip the runtime's entry points and take 0x80073cfc as their result, that test passes on this branch withXAsync: 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.XAsync: PC: here a runtime that was never initialised still hands out a working XAsync. The fail-fast needs a runtime that really refuses.XGameRuntimeInitialize (XCL offline runtime)and never callsInitializeApiImpl*, 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.rs172, 267, 288, 300), so after a failed initialisationXAsyncandXAccessibilityare XCL's and every class XCL does not implement answersREGDB_E_CLASSNOTREG, as on a PC without the DLL. Two small things:scripts/pr_check.pyon 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.dllis present on this PC and initialises.cargo build --workspace, thencargo test --workspace -- --test-threads=4on the merge c699a09: 652 passed, 0 failed, 40 ignored. SKIPPED on this card:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64).thunk_protocol_with_xcl_objects_on_pc_queuesalone, 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
🤖 Claude Fable 5.2
@MesshM on GitHub · 2026-11-24 04:33 UTC · original
Test run of
b1f57e3e36f1611dece04900148b45a7812c704con AMD RDNA4. I merged it onto currentmain64b3f35locally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 702 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 661 passed, 0 failed, 21 ignoredSKIPPED; thexgameruntimetests pass, including the forced-refusal path (FORCED_INIT, test-only).Review: When the system runtime's
InitializeApiImpl*fails, XCL's ownXAsyncis 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 ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
@gurvancampion on GitHub · 2026-11-24 14:02 UTC · original
Test report for
b1f57e3under Wine, where the system runtime fails with a different HRESULT (0x80040154,REGDB_E_CLASSNOTREG) than the0x80073cfcin the description. Same outcome: without the PR the title dies inxgameruntime.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.dllfrom Gaming Services is copied into the prefix'ssystem32. That copy is how the system runtime gets loaded under Wine. Release builds, MSVC target.Tree: this is not a clean head. Stock
maincan't reach this point under Wine without the native-vtable work in #867, so both builds aremain67a3735plus 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.rsonly, no conflicts).XGameRuntime PC: initialization → 0x80040154– using XCL's own XAsync / fallbacksXAsync→ XAsync: PC→ XAsync: XCL (fallback – the system xgameruntime.dll refused to initialise)0xc0000005 in xgameruntime.dll+0x1098ce (read at address 0x0)at 5.5 s, process ends60 presentsper 2 s), 0 unhandled exceptionsEach 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 on GitHub · 2026-11-24 17:00 UTC · original
Thanks for the A/B. The fallback is taken for any failed
InitializeApiImpl*result, not only0x80073cfc, so0x80040154going 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 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
b1f57e3as it is (no merge, no local changes), Windows 11 Pro, NVIDIA GeForce RTX 5060 Ti, release build,scripts/smoke.ps1 -Seconds 120, no input. Thetitle:line is the game folder's name, shortened.6efdabcon 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.Not tested
mainblock from this machine: without this PR,maincan't run here, which is the bug.AI use
@Key-rs on GitHub · 2026-11-25 15:15 UTC · original
A data point that separates "this PR is needed" from "current
mainalready 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.GamingServicesinstalledSystem32\xgameruntime.dllis present (10.0.26100.9656) butInitializeApiImplfails with0x80070424. Unmodifiedmainthen dies on every run about 1.5 s into boot:(same path as your
0xc0000409, different fault inside the same call.)With this PR's head merged onto
mainlocally (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,GamingServicesNetandXblAuthManagerrunning. Now unmodifiedmain(06c9f55) also does not crash — and the log says why:So on this machine the newer
mainis 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
FORCED_INITpath 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 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!
@AngeloMaiale on GitHub · 2026-11-25 22:44 UTC · original
Tested
#235(b1f57e3e36f1) merged cleanly ontomain(689f2db477c3, merge commit2e7dcd39d975) on a native Windows 11 Home machine without theMicrosoft.GamingServicespackage installed (Get-AppxPackage *GamingServices*empty).On this machine
System32\xgameruntime.dllfails bothInitializeApiImplEx2calls with0x80040154(REGDB_E_CLASSNOTREG) — confirming that0x80040154occurs on native Windows 11 too, not only under Wine. Onmain(689f2db477c3) the retail title crashes deterministically at 19.3 s with0xc0000005insidexgameruntime.dll+0x107fae(read at address 0x0) right after the second failedInitializeApiImplEx2. With#235merged,XAsyncandXAccessibilityswitch to XCL's built-in fallbacks and the title runs the full 60 s smoke window with 0 crashes and 0 device removals.Tested
rustc 1.100.0, DXC1.9.2609.5(tests in debug, smoke runs in release).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4) on2e7dcd39d975: 976 passed, 0 failed, 45 ignored (a_system_runtime_that_refuses_to_initialise_is_not_usedpasses)SKIPPEDGPU tests/subcases on this wave32 adapter: 18no 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 inlower_dxil::tests), 3 wave32 per-lane f16 refusals (V_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32), 1no heap windowsRegression run
main (
689f2db477c3):#235merged ontomain(2e7dcd39d975):Not tested
Microsoft.GamingServicesinstalled on this PCAI use
xcl.log, and drafted this test report.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.