XGameRuntime: drain active task queue monitors on unregister #2836
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2836"
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 CryingLaughing on 2026-11-26T17:01:06Z.
XTaskQueueUnregisterMonitorcould return while a monitor still used its context. It could also leave a copied notification snapshot able to invoke the removed registration. Native Windows unregister waited for the running callback in the synthetic comparison. Related to #2021, which covers monitor delivery through shared ports.What is in it
Tested
43a4eb9dacbe1cc1e746609f979597d27538979fon8b957bec6f82495aec940944c6bf47faa02db590. Windows 11 25H2 build 26200.9974, Core i5-13600K, RTX 4080 driver 621.01, Rust 1.100.0 x64 MSVC, DXC 1.8.2502.11, debug.xgameruntime.dll10.0.26100.9656probe ran nine trials in three fresh CPU processes. The external unregister caller returned only after the held callback ended in all nine. Every subsequent submission completed without another monitor invocation.cargo build --workspace --locked -j 4passed.cargo test --workspace --locked -j 4 -- --test-threads=4 --show-outputreported 1,449 passed, 0 failed, 47 ignored across 38 harnesses. The pass count includes 29 capability skips and 10 separate unset optional sample messages.Regression run
Matched retail smoke is pending.
Not tested
Imported from ivall/xcl. Originally posted by MatyEjsr on 2026-11-26T18:28:23Z.
Independent NVIDIA Windows verification and concurrency review of PR #2836 at exact head
43a4eb9dacbe1cc1e746609f979597d27538979f(currentlyMERGEABLEonto basemain8b957bec6f82495aec940944c6bf47faa02db590).Tested
32.0.16.1742, wave32 only),rustc 1.100.0, DXC1.9.2602.17.cargo build --workspace -j 8andcargo build --release --workspace -j 8on43a4eb9d: passed.cargo test -p xcl --lib hle::xgameruntime::taskqueue:: -- --nocapture:main(8b957bec): 10 passed, 0 failed, 0 ignored, 0 skipped.43a4eb9d, debug): 13 passed, 0 failed, 0 ignored, 0 skipped (the 3 new monitor drain/revocation tests pass).43a4eb9d, release, 10 consecutive runs): 10/10 passed (13 passed, 0 failed, 0 ignored, 0 skipped each; 0.25-0.26 s per run).cargo test --workspace -j 8 -- --test-threads=8 --nocapture(43a4eb9d, debug): 1,449 passed, 0 failed, 47 ignored across 38 harnesses; 28 explicitSKIPPEDlines (21no wave64, 3wave32, per-lane form: refused, 3 missing D3D12 debug layer, 1no heap windows) and 10 unset optionalXCL_SAMPLE_*skips (8XCL_SAMPLE_RPF,1XCL_SAMPLE_TTPF,1XCL_SAMPLE_AWC) — reported separately and not counted as coverage.cargo test --release -p xcl --test e2e -- --nocapture(43a4eb9d, release): 4 passed, 0 failed, 0 ignored; 2 D3D12 debug-layerSKIPPEDsubcases for missingd3d12SDKLayers.dll(not counted as coverage).Regression run & PR checks
scripts/smoke.ps1 -Seconds 60on PR head43a4eb9d(default-StartupTimeoutSeconds 120) timed out at 180 s during base8b957bec's pre-launch shader preparation over 26,503 pack records before reaching guest execution (XCL printed no log path, exit code 1). Noxcl-smoke v1pair was produced.PR checks / PR descriptioncheck currently fails on43a4eb9dbecause the PR body is missing the**AI use**section and both matchedxcl-smokeblocks (main+ PR head) under**Regression run**.Code review & overlap check
crates/xcl/src/hle/xgameruntime/taskqueue.rslook sound:Monitor::invokechecksrevokedbefore incrementingrunning,remove_monitorruns only oncerevoked && running == 0, and neitherq.monitorsnormonitor.stateis held across callbacks oridle.wait(...).MONITOR_DEPTH: because it is a thread-local nesting counter rather than a per-token set, callingXTaskQueueUnregisterMonitoron a distinct monitor B from inside monitor A's callback takes the non-blocking path and returns without draining B if B is active on another thread. That avoids AB-BA deadlock between two monitors unregistering each other and aligns with the PR's Not tested note on reentrant monitor management.nvidia-devdoes not touchtaskqueue.rs. Open PR #1154 (termination callback) is unrelated; open PR #2021 also modifies monitor notification intaskqueue.rs(distinct change; minor rebase coordination if both land); open PR #2806 updates the sameREADME.mdfeature-table row (trivial rebase conflict for whichever lands second).Not tested
xcl-smoke v1pair (blocked by base8b957becstartup shader preparation exceeding the defaultsmoke.ps1timeout), AMD / Intel / native wave64 GPUs, D3D12 debug-layer subcases,heap_window_out_of_memory_falls_back_to_the_switch_form, optionalXCL_SAMPLE_*tests, and native Windows reentrant monitor behavior.AI use
Pull request closed