Skip to content

Validate Kalman process and measurement covariances - #5465

Merged
FlorianPfaff merged 2 commits into
mainfrom
fix/kalman-noise-covariance-validation
Aug 30, 2026
Merged

Validate Kalman process and measurement covariances#5465
FlorianPfaff merged 2 commits into
mainfrom
fix/kalman-noise-covariance-validation

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

  • validate direct Kalman process-noise covariances (Q) as symmetric PSD matrices before prediction
  • validate measurement-noise covariances (R) before innovation, standard updates, and robust updates
  • reuse the existing backend-native eigenvalue tolerance used for Kalman state covariance validation
  • keep failures atomic so invalid noise inputs cannot corrupt the filter state
  • retain support for singular positive-semidefinite covariances

Bug

The direct KalmanFilter API previously only received shape/finite checks from the linear-Gaussian primitives. For example, a 1-D filter with P=1 accepted Q=-2 and predict_identity() produced/stored P=-1 because the resulting Gaussian is constructed with check_validity=False. Likewise invalid negative measurement-noise covariance could enter update and innovation calculations.

Tests

Adds regression coverage for:

  • non-PSD process noise rejected atomically
  • non-PSD measurement noise rejected atomically
  • innovation path rejects non-PSD measurement noise
  • robust update rejects non-PSD measurement noise atomically
  • singular PSD process/measurement noise remains supported

@FlorianPfaff
FlorianPfaff enabled auto-merge (squash) August 30, 2026 21: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 7.33s
✅ JSON prettier 7 0 0 0 0.62s
✅ JSON v8r 7 0 0 5.06s
✅ MARKDOWN markdownlint 68 0 0 0 2.56s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.74s
✅ PYTHON black 2037 1 0 0 67.35s
✅ PYTHON isort 2037 6 0 0 2.86s
✅ REPOSITORY betterleaks yes no no 1.23s
✅ REPOSITORY checkov yes no no 35.62s
✅ REPOSITORY git_diff yes no no 0.13s
✅ REPOSITORY secretlint yes no no 107.41s
✅ REPOSITORY syft yes no no 2.78s
✅ REPOSITORY trivy-sbom yes no no 2.74s
✅ YAML prettier 11 0 0 0 0.58s
✅ YAML v8r 11 0 0 18.4s
✅ YAML yamllint 11 0 0 1.01s

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 cb07d42 into main Aug 30, 2026
24 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