feat: ship xgameruntime.dll from Rust, task queue waiters and QueryInterface #356
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!356
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-356"
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?
@LooperSalty on GitHub · 2026-11-26 12:18 UTC · original
LooperSalty:codex/xgameruntime-rust-dll→main· +864 −24 · 12 files · 25 commits · openNext step of the move to Rust after #351:
runtime/build/bin/xgameruntime.dllis now the Rust one (crates/anyxboxx-xgameruntime). The C++ build stays only as the parity oracle. Work by Codex (24 commits, about 70 minutes), pushed by Claude: Codex's sandbox has no network.Changes
runtime/CMakeLists.txt:xgameruntime.dlladded toANYXBOXX_RUST_DLLS; the C++ DLL is built under another name as the oracle.tests/test_runtime_package.pyno longer skips its case ("Rust refusal differs from C++").XTaskQueueRegisterWaiter/Unregister, self-unregistration) andQueryInterface. Parity tests against the C++ oracle incrates/anyxboxx-xgameruntime/src/parity_tests.rsandtests/test_runtime_task_waiter.py. Interface slots compared between C++ and Rust intests/test_rust_dlls.py.third_party/victory/crates/victory-hle/src/modules/xasync.rsand the newxasync_waiter.rs: the same waiter support in VIctory's HLE. This code runs in the game.docs/rust-full-status.md(EN and FR): xgameruntime shipping checks.Test plan
victory.exe, which its instructions forbade). CI runs them.victory-hlechanged: one Series X run with the launcher, compared withmain(13.4 fps median on 2026-11-26, no crash)🤖 Generated with Claude Code
https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
@chatgpt-codex-connector[bot] on GitHub · 2026-11-26 12:18 UTC · original · edited 2026-11-26 12:20 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
8bb6a41ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-26 12:20 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
8bb6a41dfdℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@ -0,0 +76,4 @@pub(super) fn invoke(&self, canceled: bool) {if !canceled && self.active.load(Ordering::Acquire) {(self.task.callback)(self.task.context as *mut c_void, false);@chatgpt-codex-connector[bot] on GitHub · 2026-11-26 12:20 UTC · original
With a thread-pool port or concurrent manual dispatch,
invokecan readactive == true, be descheduled, and resume after another thread has completedunregister. Because unregistration only storesfalseand signals an event, the callback can still begin after unregistration returns, potentially accessing a callback context the caller has already freed. The atomic load provides visibility but does not make checking and invoking indivisible. Coordinate callback admission with unregistration while preserving support for callbacks unregistering themselves; the existing queued-callback test does not exercise this interleaving.Useful? React with 👍 / 👎.
@ -384,1 +410,4 @@queue.terminated.store(true, Ordering::Release);#[cfg(windows)]for waiter in lock(&queue.waiters).drain().map(|(_, waiter)| waiter) {waiter.cancel();@chatgpt-codex-connector[bot] on GitHub · 2026-11-26 12:20 UTC · original
When a queue terminates with registered waiters, this drains their registrations and deactivates them without delivering cancellation callbacks. Even a waiter task already queued is silently suppressed because
Waiter::invoke(true)never invokes the client. The bundled C++ implementation instead promotes registered waits inTaskQueuePortImpl::CancelPendingEntries(..., true)and dispatches their callbacks with the cancellation flag throughDrainOneItem. Titles relying on that notification to release callback-owned resources or finish shutdown can consequently leak resources or wait indefinitely with the newly shipped Rust runtime. Preserve the distinction between explicit unregistration, which suppresses callbacks, and queue termination, which delivers cancellation.Useful? React with 👍 / 👎.
@Lewandox on GitHub · 2026-11-26 16:40 UTC · original · reviewed
Reviewed
third_party/victory/crates/victory-hle/src/modules/xasync.rsandxasync_waiter.rsahead of the in-game check. In addition to the two Codex findings (which both look valid —Waiter::invokevsunregistersynchronization and deliveringcanceled = trueonXTaskQueueTerminate), I spotted one more concurrency edge case inxasync_waiter.rs::register:*token(while holdingqueue.waiterslock): Ifwatchedis already signaled whenregisteris called on a thread-pool queue, the waiter thread can wake up and submit/run the callback beforetoken.write(id)executes. If the callback reads the registration token (e.g. to self-unregister) it can observe an uninitialized/stale value (data race on*token), or block onlock(&queue.waiters)ifregisterhasn't dropped the guard yet. Writingtoken.write(id)before spawning (and clearing/leaving it on spawn error) and droppingwaitersbefore spawning (or synchronizing via the waiter state) avoids that race.Everything else (
m_query_interface,check_threaddebugger check,XAsyncCompletetask.clone(), handle duplication withOwnedHandle) looks clean and well-tested.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.