XGameRuntime: reject duplicate queued async work #2514
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2524"
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?
Imported from ivall/xcl. Originally posted by loyodea on 2026-11-25T21:35:14Z.
Related to #576. The fallback
XAsyncScheduleaccepts a second work item while the first is still pending, returningS_OKtwice. Reserve one queued item per operation and returnE_UNEXPECTEDfor the duplicate, matching libHttpClient. Release the reservation at worker entry and after a refused submission so providers can reschedule or retry.What is in it
xasync.rs: one pending-work reservation and five synthetic tests for immediate and delayed duplicates,XAsyncRun, rescheduling, and retry.README.mddocuments the behavior.Tested
86e392f,cargo build --locked --workspace --jobs 5passed.cargo test --locked --jobs 5 -p xcl --lib hle::xgameruntime::xasync::tests -- --test-threads=4reported 19 passed, 0 failed, 0 ignored. Three duplicate tests failed and the two controls passed before the fix on the original base.cargo test --locked --jobs 5 --workspace --no-fail-fast -- --test-threads=4 --nocapturereported 1,424 passed, 4 failed, and 46 ignored. The synthetic end-to-end title passed. Eight SKIPPED notices covered six unsupported per-lane paths, driver-cache measurement without Developer Mode, and the opt-in heap-window OOM path.0829441:fuzz_validate_and_gpu_1(seed 722),fuzz_validate_and_gpu_3(seed 1599),directed_reference_basics, andf64_programs_on_the_gpu. The fuzz failures match #2115.Regression run
Paired real-title
scripts/smoke.ps1results are pending. This draft remains blocked on the required smoke runs.Not tested
MSVC and release builds, retail titles, other GPU vendors, and the installed PC runtime forwarding path. Issue #576 also reports block lifetime, queue lifetime, and completion-wait behavior, which this change leaves outside its scope.
AI use
OpenAI Codex investigated the contract, wrote the patch, synthetic tests, and description, and ran the checks at the contributor's direction. The exact model used for the original patch was unavailable.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T21:54:07Z.
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!
Imported from ivall/xcl. Originally posted by xpatfussy69x on 2026-11-25T22:21:43Z.
Test run on exact head
86e392f(86e392fd3a9d33099e3f72ec16b646bbe3dd34c8, on its base6d12f58), clean tree.Tested
cargo test --workspace -- --test-threads=4: 1428 passed, 0 failed, 46 ignoredV_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32(onmaintoo)cargo test -p xcl --lib async_schedule: 5 passed, 0 failedasync_schedule_rejects_duplicate_queued_work: okasync_schedule_rejects_duplicate_delayed_work: okasync_schedule_allows_rescheduling_from_do_work: okasync_schedule_rejected_submit_can_be_retried: okasync_schedule_rejects_work_already_queued_by_run: okRegression run (60 s, default settings, a retail title)
main:
this PR:
No crash or device removal; frames 104 % of
main's, peak commit 100 %.Not tested
main(tested on its own base; it merges intoe1d84b7without conflicts)AI use
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T22:49:54Z.
Tested: current PR head merged onto current
origin/main(clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).gpu_suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.Targeted run of the new
async_schedule_*tests (five): all passed. XGameRuntime, CPU-side, fine under the Wine lane.Not tested: retail titles (no title data on this lane, counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by loyodea on 2026-11-26T18:53:28Z.
Thanks for testing this on Windows and Wine. The exact-head Windows run passed all five scheduling tests and the 60-second smoke run finished without a crash or device removal. The Wine run also passed all five scheduling tests after merging with
main.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:16:26Z.
Triage (#1607) – head
86e392fNo open or merged PR makes the same change. Main's
XAsyncSchedulehas nowork_scheduledguard, and the other open PRs touchingxasync.rs(#641, #670, #1406) do not add one.No problems found in the diff.
XAsyncRungoes throughXAsyncSchedule, so it sets the flag too.do_work_cbclears it before calling the provider, so a reschedule from DoWork works. A failed submit clears it again.The README line describes an internal detail rather than something users can do. Consider dropping it.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.