GameInput: deliver registered reading callbacks #2555

Open
andrewpozdnakov7-jpg wants to merge 2 commits from upstream-pr/2557 into main
andrewpozdnakov7-jpg commented 2026-11-25 15:43:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T15:43:13Z.


Problem

RegisterReadingCallback returns S_OK and a token, but changes in host input never reach the registered callback.

Fix

Dispatch new readings through the existing GameInput poll loop with the v0 callback signature. Respect the input-kind and device filters, accumulate stick or trigger movement against the last report for each subscriber, and deliver button changes immediately. Keep the reading alive during the call and use the existing stop/unregister lifecycle.

Verification

  • On da82e44, the synthetic test registers successfully but records zero callbacks after the stick crosses the threshold and a button is pressed.
  • With this change, the same test receives both pad readings. The fixture also checks that registration does not replay the current state, other devices and input kinds are filtered, reconnect delivers the new reading, and stop/unregister prevent future calls. Keyboard delivery uses the same registration entry point.
  • The local HLE library suite with diagnostics and strict HLE Clippy passed.

Microsoft GameInput callback behavior · v0 callback signature history · Coordination claim

If you cherry-pick or rebase this commit, please retain its Git author. If you fold the change into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

AI-assisted. Verification used synthetic host input.

CI follow-up

The GameInput regression passed in the original workflow. The shader harness failed on the same WARP assertion on da82e44 itself. Upstream 67e8ae1 zeroes the test UAVs and passes CI. All 10 GameInput tests and strict HLE Clippy also pass with the same patch on 67e8ae1.

Original main run · Fixed main run · Retested commit

<!-- greyfinch-sync:Marvisak/VIctory:issue:6608242733 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2557). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-25T15:43:13Z. --- ## Problem `RegisterReadingCallback` returns `S_OK` and a token, but changes in host input never reach the registered callback. ## Fix Dispatch new readings through the existing GameInput poll loop with the v0 callback signature. Respect the input-kind and device filters, accumulate stick or trigger movement against the last report for each subscriber, and deliver button changes immediately. Keep the reading alive during the call and use the existing stop/unregister lifecycle. ## Verification - On `da82e44`, the synthetic test registers successfully but records zero callbacks after the stick crosses the threshold and a button is pressed. - With this change, the same test receives both pad readings. The fixture also checks that registration does not replay the current state, other devices and input kinds are filtered, reconnect delivers the new reading, and stop/unregister prevent future calls. Keyboard delivery uses the same registration entry point. - The local HLE library suite with diagnostics and strict HLE Clippy passed. [Microsoft GameInput callback behavior](https://learn.microsoft.com/en-us/gaming/gdk/docs/features/common/input/advanced/input-callbacks?view=gdk-2604) · [v0 callback signature history](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/functions/gameinputreadingcallback) · [Coordination claim](https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7166910785) If you cherry-pick or rebase this commit, please retain its Git author. If you fold the change into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted. Verification used synthetic host input. ## CI follow-up The GameInput regression passed in the original workflow. The shader harness failed on the same WARP assertion on `da82e44` itself. Upstream `67e8ae1` zeroes the test UAVs and passes CI. All 10 GameInput tests and strict HLE Clippy also pass with the same patch on `67e8ae1`. [Original main run](https://github.com/Marvisak/VIctory/actions/runs/45646502480/job/139318811414) · [Fixed main run](https://github.com/Marvisak/VIctory/actions/runs/45648653139/job/139326635571) · [Retested commit](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/db3dbb0b9e1a15fd6c01a6ceba03555c2be8528f)
Marvisak commented 2026-11-25 19:06:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T18:38:33Z.


Automated triage for the maintainers.

Needs work (unchanged). The head (a6419be) has not changed since the last review. register_reading in crates/victory-hle/src/modules/gameinput.rs still replaces the documented shortcut on main (the title registers no reading callback; it polls) with about 300 lines of delivery code.

On your reply: thanks for confirming that no title run shows the registration yet, and that the accumulated-delta threshold rule has not been compared with the console runtime. That leaves the same two things that would change the verdict: a title-run log showing the existing input reading callbacks are never called warning, and, if the callback turns out to be needed, a reference for how the threshold is applied. CI: check passing.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171191686 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2557#issuecomment-7171191686). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T18:38:33Z. --- <!-- victory-triage v1 head=a6419befe4e56a5adc5c4ae411bfc18f0ff57128 verdict=needs-work at=2026-11-26T00:24:13Z --> Automated triage for the maintainers. **Needs work (unchanged).** The head (`a6419be`) has not changed since the last review. `register_reading` in `crates/victory-hle/src/modules/gameinput.rs` still replaces the documented shortcut on `main` (the title registers no reading callback; it polls) with about 300 lines of delivery code. On your reply: thanks for confirming that no title run shows the registration yet, and that the accumulated-delta threshold rule has not been compared with the console runtime. That leaves the same two things that would change the verdict: a title-run log showing the existing `input reading callbacks are never called` warning, and, if the callback turns out to be needed, a reference for how the threshold is applied. CI: `check` passing. --- _Generated by [Claude Code](https://claude.ai/code)_
andrewpozdnakov7-jpg commented 2026-11-25 19:06:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T18:41:52Z.


Re: the triage note. The before/after at a6419be uses a synthetic guest calling the v0 entry point. I found no title-run trace showing registration, so the evidence establishes the API behavior in the fixture only. The existing warning on main would confirm the call if it appears in a title run.

Microsoft documents delivery on subsequent state changes and a minimum movement filter for analog input. The exact accumulated-delta rule in this patch still needs comparison with native v0 behavior. I’ll leave the PR pending the title trace. Registration remarks · Analog filter

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171268721 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2557#issuecomment-7171268721). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-25T18:41:52Z. --- Re: [the triage note](https://github.com/Marvisak/VIctory/pull/2557#issuecomment-7171191686). The before/after at `a6419be` uses a synthetic guest calling the v0 entry point. I found no title-run trace showing registration, so the evidence establishes the API behavior in the fixture only. The existing [warning on main](https://github.com/Marvisak/VIctory/blob/13f91caee25f2fdf2c062be5f7a27f058e51cbca/crates/victory-hle/src/modules/gameinput.rs#L774) would confirm the call if it appears in a title run. Microsoft documents delivery on subsequent state changes and a minimum movement filter for analog input. The exact accumulated-delta rule in this patch still needs comparison with native v0 behavior. I’ll leave the PR pending the title trace. [Registration remarks](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerreadingcallback?view=gdk-2604) · [Analog filter](https://learn.microsoft.com/en-us/gaming/gdk/docs/features/common/input/advanced/input-callbacks?view=gdk-2604) AI-assisted.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2557:upstream-pr/2557'
git switch 'upstream-pr/2557'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2557'
git switch 'upstream-pr/2557'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2557'
git switch 'upstream-pr/2557'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2557'
git switch 'main'
git merge --squash 'upstream-pr/2557'
git switch 'main'
git merge --ff-only 'upstream-pr/2557'
git switch 'main'
git merge 'upstream-pr/2557'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!2555
No description provided.