GameInput: look up only devices already seen by the process #2512

Open
github-bot wants to merge 2 commits from github-bot/gh-2512 into main AGit
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-25 15:04 UTC · original
andrewpozdnakov7-jpg:codex2/gameinput-unseen-id → main · +50 −2 · 1 files · 2 commits · open

FindDeviceFromId currently searches every preallocated pad slot. An ID saved by the application can therefore resolve at startup before any pad has appeared in that slot.

Only resolve IDs for slots that have produced an input reading. The history keeps the ID usable for a device this process has already seen after it disconnects.

The synthetic GameInput test gets S_OK for a never-connected pad on the original base, 940d32f. With this fix and #1430 from current main, a never-seen pad and a slot with only an initial all-zero report both return DEVICE_NOT_FOUND and a null output. A button report establishes the ID, which remains usable through idle and disconnect. The existing rumble test now starts with a button report as well.

Both focused tests and all 153 HLE library tests passed on current main 63bcca43, in both default and diagnostics builds. Strict HLE Clippy in both builds and staged asset policy passed.

GameInput lookup behavior · Coordination claim

Please retain the Git author when cherry-picking or rebasing. If you fold the change into another commit, please add:

Co-authored-by: andrewpozdnakov7-jpg [email protected]

AI-assisted with Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-25 15:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/2512) `andrewpozdnakov7-jpg:codex2/gameinput-unseen-id` → `main` · +50 −2 · 1 files · 2 commits · open FindDeviceFromId currently searches every preallocated pad slot. An ID saved by the application can therefore resolve at startup before any pad has appeared in that slot. Only resolve IDs for slots that have produced an input reading. The history keeps the ID usable for a device this process has already seen after it disconnects. The synthetic GameInput test gets S_OK for a never-connected pad on the original base, 940d32f. With this fix and #1430 from current main, a never-seen pad and a slot with only an initial all-zero report both return DEVICE_NOT_FOUND and a null output. A button report establishes the ID, which remains usable through idle and disconnect. The existing rumble test now starts with a button report as well. Both focused tests and all 153 HLE library tests passed on current main 63bcca43, in both default and diagnostics builds. Strict HLE Clippy in both builds and staged asset policy passed. [GameInput lookup behavior](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/interfaces/igameinput/methods/igameinput_finddevicefromid) · [Coordination claim](https://git.gtahub.st/github/Marvisak--VIctory/issues/1633) Please retain the Git author when cherry-picking or rebasing. If you fold the change into another commit, please add: Co-authored-by: andrewpozdnakov7-jpg <[email protected]> AI-assisted with Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:07:54 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:53 UTC · original · edited 2026-11-26 03:23 UTC

Automated triage for the maintainers.

Verdict: merge candidate (unchanged). The new head merges main (with #1430) and changes only the tests. #1430 keeps a host pad disconnected until it reports non-rest input. So find_by_id in crates/victory-hle/src/modules/gameinput.rs, which requires a non-empty slot history, now finds a pad from its first real input. That is the same point at which the title sees it connect, so the lookup and the connection events agree. lookup_by_id_only_finds_devices_that_have_been_seen covers four cases: never seen, an all-zero first report (still not found), a button report, and then the ID staying found through idle, disconnect and reconnect. The rumble test now starts with a button report, as it needs to under #1430. The lock is held only for the lookup; callbacks are delivered after poll drops it.

CI: passing (check).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 15:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/2512#issuecomment-7167404247) · edited 2026-11-26 03:23 UTC <!-- victory-triage v1 head=12986bb6c4292b9c08ee190a6953465e32f56f2a verdict=merge-candidate at=2026-11-26T03:23:06Z --> Automated triage for the maintainers. **Verdict: merge candidate (unchanged).** The new head merges `main` (with #1430) and changes only the tests. #1430 keeps a host pad disconnected until it reports non-rest input. So `find_by_id` in `crates/victory-hle/src/modules/gameinput.rs`, which requires a non-empty slot history, now finds a pad from its first real input. That is the same point at which the title sees it connect, so the lookup and the connection events agree. `lookup_by_id_only_finds_devices_that_have_been_seen` covers four cases: never seen, an all-zero first report (still not found), a button report, and then the ID staying found through idle, disconnect and reconnect. The rumble test now starts with a button report, as it needs to under #1430. The lock is held only for the lookup; callbacks are delivered after `poll` drops it. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-25 16:01 UTC · original

Following up on the documentation check. The reference page explicitly says that an identifier with no matching known GameInput device object yields a null output pointer. Microsoft Learn — IGameInput::FindDeviceFromId

The device overview documents stable IDs across reconnects, and the interface reference says a device object already held by an application stays valid after disconnect. Returning DEVICE_NOT_FOUND for a never-seen slot and keeping a previously seen slot findable are VIctory's choices; the synthetic test at 42dae70 covers both. GameInput device IDs · GameInput device lifetime

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-25 16:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/2512#issuecomment-7167528721) Following up on the [documentation check](https://git.gtahub.st/github/Marvisak--VIctory/pulls/2512). The reference page explicitly says that an identifier with no matching known GameInput device object yields a null output pointer. [Microsoft Learn — `IGameInput::FindDeviceFromId`](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/interfaces/igameinput/methods/igameinput_finddevicefromid?view=gdk-2604#remarks) The device overview documents stable IDs across reconnects, and the interface reference says a device object already held by an application stays valid after disconnect. Returning `DEVICE_NOT_FOUND` for a never-seen slot and keeping a previously seen slot findable are VIctory's choices; the synthetic test at `42dae70` covers both. [GameInput device IDs](https://learn.microsoft.com/en-us/gaming/gdk/docs/features/common/input/overviews/input-devices?view=gdk-2604#device-ids) · [GameInput device lifetime](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice?view=gdk-2604#remarks)
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-26 01:42 UTC · original

Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head 42dae70 (on its base 940d32f).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 697 passed, 0 failed, 10 ignored.
  • The new tests ran and passed: lookup_by_id_only_finds_devices_that_have_been_seen.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-26 01:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/2512#issuecomment-7180052022) Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `42dae70` (on its base `940d32f`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **697 passed, 0 failed, 10 ignored**. - The new tests ran and passed: `lookup_by_id_only_finds_devices_that_have_been_seen`. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 02:17 UTC · original

I reproduced both failures with 42dae70 merged into 63bcca43. 12986bb gives both fixtures a button report before expecting a known ID. The lookup test also checks the initial all-zero report is ignored, then checks the ID remains known through idle and disconnect.

Both focused tests passed. All 153 victory-hle library tests passed in each of the default and diagnostics builds. Strict Clippy with both feature sets and asset policy passed.

Review

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 02:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/2512#issuecomment-7180660306) I reproduced both failures with 42dae70 merged into 63bcca43. [12986bb](https://github.com/Marvisak/VIctory/commit/12986bb6c4292b9c08ee190a6953465e32f56f2a) gives both fixtures a button report before expecting a known ID. The lookup test also checks the initial all-zero report is ignored, then checks the ID remains known through idle and disconnect. Both focused tests passed. All 153 victory-hle library tests passed in each of the default and diagnostics builds. Strict Clippy with both feature sets and asset policy passed. [Review](https://git.gtahub.st/github/Marvisak--VIctory/pulls/2512)
This pull request can be merged automatically.
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/2512/head:github-bot/gh-2512'
git switch 'github-bot/gh-2512'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2512'
git switch 'github-bot/gh-2512'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2512'
git switch 'github-bot/gh-2512'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2512'
git switch 'main'
git merge --squash 'github-bot/gh-2512'
git switch 'main'
git merge --ff-only 'github-bot/gh-2512'
git switch 'main'
git merge 'github-bot/gh-2512'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2512
No description provided.