XGameRuntime: wake XAsyncGetStatus waiters before immediate completion callback #1176
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!1176
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1176"
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 12:52 UTC · original
b3IKK:xgameruntime/xasync-notify-before-immediate-cb→main· +54 −1 · 1 files · 1 commits · openXAsyncCompletecalleds.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.@DavidM1911 on GitHub · 2026-11-24 13:09 UTC · original
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X; Rust stable MSVC, debug.
cargo test -p xcl --lib xasync: 16 passed, 0 failed — the waiter-wake ordering change keeps the XAsync suite green.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@PedroNunes11 on GitHub · 2026-11-24 13:16 UTC · original
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
978a5de, cherry-picked as local6c64715on currentmain47efa2e+ #549 (d0554f3)XCL_NO_SYSTEM_XGAMERUNTIME=1forces XCL's XTaskQueue/XAsync because the system XGameRuntime path crashes on this installationMachine
Checks
cargo test -p xcl --lib complete_wakes_waiters_before_immediate_completion_callback -- --test-threads=1: 1 passedXCL_NETWORK=0 XCL_ACTIVITY=1 XCL_UMA_MB=4095 XCL_COHERENT_MB=4095;XCL_PSO_WAIT_MSunsetResult
bcpack_refused: empty0xc0000005null write ingame_scarlett_master.exe+0x23cf683, with the same title stack through+0x4e4ba89,+0x2215c35,+0x71b9a20,+0x2215ecaSo 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.
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.