XGameRuntime: skip canceled device association callbacks and serialize sign-in check #1231
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!1231
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1231/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@b3IKK on GitHub · 2026-11-24 13:26 UTC · original
b3IKK:xgameruntime/xuser-association-canceled→main· +38 −9 · 1 files · 1 commits · closed without mergingassociation_callignored the task queue'scanceledparameter, so terminating the queue before dispatching still invoked the guest'sXUserDeviceAssociationChangedCallbackon a terminated queue instead of only droppingBox<AssociationCall>.In addition,
XUserRegisterForDeviceAssociationChangedpushed toASSOCIATION_CALLBACKSand checkedUSER_SIGNED_INoutside the lock whileuser_signed_in()swappedUSER_SIGNED_INbefore locking, allowing a concurrent sign-in and registration to deliver the same callback twice.This skips invoking the guest callback when
canceledis true and reads/setsUSER_SIGNED_INwhile holdingASSOCIATION_CALLBACKS.What is in it
crates/xcl/src/hle/xgameruntime/mod.rs: return without invoking the guest callback inassociation_callwhencanceledis true; check/setUSER_SIGNED_INunderASSOCIATION_CALLBACKS.lock(); add unit testdevice_association_callback_not_invoked_when_queue_terminated(verified failing before the fix).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2no wave64—gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)cargo test -p xcl --lib device_association_callback_not_invoked_when_queue_terminated: 1 passed, 0 failed (failed before the fix with callback invoked once on queue termination)Regression run
main:
PR:
Not tested
AI use
xgameruntime/mod.rs, wrote the fix and regression test, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@DavidM1911 on GitHub · 2026-11-24 13:47 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Note: the full
d3d12xlib filter currently aborts with 0xc0000005 on unmodifiedmaintoo (pre-existing, unrelated to this PR); the PR's own tests were run by name and pass.@b3IKK on GitHub · 2026-11-25 00:04 UTC · original
Closing in favour of #1753, this account's later PR on the same callbacks (#1607, group D58). #1753's
association_callalready skips a call the queue canceled, which is the first half of this PR, and also cancels queued calls on unregister. The second half here (reading the sign-in flag under the callbacks lock) is what #1418 and #1583 do more completely. AI use: OpenCode, Claude Fable 5.2.@DavidM1911 on GitHub · 2026-11-26 04:17 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
Pull request closed