Repository navigation
Conversation
|
Tested Built |
|
I tested whether an out-of-order input could move the 300 ms controller-switch deadline. I used the public Both builds first switched to PlayStation 5 at 1,000,000 microseconds. I then sent these three presses in this order.
The fresh Xbox press at exactly 300 ms was accepted on the PR. The same probe matched all 7 expected observations on the PR and 4 of 7 on the parent. AI-assisted verification. |
|
With step 2, the final sample returns |
|
Tested
Not checked: that the new case fails without the |
|
Baseline on main here: AI-assisted (Claude Code). |
|
Tested
So the new test depends on the change. A consequence noted by the agent, which I did not check: an out-of-order (earlier) timestamp is now ignored even when the debounce window is zero. The agent also built the test under ASan/UBSan and reports it clean; I did not repeat the sanitizer build. Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting. |
Problem
In
runtime/src/active_input.h(ActiveInputTracker::observe), the debounce check computestime_us - changed_at_ < thresholds_.min_switch_usonstd::uint64_ttimestamps. If an out-of-order sample arrives withtime_us < changed_at_, the unsigned subtraction wraps around to a huge value (~UINT64_MAX), bypassingmin_switch_usand overwritingchanged_at_backwards.Fix
time_us < changed_at_before subtracting inActiveInputTracker::observe()so stale/out-of-order timestamps are ignored instead of underflowing.runtime/test/active_input_test.cpp(test_min_switch_time).Testing
Synthetic inputs only; no game files and no GPU used. Tested on Fedora Linux 43:
main(43a9c04): FAIL (line 118: t.observe(xbox, InputFamily::Xbox, button(1), 1850 * ms) == InputEdge::None)g++ -std=c++20 -Wall -Wextra -Werror runtime/test/active_input_test.cpp: 7/7 passclang++ -std=c++20 -Wall -Wextra -Werror runtime/test/active_input_test.cpp: 7/7 passAI-assisted: yes.