Skip to content

Reject wrong-sized MEM-RBPF control inputs#4437

Open
FlorianPfaff wants to merge 5 commits into
mainfrom
fix/mem-rbpf-control-input-shape
Open

Reject wrong-sized MEM-RBPF control inputs#4437
FlorianPfaff wants to merge 5 commits into
mainfrom
fix/mem-rbpf-control-input-shape

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

  • validate MEMRBPFTracker.predict_linear() control inputs against the kinematic-state shape
  • reject broadcastable but wrong-sized arrays before mutating tracker configuration or state
  • reuse the validated control vector during prediction
  • add a focused NumPy regression covering the no-mutation guarantee

Root cause

predict_linear() previously converted inputs only at the point of addition. NumPy therefore accepted shapes such as (1,) and broadcast the single value across every component of a four-dimensional kinematic state, silently applying an unintended control.

Fix

Convert and validate inputs at the start of prediction. A non-None control must have exactly the same shape as kinematic_state; otherwise the method raises ValueError before changing the system matrix, process noise, kinematic state, covariance, or conditional extent state.

Validation

  • reconstructed the source from the current GitHub blob and verified the unmodified reconstruction matched blob fec88b01d0c9be7486b13bc3f3710301d4c5b9bd byte-for-byte
  • python -m py_compile passes for the modified module and regression test
  • the exact regression passes in a minimal NumPy-backed harness
  • branch comparison: 8 source additions, 1 source deletion, and one 56-line regression file

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 23.35s
✅ JSON prettier 7 0 0 0 1.21s
✅ JSON v8r 7 0 0 5.86s
✅ MARKDOWN markdownlint 68 0 0 0 2.29s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 1.12s
✅ PYTHON black 1543 197 0 0 103.16s
✅ PYTHON isort 1543 367 0 0 2.81s
✅ REPOSITORY betterleaks yes no no 1.96s
✅ REPOSITORY checkov yes no no 59.4s
✅ REPOSITORY gitleaks yes no no 15.54s
✅ REPOSITORY git_diff yes no no 0.4s
✅ REPOSITORY secretlint yes no no 75.55s
✅ REPOSITORY syft yes no no 4.66s
✅ REPOSITORY trivy-sbom yes no no 5.93s
✅ REPOSITORY trufflehog yes no no 33.55s
✅ YAML prettier 11 0 0 0 0.71s
✅ YAML v8r 11 0 0 12.7s
✅ YAML yamllint 11 0 0 0.6s

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 July 15, 2026 14:34
@FlorianPfaff FlorianPfaff enabled auto-merge (squash) July 15, 2026 14:35
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