Skip to content

fix: clamp trig LUT index to prevent OOB reads on close points - #371

Merged
jgauchia merged 1 commit into
develfrom
devel_fix_simulator
Jul 31, 2026
Merged

fix: clamp trig LUT index to prevent OOB reads on close points#371
jgauchia merged 1 commit into
develfrom
devel_fix_simulator

Conversation

@jgauchia

Copy link
Copy Markdown
Owner

sinLUT/cosLUT could index beyond LUT_SIZE when a small angle rounded to 2*PI in float32, making calcDist/calcCourse return garbage for points <~3m apart. This broke simFakeGPS (jumps/ stalls on dense tracks) and corrupted close-range navigation distances, track accumDist and grades.

Raise sim track-cut threshold to 50km and derive climb subjects from the interpolated position.

sinLUT/cosLUT could index beyond LUT_SIZE when a small angle
rounded to 2*PI in float32, making calcDist/calcCourse return
garbage for points <~3m apart. This broke simFakeGPS (jumps/
stalls on dense tracks) and corrupted close-range navigation
distances, track accumDist and grades.

Raise sim track-cut threshold to 50km and derive climb subjects
from the interpolated position.
@jgauchia jgauchia self-assigned this Jul 31, 2026
@jgauchia jgauchia added the bug Something isn't working label Jul 31, 2026
@jgauchia jgauchia mentioned this pull request Jul 31, 2026
2 tasks
@jgauchia
jgauchia marked this pull request as ready for review July 31, 2026 20:57
@jgauchia
jgauchia merged commit 1e4753f into devel Jul 31, 2026
2 checks passed
@jgauchia
jgauchia deleted the devel_fix_simulator branch July 31, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant