Skip to content

Reject non-finite UKF vectors and keep failed predictions atomic - #5434

Merged
FlorianPfaff merged 2 commits into
mainfrom
agent/fix-ukf-nonfinite-atomicity-20260826
Aug 26, 2026
Merged

Reject non-finite UKF vectors and keep failed predictions atomic#5434
FlorianPfaff merged 2 commits into
mainfrom
agent/fix-ukf-nonfinite-atomicity-20260826

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

  • reject non-finite UKF transition outputs, measurements, and measurement-model outputs at the vector boundary
  • build predicted sigma points before committing x/P, so covariance-validation failures do not corrupt filter state
  • add regressions covering NaN/Inf inputs and failed predicted-covariance validation

Bug

The internal UKF previously allowed NaN/Inf vectors through _as_vector. In addition, predict() assigned self.x and self.P before regenerating/validating sigma points from the predicted covariance. If that validation failed (for example because Q made the predicted covariance non-finite), the method raised after leaving the filter in a partially updated invalid state.

Tests

Added tests/filters/test_ukf_nonfinite_atomicity.py with regressions for:

  • non-finite transition output
  • non-finite measurement
  • non-finite measurement-model output
  • atomic failure when the predicted covariance is non-finite

@FlorianPfaff
FlorianPfaff enabled auto-merge (squash) August 26, 2026 08:09
@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 8.64s
✅ JSON prettier 7 0 0 0 0.81s
✅ JSON v8r 7 0 0 4.17s
✅ MARKDOWN markdownlint 68 0 0 0 2.1s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.45s
✅ PYTHON black 2024 6 0 0 59.79s
✅ PYTHON isort 2024 9 0 0 2.85s
✅ REPOSITORY betterleaks yes no no 1.38s
✅ REPOSITORY checkov yes no no 34.95s
✅ REPOSITORY git_diff yes no no 0.16s
✅ REPOSITORY secretlint yes no no 105.53s
✅ REPOSITORY syft yes no no 3.42s
✅ REPOSITORY trivy-sbom yes no no 2.93s
✅ YAML prettier 11 0 0 0 0.61s
✅ YAML v8r 11 0 0 16.95s
✅ YAML yamllint 11 0 0 1.08s

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 27f2df3 into main Aug 26, 2026
25 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