HLE: implement XTaskQueueRegisterWaiter and XTaskQueueUnregisterWaiter slots (0xa0, 0xa8) #888
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#888
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@davi713albano-coder on GitHub · 2026-11-24 13:31 UTC · original
Summary
Implements the two missing
XTaskQueuewaiter vtable slots incrates/victory-hle/src/modules/xasync.rs:20(0xa0):XTaskQueueRegisterWaiter21(0xa8):XTaskQueueUnregisterWaiterBecause external PR creation is restricted (
collaborators_only), the CI-green branch is ready on my fork:a576445(based onmainffe310e,crates/victory-hle/src/modules/xasync.rs+497/-2)Changes (
crates/victory-hle/src/modules/xasync.rs)WORK/COMPLETION), non-null/non-INVALID_HANDLE_VALUEwait handle, callback, output token, and terminated queue state (E_ABORT).DuplicateHandlewithDUPLICATE_SAME_ACCESS) so the wait stays valid if the caller closes their handle right after unregistering, and pairs it with a per-waiter manual-resetstop_eventplaced first inWaitForMultipleObjects.WaitForMultipleObjects, preventing manual-reset events from flooding the queue before the callback can reset the event or unregister itself.Weak<Queue>on the waiter thread (dropping the upgradedArc<Queue>before waiting on callback completion) and cleans up waiters onXTaskQueueTerminateandQueue::drop, avoiding reference cycles and handle leaks.E_NOTIMPL).Tests & Verification
Added 3 synthetic Windows unit tests in
xasync::tests:waiter_fires_on_signal_and_stops_after_unregister(exercises slots0xa0/0xa8with an auto-reset event across multiple signals and unregister)manual_reset_waiter_rearms_only_after_callback_returns(verifies manual-reset re-arm semantics and safe unregistration from inside the callback itself)waiter_validates_arguments_and_stops_on_terminate(argument validation,E_ABORTafter terminate, clean shutdown)Verified on GitHub Actions (
windows-latest) using upstreamci.yml(cargo clippy --workspace --all-targets --locked -- -D warnings,--all-features, andcargo test --workspace --lockedincludingxtaskasset-policy check):victory-hle: 97 passed, 0 failed (full workspace: 345 passed, 0 failed, 6 ignored)Not tested: live title execution.
No game data used. AI-assisted.
@MichaelSmithAI on GitHub · 2026-11-24 13:39 UTC · original
Melissa checked the interval after a waiter has queued its callback but before the title dispatches the manual completion port. On a576445 the test waited until exactly one entry was queued and the callback count was still zero. Unregistering and then dispatching produced zero callbacks. In a separate run, terminating the queue with the waiter still registered delivered one callback with canceled=true. All 11 focused Win64 xasync tests passed under Wine 11.22.
That establishes the behavior of this branch. The GDK unregister reference says callbacks cease after unregistration. Microsoft’s separate libHttpClient implementation invokes a dequeued callback before releasing its wait registration, so that code alone does not settle what retail xgameruntime does with an already-queued entry. A comparison on the native GDK runtime would resolve that remaining detail. GDK unregister reference · libHttpClient dispatch path
@LAKSHYA-cmd-tech on GitHub · 2026-11-24 13:55 UTC · original
Verified and merged downstream in PR #28. Passing all 3 synthetic waiter tests on Windows 11.
@Marvisak on GitHub · 2026-11-25 06:50 UTC · original
Automated triage for the maintainers.
Confirmed that these are unimplemented on current
main: incrates/victory-hle/src/modules/xasync.rsthe task-queue table still hasmissing::<20>(0xa0, register a wait handle) andmissing::<21>(0xa8, unregister it). Open PR #1435 implements both. Pull requests are open to everyone now; if your brancha576445differs from #1435 in a way that matters (for example the behaviour of an already-queued callback discussed above), please open it as a PR or comment there so review happens in one place.Generated by Claude Code