Repository navigation
track: fix integer division in speed_check track age factor - #154
Merged
wiedehopf merged 1 commit intoSep 23, 2026
Merged
Conversation
track_age and track_max_age are both int64_t, so (1.0f - track_age / track_max_age) is 1.0 for every track younger than track_max_age (5 s), which is the only case where the branch runs. The track bonus (or penalty, for positions against the track) was meant to fade out with the age of the track and never did. Cast to float. Factor before -> after: 0.5 s 1.00 -> 0.90, 1 s 1.00 -> 0.80, 2.5 s 1.00 -> 0.50, 4.9 s 1.00 -> 0.02. A/B on the same live Beast feed (single RTL-SDR receiver at SKCL, 7 h, 232754 global and 1008 local CPR decodes): no speed_check rejections in either build, all cpr counters identical. The change only matters when a position is near the speed limit, which this feed did not exercise. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BqHQDHRKNRuJHR4oQB55L
wiedehopf
approved these changes
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
track_age and track_max_age are both int64_t, so
(1.0f - track_age / track_max_age) is 1.0 for every track younger than track_max_age (5 s), which is the only case where the branch runs. The track bonus (or penalty, for positions against the track) was meant to fade out with the age of the track and never did. Cast to float.
Factor before -> after: 0.5 s 1.00 -> 0.90, 1 s 1.00 -> 0.80, 2.5 s 1.00 -> 0.50, 4.9 s 1.00 -> 0.02.
A/B on the same live Beast feed (single RTL-SDR receiver at SKCL, 7 h, 232754 global and 1008 local CPR decodes): no speed_check rejections in either build, all cpr counters identical. The change only matters when a position is near the speed limit, which this feed did not exercise.