XGameRuntime: unregistering an association callback cancels it #1753
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!1753
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1753"
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 20:16 UTC · original
b3IKK:xgameruntime/association-context-uaf→main· +121 −13 · 1 files · 1 commits · openAddresses
XCL-BT-041from #1488.XUserUnregisterForDeviceAssociationChangeddropped the registration, ignoredwait, and left the callbacks it had already handed to the title's queue untouched: one queued behind the call still ran the title's callback with the title's context, which the title is free to free once the call returns (wait = trueis the documented way to know it is safe). A running callback was not waited for either.This tracks each queued callback's state (
Queued/Running/Done): the unregister marks a queued one done — the queue's later call then skips the title's callback and just releases the record — and withwaitit waits for a running one to finish before returning.What is in it
crates/xcl/src/hle/xgameruntime/mod.rs:AssociationCallcarries its token and aQueued/Running/Donestate with a condvar;ASSOCIATION_CALLSholds the live records;association_callskips a call that was unregistered (or whose queue was terminated) and signals when it is done;XUserUnregisterForDeviceAssociationChanged(token, wait)cancels queued calls and waits for running ones;notify_associationpasses the token.an_unregistered_association_callback_does_not_run(manual queue: queued, unregistered, dispatched → not called; a later registration still runs). Fails onmainwithleft: 1, right: 0(the callback was unregistered: its context may be gone).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): 960 passed, 0 failed, 43 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses,no heap windows, andcannot disable the driver cache (Windows Developer Mode is required))cargo test -p xcl --lib xgameruntime: 74 passed, 0 failedRegression run
main (
c4d37be, clean tree, no local changes):PR (
d7ced4d, clean tree, no local changes):Not tested
wait = falseis the one for that)AI use
XCL-BT-041against the queue andxasynccallback paths, wrote the state machine and the test (and confirmed it fails without the fix), rebased ontoc4d37be, ran the test suite andscripts/smoke.ps1regression runs with #677's title hashing, and drafted this PR description.@b3IKK on GitHub · 2026-11-24 21:32 UTC · original
Rebased onto
c4d37beand re-ran both with the current scripts/smoke.ps1 (#677's hashed itle: line): 960 passed, 0 failed, 43 ignored.@futurepro62 on GitHub · 2026-11-24 21:18 UTC · original · edited 2026-11-24 21:40 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
8cd4248(on its basec160d86).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record: 858 passed, 0 failed, 42 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.an_unregistered_association_callback_does_not_run.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 859 passed, 0 failed, 42 ignored. SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipon NVIDIA. Both fail on main7f7e768too, not because of this PR: underXCL_REQUIRE_GPU=mesh,runner::skip_testturns their skips into failures.heap_window_out_of_memory_falls_back_to_the_switch_formskips whenXCL_HEAP_WINDOWSis unset (#1651), andshaders::tests::pso_measurement_compiles_an_exact_synthetic_recordskips because Developer Mode is off on this PC (it cannot disable the driver cache). The AMD run does not setXCL_REQUIRE_GPU, so there both just print SKIPPED.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 23:04 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@throny on GitHub · 2026-11-25 00:37 UTC · original
Two contributors checked independently and found that #1418 #1583 solves the same problem (for #1389) in a different way: #1607, group D58. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@JJAutoCompare on GitHub · 2026-11-25 03:32 UTC · original
PR #1753 compatibility verification
Tested XGameRuntime association callback cancellation at
d7ced4d6ad1913c0b28280dc287755eac9e3b41c.Tested
DoublePrecisionFloatShaderOps=0). DXC/DXIL 1.9.2609.5. D3D12 SDK layers absent.rustc 1.100.0 (0ef1bc386 2026-11-09). Unoptimized dev and test profiles with debug info disabled.cargo build --workspaceandcargo test --workspace --no-runsucceeded outside the GPU lock.cargo test -p xcl xgameruntime -- --nocapturereported 74 unit tests passed, 0 failed, 0 ignored. The matching libHttpClient integration test also reported a pass after returning early becauseXCL_SAMPLE_DLLSwas unset. Two unit tests returned early for missing systemxgameruntime.dlland audio endpoint.an_unregistered_association_callback_does_not_runpassed in both runs. Dispatching the manual completion queue after unregistering withwait=trueleft the callback count at zero. A separate registration received one callback when dispatched.cargo test --workspace --no-fail-fast -- --test-threads=4ran once under the shared Arc lock. Cargo exited 101. Summed across 20 result lines inpr1753-suite.log: 941 passed, 19 failed, 43 ignored. The log contains 22SKIPPEDlines. Raw pass totals include tests that returned early.Failures and skips
0x80070057) and four result mismatches involving FMA, mip sampling, f16 lane preservation, and a pixel-shader wave reduction. The built-in test title had one failure:RSSetDepthBiasXleft the test pixel blue where green was expected.Not tested
Retail-title smoke runs, a
mainbaseline, other GPUs, and game-data cases requiring the unsetXCL_SAMPLE_*inputs. The callback regression test exercises queued cancellation. Waiting for a callback already in flight was untested.AI use
T3 Code / Codex (
gpt-6.2-sol,reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity,gemini-4-neon) verified counts againstpr1753-suite.logand published this report.@thehollowedone on GitHub · 2026-11-25 10:13 UTC · original
Independent Windows run on d7ced4d. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC.
cargo build --workspace --offline --locked -j 4passed.cargo test --workspace --offline --locked --no-fail-fast -j 4 -- --nocapture --test-threads=4finished with 960 passed, 0 failed, 43 ignored, with 23 runtime skips in Cargo’s pass count. The queued-callback regression passed.I also tested a callback that had already started on another thread. With
wait=false, unregister returned while the callback was still running. Withwait=true, unregister returned after the callback finished. The callback context stayed alive until both threads joined. The scratch fixture passed 1 of 1 withcargo test --offline --locked -j 4 -p xcl --lib local_unregister_waits_only_when_requested_for_running_callback -- --nocapture --test-threads=1, then passed in 20 of 20 fresh test processes. This covers unregister from a separate thread on a synthetic manual queue.AI use: Codex (GPT-6, exact variant unspecified) wrote the scratch fixture, ran the tests and drafted this report.
github-bot referenced this pull request2026-11-26 06:18:30 +00:00
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.