mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:15:51 +01:00
[PR #902] [MERGED] RT-ACTIVE-INPUT-DEBOUNCE-NAN: active_input: guard timestamp underflow in debounce and ignore non-finite axes #942
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#942
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/902
Author: @narekshaghoyandev
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:ubiq-active-input-debounce-and-nan📝 Commits (1)
27c9300active_input: guard timestamp underflow in debounce and ignore non-finite axes📊 Changes
2 files changed (+49 additions, -5 deletions)
View changed files
📝
runtime/src/active_input.h(+12 -5)📝
runtime/test/active_input_test.cpp(+37 -0)📄 Description
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)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.