Repository navigation
Conversation
…e sign-in check association_call ignored the task queue's `canceled` parameter, so terminating the queue before dispatching still invoked the guest's XUserDeviceAssociationChangedCallback on a terminated queue instead of only dropping the AssociationCall allocation. In addition, XUserRegisterForDeviceAssociationChanged pushed to ASSOCIATION_CALLBACKS and read USER_SIGNED_IN outside the lock while user_signed_in swapped USER_SIGNED_IN before locking, allowing a concurrent sign-in and registration to deliver the same callback twice. Skip invoking the guest callback when `canceled` is true, and read/set USER_SIGNED_IN while holding ASSOCIATION_CALLBACKS so each registration is notified once. Assisted-by: OpenCode (Gemini 4 Neon)
Contributor
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Note: the full |
Contributor
Author
|
Closing in favour of #1753, this account's later PR on the same callbacks (#1607, group D58). #1753's |
Contributor
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
association_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.