startup_stubs: fix GameInput single-kind history step-back and init race #1574
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1581"
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 R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T14:35:01Z.
Summary
src/startup_stubs/gameinput.cpp: Fixfind_in_ring()/find_history()so a single-kindGetPreviousReading()call steps past the reference reading's own sequence number even when a different input kind advancedorderafter that kind last changed. Previously,GetCurrentReading(kind_gamepad)after a keyboard-only change received the newerorder, causingGetPreviousReading(ref, kind_gamepad)to return the same gamepad reading again (or succeed instead of returningreading_not_foundfrom the first gamepad state).src/startup_stubs/gameinput.cpp: Makebuild()thread-safe using C++11 static local initialization so concurrentGameInputCreate()calls cannot observe partially initialized vtables.tests/startup_gameinput_history.cpp&CMakeLists.txt: Addstartup_gameinput_historycovering single-kindGetPreviousReading()after cross-kind changes, boundaryreading_not_found, cross-kindGetPreviousReading(), and concurrentGameInputCreate().Verification
git diff --check origin/main...HEADpython -B tests/bidi_controls_check.py/O2) CTest (startup_gameinput_history,startup_gameinput_keys,startup_stubs)AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T14:41:50Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
d76813aℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T15:01:39Z.
The new source-built combined-reference control failed on
d76813a7: after a keyboard-only change, requesting the previous gamepad reading skipped the closest gamepad event.3329b4cdapplies the step-back rule only when both the requested filter and the reference are the same single kind. The combined control, existing single-kind/concurrent cases, and both timestamp CTests pass on Windows Release (3/3).