Skip to content

Reject non-finite finite-difference steps in EKF trackers - #5442

Merged
FlorianPfaff merged 3 commits into
mainfrom
fix-nonfinite-finite-difference-step
Aug 27, 2026
Merged

Reject non-finite finite-difference steps in EKF trackers#5442
FlorianPfaff merged 3 commits into
mainfrom
fix-nonfinite-finite-difference-step

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Bug

MEMSOEKFTracker and EKFSplineTracker converted finite_difference_step to float and only rejected values <= 0. Because comparisons with NaN are false and +Inf is positive, both trackers accepted non-finite step sizes. Those values then propagate directly into finite-difference perturbations and can produce non-finite Jacobians/Hessians and poison subsequent filter updates.

Fix

  • require finite_difference_step to be finite as well as positive in both trackers
  • keep behavior unchanged for valid positive finite steps
  • add focused regressions for NaN, +Inf, and -Inf

Scope

The production diff is limited to the two constructor guards plus math.isfinite; the new test file only exercises the input contract.

@github-actions

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 7.5s
✅ JSON prettier 7 0 0 0 0.84s
✅ JSON v8r 7 0 0 4.32s
✅ MARKDOWN markdownlint 68 0 0 0 2.22s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.4s
✅ PYTHON black 2027 8 0 0 67.98s
✅ PYTHON isort 2027 11 0 0 3.04s
✅ REPOSITORY betterleaks yes no no 1.36s
✅ REPOSITORY checkov yes no no 36.65s
✅ REPOSITORY git_diff yes no no 0.19s
✅ REPOSITORY secretlint yes no no 109.12s
✅ REPOSITORY syft yes no no 3.27s
✅ REPOSITORY trivy-sbom yes no no 2.88s
✅ YAML prettier 11 0 0 0 0.69s
✅ YAML v8r 11 0 0 17.09s
✅ YAML yamllint 11 0 0 1.23s

Notices

⚠️ Your configuration references items that have been removed from MegaLinter and are ignored: MAKEFILE_CHECKMAKE. See Removed linters to find their replacements.

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.0.0 --custom-flavor-setup --custom-flavor-linters PYTHON_BLACK,PYTHON_ISORT,COPYPASTE_JSCPD,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY_SBOM,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@FlorianPfaff
FlorianPfaff merged commit b03c732 into main Aug 27, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant