Skip to content

Reject non-finite and invalid GGIW inputs - #5425

Merged
FlorianPfaff merged 2 commits into
mainfrom
fix/ggiw-input-validation
Aug 24, 2026
Merged

Reject non-finite and invalid GGIW inputs#5425
FlorianPfaff merged 2 commits into
mainfrom
fix/ggiw-input-validation

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Bugs

GGIWTracker accepted several mathematically invalid inputs:

  • NaN/infinite gamma_shape, gamma_rate, extent_degrees_of_freedom, and extent_innovation_weight could pass sign-only validation and poison the Gamma/IW state.
  • constructor/update extent_innovation_weight=np.nan was accepted because nan < 0 is false.
  • covariance and extent matrices were silently symmetrized instead of enforcing PyRecEst's documented finite/symmetric/PSD covariance contract.
  • extent_is_scale accepted arbitrary truthy values such as the string "False".

Fix

  • require finite scalar hyperparameters before their range checks
  • validate extent_is_scale as an actual boolean
  • use the shared assert_covariance_matrix contract for covariance and extent inputs while retaining strict positive-definite Cholesky checks where required
  • validate update-time extent innovation weights
  • add regressions for non-finite scalars, non-boolean flags, asymmetric/non-finite matrices, and valid finite behavior

The changes are limited to GGIWTracker and a dedicated regression file.

@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.52s
✅ JSON prettier 7 0 0 0 0.74s
✅ JSON v8r 7 0 0 4.2s
✅ MARKDOWN markdownlint 68 0 0 0 2.37s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.41s
✅ PYTHON black 2018 2 0 0 64.0s
✅ PYTHON isort 2018 2 0 0 2.92s
✅ REPOSITORY betterleaks yes no no 1.56s
✅ REPOSITORY checkov yes no no 33.05s
✅ REPOSITORY git_diff yes no no 0.23s
✅ REPOSITORY secretlint yes no no 103.24s
✅ REPOSITORY syft yes no no 3.04s
✅ REPOSITORY trivy-sbom yes no no 2.6s
✅ YAML prettier 11 0 0 0 0.76s
✅ YAML v8r 11 0 0 17.09s
✅ YAML yamllint 11 0 0 0.87s

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 2430dcb into main Aug 24, 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