Repository navigation
Conversation
…n callback XAsyncComplete called s.cv.notify_all() after taskqueue::submit_now(). When the completion port uses MODE_IMMEDIATE, submit_now() runs the completion callback synchronously on the completing thread, so any callback that synchronises with a thread blocked in XAsyncGetStatus(b, true) deadlocked deterministically because waiters were never woken. Notify the condvar as soon as completion is published and before submitting the completion callback. Assisted-by: OpenCode (Gemini 4 Neon)
|
Independent verification on current Machine: Windows 11, Ryzen 9 7900X; Rust stable MSVC, debug.
AI use: test runs by Devin (Cognition, SWE-2); no code changes. |
|
Independent GTA VI long-run regression on the PR head. The XAsync regression test passes, but this change does not resolve the later world-loading stop tracked in #232 on this machine. Build
Machine
Checks
Result
So the waiter-wake ordering fix behaves correctly in its focused test, but the later GTA VI stop remains independently reproducible. This is intended as scope information, not evidence against the XAsync fix. AI use: Codex applied the PR in an isolated worktree, ran the tests, extracted the counters from XCL's log/report, and drafted this comment; I observed the game run. |
XAsyncCompletecalleds.cv.notify_all()aftertaskqueue::submit_now(). When the completion port usesMODE_IMMEDIATE,submit_now()runs the completion callback synchronously on the completing thread, so any callback that synchronises with a thread blocked inXAsyncGetStatus(b, true)deadlocked deterministically because waiters were never woken.This moves
s.cv.notify_all()directly after publishing completion and before submitting the completion callback.What is in it
crates/xcl/src/hle/xgameruntime/xasync.rs: calls.cv.notify_all()beforetaskqueue::submit_now()inXAsyncComplete; add regression testcomplete_wakes_waiters_before_immediate_completion_callback(verified timing out before the fix and passing in ~20 ms after).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 complete_wakes_waiters_before_immediate_completion_callback: 1 passed, 0 failed (timed out before the fix)Regression run
main:
PR:
Not tested
AI use
xasync.rs, wrote the fix and regression test, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.