RT-ACTIVE-INPUT-DEBOUNCE-NAN: active_input: guard timestamp underflow in debounce and ignore non-finite axes #902
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!902
Loading…
Reference in a new issue
No description provided.
Delete branch "ubiq-active-input-debounce-and-nan"
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?
Pull request successfully merged and closed
Hardens
runtime/src/active_input.hagainst unsigned timestamp underflow and non-finite analog samples:ActiveInputTracker::observe): Previouslytime_us - changed_at_ < thresholds_.min_switch_uswrapped around to~UINT64_MAXwhenever an out-of-order/earlier timestamp (time_us < changed_at_) arrived, bypassingmin_switch_usand switching active input families immediately. Now guardstime_us < changed_at_ || time_us - changed_at_ < thresholds_.min_switch_us.ActiveInputTracker::edge_between): Checksstd::isfiniteon previous and current stick/trigger floats so aNaNbaseline orInfspike cannot trigger a bogus family switch.Verification
-Wall -Wextra -Werror -pedantic -fsanitize=address,undefined):runtime/test/active_input_test.cpppasses 8/8 cases cleanly.main:out-of-order timestamp and non-finite axesfails as expected.python3 -I scripts/check_no_game_data.py runtime/src/active_input.h runtime/test/active_input_test.cpp: clean.Claimed in the coordination issue as: RT-ACTIVE-INPUT-DEBOUNCE-NAN (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135437104)
AI-assisted: yes (Gemini)
@KernelSmoker Thanks for checking! I just double-checked exact head
27c930020f7539abf6e9e721a72599ce0c4b4953—test_out_of_order_timestamp_and_non_finite_axesis already registered incases[]inruntime/test/active_input_test.cpp(right aftertest_forced), and compiling + runningruntime/test/active_input_test.cppprints:Could you double-check whether an older build artifact or base checkout was executed? AI-assisted (Gemini).
Merging.
Why merged: RT-ACTIVE-INPUT-DEBOUNCE-NAN: active_input ignores an out-of-order timestamp in the debounce and ignores NaN/Inf stick and trigger samples. KernelSmoker's note that the new case wasn't registered doesn't apply at this head: it's in cases[] and runs ("8 of 8 cases pass"), as the author replied.
Why it's good: Header-only logic. active_input passes both plain and under validation.
Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 66d4f5aa3, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative of this batch (13 PRs) on main 0b45fdc21: the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The only failures are main's: d3d12_depth_resolve (pre-existing) and d3d12_close_parity (the #510 regression, fixed by #1286). All d3d12_* tests under validation show 0 VUIDs. git merge-tree against current main 6261ca916: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).