fix: show the title a pad press that ends between two of its readings #258
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!258
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-258"
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?
@Skyfrye on GitHub · 2026-11-25 21:57 UTC · original
Skyfrye:nep/input-latch→main· +241 −19 · 3 files · 2 commits · draftDraft: the in-game check on this base is pending (the test machine's GPU is in use for a few hours). Everything else below is done.
Change
A title that asks GameInput for a pad's current reading is handed the newest reading our 8 ms poll thread recorded. A button pressed and released between two such requests is in the history (down, then up) but is never the newest reading, so the title does not see it. On a console at 30 frames a second that needs a press shorter than 33 ms. At the 2 to 4 frames a second the game reaches here today, two requests are 0.25 to 0.5 s apart, so an ordinary tap usually falls between them, and so do the 0.2 s presses of
VICTORY_KEYS. This is why the docs told users to hold each key.Now the poll thread notes each pad button that goes down. When the title asks for the current reading and such a button is already up again, it gets one reading made for it: the pad as it is now (sticks and triggers) with that button down. The next poll records the host's state again, so the title's next request shows the release, and "previous of current" has the button up, which is what an edge check compares.
This departs from the console on purpose, in the direction the API's own reference allows for: Microsoft's page for
IGameInput::GetCurrentReadingsays a game that polls it must "permit some missing input". Limits, marked in the code: releases are not latched, two taps of one button between two readings show as one, sticks and triggers are not latched, and a title that both walks a pad's readings forward and asks for the current one would see a short press twice.The second commit updates the controls paragraph of
docs/running-gta6.mdanddocs/fr/lancer-gta6.md(it said a short tap can be missed).Linked issue: none.
Verification
Windows 11 26300, Rust 1.98.1 (MSVC), builds and tests at below-normal priority, RTX 5080, on upstream
mainataffaf15(the Neptune base, PR #243), fromthird_party/victory.Before the change, with the new tests applied to the unchanged input code: the press test and the stand-in test fail (
buttons 0, expected A).In game: pending on this base. On the previous base (
4f2cf5c), two runs of 240 s and 300 s with scripted Enter presses (GTA VI 1.0.2.1, my own copy, launcher settings), with this and three other local fixes: no exception, and the scripted presses still took the title through its start screens into the world. Not measured: how many presses the start screens need before and after; the title was not instrumented for that.Oracle and test data
None involved. Failure cases (5 new tests in
gameinput.rs): a press and release between two readings is shown exactly once, also beside a held button and for two buttons at once; a held button is in every reading and an idle pad reports nothing; a short key press reaches the stand-in pad; a press older than 2 s is dropped; the no-device case.Checklist
E_NOTIMPL), never a fake success. (Not concerned.)AI assistance: written with Claude Code. Claude Fable 5.2 wrote the change and its tests; Claude Sonnet 5.5 ported it to the Neptune base and ran the checks there; Claude Opus 5.5 reviewed the port, ran the game on my machine and wrote this description.
🤖 Generated with Claude Code
@LooperSalty on GitHub · 2026-11-26 00:06 UTC · original
Thanks — please add a
VICTORY_*switch to turn the latch off, so it can be A/B tested, then mark it ready.@KainanP on GitHub · 2026-11-26 10:32 UTC · original
Test report for #258.
Merges cleanly onto current main. Setup: current
origin/main(c4c93bd) merged with this PR, Windows 11 on the RTX 4060 Laptop machine.cargo test --locked -p victory-hle(CPU only, so I did not repeat it per adapter).victory-hleno_dll_plantingNo failure. The five new GameInput tests pass.
Notes from reading the diff:
device == null, only the chosen slot'spressedis cleared. A press on another pad stays latched (up to 2 s) and wins the next null-device request over a newer reading. That is what the PR says it wants, but no test has two pads with a latched press each.State::currentreturnshistory.back()without thekindfilter that picked the slot. That is fine because the latched reading has the same kind as the slot, but adebug_assert!on the kind would keep it true.pressed_atkeeps the time of the newest press only, so an older missed button inpressedlives as long as the newest one. That is a minor case.AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.
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.