gameinput: report a missed press once to a slow reader (RT-GAMEINPUT-SLOW-READER) #1510
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1510"
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?
Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-25T02:50:31Z.
Claimed in the coordination issue as: RT-GAMEINPUT-SLOW-READER (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7151130854)
Carries DadaCap's
kSlowReaderUsfrom theirboot-prototypebranch (commit fa497b930), with DadaCap's authorship and date kept, as agreed in #14 (comment 7151032887).What and why
The title reads each pad with
GetCurrentReadingonce a frame. At a few frames a second, a press can start and end between two reads, so it's lost. That's why the first-run pages need several presses to advance at low frame rates (#233 fills the history, which the title doesn't read). Each pad now remembers the newest reading that pressed a button the last read didn't report. A read that comes more thankSlowReaderUs(50 ms) after the previous one is given that press once, and the next read gets the pad's real state.close_padclears it.Scope: only the GameInput part of fa497b930 (
runtime/shims/gameinput.cpp+32,runtime/test/gameinput_test.cpp+16), unchanged apart from line positions. The prototype's other changes in that commit aren't included. It doesn't conflict with #1074'sLEONIDA_INPUT_SCRIPT: scripted presses go through the same path, so a short scripted press now also reaches a slow reader.Tested
Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja, RelWithDebInfo, on main
2213d5cb8:gameinput,gameinput_hostandgameinput_scriptpass, both plain and withLEONIDA_VK_VALIDATION=1.gameinput_testruns 365 checks with 0 failures, including "a slow reader sees a missed press once".test_runtime_paths, which is red on main since #939 (tools/conformance/**missing inruntime.yml; reported on #939). That's unrelated to this PR.GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.24, Windows 11
AI-assisted: yes
Checklist
mainand merges cleanly.docs/design.md. (n/a)AI-assisted (Claude Code, Claude Opus 5.5).
🤖 Generated with Claude Code
https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
Imported from ubiquitarianism/leonida. Originally posted by ytsodacan on 2026-11-25T03:34:10Z.
[KEEP]
runtime/shims/gameinput.cppandruntime/test/gameinput_test.cppand addresses the same missed-press problem; #1528 also editsgameinput. A maintainer should decide which approach lands and the others should rebase on it.GetCurrentReadingnow has side effects (a storedmissedreading,read_buttons/read_usstate, and a 50 mskSlowReaderUstiming heuristic), so returning a stale press once changes what callers see; this deserves maintainer sign-off.a slow reader sees a missed press once), with a wall-clockSleep(80)that could be flaky on slow runners; it does not coverclose_padreset or multiple devices.windows,macos,linux-gpu-tools,no-game-data,change-scope), so the build and test are unverified.Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-25T03:37:54Z.
Thanks @ytsodacan, fair points:
GetCurrentReadingonce a frame and never the history, so the history alone doesn't bring the press back. That's why this changes what the current reading returns. #233 is still a draft. If a maintainer prefers one approach, I'm happy to rebase this onto it or drop it.close_padand multiple devices aren't covered, and that theSleep(80)against the 50 ms threshold is timing-based. I'll add aclose_padreset case and a two-device case, and widen the margin.AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-25T03:40:22Z.
Added the coverage asked for, in
045bb0fce(DadaCap's commit is untouched):gameinput_testnow runs 369 checks with 0 failures, and ctest^gameinputpasses 3/3 both plain and with validation. Against main's shim, the slow-reader and per-pad checks fail. With the fix but without the reset inclose_pad, the close_pad check fails, so it does catch a missing reset.AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by djrolfes on 2026-11-25T11:11:21Z.
Independent RTX 3070 Ti / Linux Wine 11.22 integration validation starting for exact head
045bb0fce. Main42537e7b6+ owned #1558 / FSPX translator fixes now reaches the rendered first-run setup. With two ordinary scripted A presses, each logged by GameInput (60 s and 100 s), the first moves from the player prompt to Navigation Experience, but the second does not visibly advance it by the 160-second bound. Presented captures after the first press are ~36 seconds apart, so this is consistent with your slow-reader diagnosis, not yet proof of the exact consumption path.I have preserved that build and am adding only your two commits before synthetic GameInput checks and the identical bounded two-press retest. Runtime assertions/watchdog stay enabled; no legal agreement acceptance is scripted. No duplication of implementation ownership; raw images/logs stay local. AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by djrolfes on 2026-11-25T11:16:56Z.
Retest update: exact head
045bb0fceapplied locally as a14a691b7 builds; gameinput passes 369 checks and gameinput_script passes 10. gameinput_host fails the same three checks on both this candidate and unmodified42537e7b6under the same Wine prefix (host GameInputCreate returns E_NOTIMPL), so that host-comparison limitation is not counted as a shim pass.The identical 160-second retail probe with A@60/A@100 still ends visually on Navigation Experience. Both scripted presses are logged; 25,450 native graphics PSOs succeed, no fatal title exception, and late captures are ~45 seconds apart per 300 frames. This does NOT establish that the fix is ineffective generally, nor that this title read used the covered explicit-pad path. I am adding opt-in local GetCurrentReading return-path/button-state logging, with no behavior change, to distinguish actual delivery from a mere poll-thread press log. The diagnostic will not be submitted as a competing implementation. No legal acceptance or world claim; raw evidence remains local. AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by djrolfes on 2026-11-25T19:19:32Z.
Diagnostic/caveat update: the local trace confirms this title uses the explicit-pad GetCurrentReading path, predominantly one caller/thread. A press delayed beyond its real 300 ms hold is returned once by the fix, then the current released state is returned on the next read; a press sampled while held appears in repeated reads. That matches the intended policy. It does not by itself prove the UI consumes the one-shot replay.
Important configuration caveat: I found that my local launcher used --run rather than the documented --first-run-ui profile, so it omitted the profile’s graphics-layout, GPU-label and frame-pacing defaults. Treat the earlier setup-page symptom as evidence from that incomplete/custom configuration, NOT a confirmed failure of this PR under the supported UI profile. I am correcting the launcher/profile and refreshing the independent main baseline before further attribution. No delivery policy was changed in the diagnostic build; no legal agreement was accepted. AI-assisted; raw traces/images remain local.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T20:18:18Z.
Red/green: On main gameinput_test fails because a slow reader never sees a press it missed (two pads, one press each), and with the PR ctest -R "^gameinput(_script)?$" passes on Windows 11 at OreoFR's (RTX 4070).
Independent tester (OreoFR, RTX 4070, Windows 11): PR head merged with the other PRs of its batch on main
c1ecf04ed, full ctest run (485 tests, tests that launch the game excluded): no new failure compared with main.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:51:53Z.
Verified by OreoFR
Run 1 (nat05)
c1ecf04ed+ PR head045bb0fce; green run in a merge package of 12 PRs, no new ctest failure vs mainctest -R "^gameinput(_script)?$"Run 2 (lot 4)
09c153948+ PR head045bb0fce; integration package 1 of 6 (20 PRs, merged without conflict)Run 3 (lot 4 bis)
33db04a70+ PR head045bb0fce; integration package of 15 PRsAll runs
AI-assisted (Claude Code, Claude Opus 5.5).