HLE/gameinput: write callback token before registration and order blo… #534

Open
github-bot wants to merge 1 commit from github-bot/gh-534 into main AGit
Owner

@⁠pug205gti6 on GitHub · 2026-11-25 02:01 UTC · original
pug205gti6:pr/485-hle-gameinput → main · +156 −14 · 1 files · 1 commits · open

…cking enumeration

  • Write *out = registration.token before inserting the callback into state.callbacks in register_device so no callback invocation (blocking, async, or poll-driven) can observe an uninitialized token or race with the write to *out.
  • Track tokens currently running blocking enumeration in State::enumerating and buffer any concurrent poll() transitions for those tokens in State::deferred, draining them on the registering thread before clearing enumerating (and dropping them on forget()). This prevents poll() from delivering DISCONNECTED ahead of or concurrently with initial CONNECTED enumeration without holding hub.state() across user callbacks.
  • Add synthetic concurrency test blocking_enumeration_writes_token_first_and_orders_concurrent_poll.
**@⁠pug205gti6** on GitHub · 2026-11-25 02:01 UTC · [original](https://github.com/fxceless/victory-fork/pull/534) `pug205gti6:pr/485-hle-gameinput` → `main` · +156 −14 · 1 files · 1 commits · open …cking enumeration - Write `*out = registration.token` before inserting the callback into `state.callbacks` in `register_device` so no callback invocation (blocking, async, or poll-driven) can observe an uninitialized token or race with the write to `*out`. - Track tokens currently running blocking enumeration in `State::enumerating` and buffer any concurrent `poll()` transitions for those tokens in `State::deferred`, draining them on the registering thread before clearing `enumerating` (and dropping them on `forget()`). This prevents `poll()` from delivering `DISCONNECTED` ahead of or concurrently with initial `CONNECTED` enumeration without holding `hub.state()` across user callbacks. - Add synthetic concurrency test `blocking_enumeration_writes_token_first_and_orders_concurrent_poll`.
- Write `*out = registration.token` before inserting the callback into
  `state.callbacks` in `register_device` so no callback invocation (blocking,
  async, or poll-driven) can observe an uninitialized token or race with the
  write to `*out`.
- Track tokens currently running blocking enumeration in `State::enumerating`
  and buffer any concurrent `poll()` transitions for those tokens in
  `State::deferred`, draining them on the registering thread before clearing
  `enumerating` (and dropping them on `forget()`). This prevents `poll()` from
  delivering `DISCONNECTED` ahead of or concurrently with initial `CONNECTED`
  enumeration without holding `hub.state()` across user callbacks.
- Add synthetic concurrency test
  `blocking_enumeration_writes_token_first_and_orders_concurrent_poll`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:45:41 +00:00
Author
Owner

@⁠Revens2 on GitHub · 2026-11-25 07:37 UTC · original

Duplicate of #485: @⁠AscilCH opened this patch 38 minutes earlier, and gh pr diff returns the same bytes for both (+156/-14 on 1 file(s), same title).

Please continue in #485 so the review history and any test data stay in one place.
Thanks.

**@⁠Revens2** on GitHub · 2026-11-25 07:37 UTC · [original](https://github.com/fxceless/victory-fork/pull/534#issuecomment-7156070152) Duplicate of #485: @⁠AscilCH opened this patch 38 minutes earlier, and `gh pr diff` returns the same bytes for both (+156/-14 on 1 file(s), same title). Please continue in #485 so the review history and any test data stay in one place. Thanks.
Author
Owner

@⁠Headache3318 on GitHub · 2026-11-25 09:24 UTC · original

Independent verification: PR #534 merges cleanly onto main (310c6eb), no conflicts. Build: success (8.04s). Tests: fail due to pre-existing issue (E0433 in victory-loader for console_insn module) — identical failure on main without this PR. PR modifies only crates/victory-hle/src/modules/gameinput.rs (+156/-14) — gameinput callback token ordering fix. PR introduces no new failures. Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.

**@⁠Headache3318** on GitHub · 2026-11-25 09:24 UTC · [original](https://github.com/fxceless/victory-fork/pull/534#issuecomment-7158283653) Independent verification: PR #534 merges cleanly onto main (310c6eb), no conflicts. Build: success (8.04s). Tests: fail due to pre-existing issue (E0433 in victory-loader for console_insn module) — identical failure on main without this PR. PR modifies only crates/victory-hle/src/modules/gameinput.rs (+156/-14) — gameinput callback token ordering fix. PR introduces no new failures. Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/534/head:github-bot/gh-534'
git switch 'github-bot/gh-534'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-534'
git switch 'github-bot/gh-534'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-534'
git switch 'github-bot/gh-534'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-534'
git switch 'main'
git merge --squash 'github-bot/gh-534'
git switch 'main'
git merge --ff-only 'github-bot/gh-534'
git switch 'main'
git merge 'github-bot/gh-534'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.