GameInput: look up only devices already seen by the process #2512
No reviewers
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!2512
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2512"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 15:04 UTC · original
andrewpozdnakov7-jpg:codex2/gameinput-unseen-id→main· +50 −2 · 1 files · 2 commits · openFindDeviceFromId 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.
@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. Sofind_by_idincrates/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_seencovers 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 afterpolldrops it.CI: passing (
check).Generated by Claude Code
@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::FindDeviceFromIdThe 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_FOUNDfor a never-seen slot and keeping a previously seen slot findable are VIctory's choices; the synthetic test at42dae70covers both. GameInput device IDs · GameInput device lifetime@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 base940d32f).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo 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.lookup_by_id_only_finds_devices_that_have_been_seen.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#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_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 02:17 UTC · original
I reproduced both failures with
42dae70merged into63bcca43. 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
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.