Skip to content

Reject complex SE2 UKF inputs - #5005

Merged
FlorianPfaff merged 2 commits into
mainfrom
agent/reject-complex-se2-ukf-inputs
Aug 7, 2026
Merged

Reject complex SE2 UKF inputs#5005
FlorianPfaff merged 2 commits into
mainfrom
agent/reject-complex-se2-ukf-inputs

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Bug

SE2UKF accepted complex-valued dual-quaternion states, noise distributions, and measurements whenever their shapes, finiteness, and real-valued geometric checks happened to pass.

For example, the measurement [1+0j, 0, 1j, 0] has a valid unit rotation part and finite entries, so the existing validator accepted it. The identity update then propagated the imaginary translation into an otherwise real filter state; with the default state and 0.1 I measurement covariance, the posterior translation becomes approximately 0.909i.

Complex dual-quaternion coordinates are outside the real SE(2) state space represented by this filter.

Fix

  • detect complex NumPy/JAX arrays and PyTorch tensors before geometric validation
  • reject complex state and noise means
  • reject complex state and noise covariances
  • reject complex measurements before any update calculations
  • preserve the existing filter state when measurement validation fails

Regression coverage

  • a complex measurement raises ValueError and leaves the posterior mean and covariance unchanged
  • a manually corrupted complex filter-state mean is rejected by the public setter

Validation

  • branch is based on the current main head and is zero commits behind
  • final comparison is limited to se2_ukf.py and one focused regression-test file
  • an isolated numerical reproduction confirmed the pre-fix complex posterior contamination
  • repository CI should provide the complete NumPy, JAX, PyTorch, lint, packaging, and documentation matrix

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 29.58s
✅ JSON prettier 7 0 0 0 1.11s
✅ JSON v8r 7 0 0 5.14s
✅ MARKDOWN markdownlint 68 0 0 0 1.77s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.51s
✅ PYTHON black 1828 65 0 0 96.22s
✅ PYTHON isort 1828 99 0 0 2.84s
✅ REPOSITORY betterleaks yes no no 2.44s
✅ REPOSITORY checkov yes no no 57.0s
✅ REPOSITORY gitleaks yes no no 17.34s
✅ REPOSITORY git_diff yes no no 0.36s
✅ REPOSITORY secretlint yes no no 85.04s
✅ REPOSITORY syft yes no no 6.58s
✅ REPOSITORY trivy-sbom yes no no 7.23s
✅ REPOSITORY trufflehog yes no no 32.09s
✅ YAML prettier 11 0 0 0 0.75s
✅ YAML v8r 11 0 0 12.81s
✅ YAML yamllint 11 0 0 0.45s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

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@9.6.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_GITLEAKS,REPOSITORY_BETTERLEAKS,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

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

@FlorianPfaff
FlorianPfaff marked this pull request as ready for review August 7, 2026 18:25
@FlorianPfaff
FlorianPfaff merged commit f249fe4 into main Aug 7, 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