Skip to content

Prevent CircularUKF state aliasing - #5257

Open
FlorianPfaff wants to merge 5 commits into
mainfrom
agent/circular-ukf-state-copy
Open

Prevent CircularUKF state aliasing#5257
FlorianPfaff wants to merge 5 commits into
mainfrom
agent/circular-ukf-state-copy

Conversation

@FlorianPfaff

@FlorianPfaff FlorianPfaff commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Bug

CircularUKF overrides AbstractFilter.filter_state for circular-Gaussian validation, but its setter stored the validated distribution object directly. The base AbstractFilter setter deep-copies assigned state, so the override broke the filter-state ownership contract: mutating the caller's Gaussian after assignment could silently mutate the filter estimate without another filter update.

Fix

After circular-specific validation, delegate storage to the established AbstractFilter.filter_state setter so assignment retains the base class's deep-copy semantics.

Regression coverage

Add a focused NumPy-backend regression that assigns a GaussianDistribution, mutates the original mean and covariance afterward, and verifies the CircularUKF estimate remains unchanged.

Validation

  • branch is based on current main (f196ec41d1d8681e279936db9f1a0a3abfa276e7);
  • final diff is limited to one production-line replacement plus a 30-line focused regression test;
  • branch is 5 commits ahead and 0 behind because temporary branch-only setup commits cancel out of the final diff;
  • Security checks and Dependency review pass on head 4f3ef2f1fc33c24e04c6e9469d40c50309da956d;
  • CodeQL, MegaLinter, documentation examples, and release-notes checks are running, while the full test workflow is queued.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 26.65s
✅ JSON prettier 7 0 0 0 1.47s
✅ JSON v8r 7 0 0 4.05s
✅ MARKDOWN markdownlint 68 0 0 0 1.92s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.54s
✅ PYTHON black 1867 87 0 0 98.02s
✅ PYTHON isort 1867 141 0 0 2.91s
✅ REPOSITORY betterleaks yes no no 2.15s
✅ REPOSITORY checkov yes no no 55.27s
✅ REPOSITORY gitleaks yes no no 17.7s
✅ REPOSITORY git_diff yes no no 0.32s
✅ REPOSITORY secretlint yes no no 79.36s
✅ REPOSITORY syft yes no no 6.12s
✅ REPOSITORY trivy-sbom yes no no 5.52s
✅ REPOSITORY trufflehog yes no no 32.61s
✅ YAML prettier 11 0 0 0 0.75s
✅ YAML v8r 11 0 0 11.9s
✅ YAML yamllint 11 0 0 0.58s

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 17:53
@FlorianPfaff
FlorianPfaff enabled auto-merge (squash) August 7, 2026 17:53
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