Skip to content

Stabilize discrete-state prior normalization - #5432

Merged
FlorianPfaff merged 3 commits into
mainfrom
fix/discrete-state-prior-overflow
Aug 25, 2026
Merged

Stabilize discrete-state prior normalization#5432
FlorianPfaff merged 3 commits into
mainfrom
fix/discrete-state-prior-overflow

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

  • normalize discrete-state probability vectors after max-scaling instead of summing raw weights
  • prevent overflow for valid large finite HMM/IMM priors while preserving their ratios
  • add regressions covering both discrete_forward_backward and imm_forward_backward

Bug

A valid prior such as [float_max, float_max / 2] previously overflowed when summed. The resulting inf denominator collapsed the normalized vector to zeros, causing filtering to fail with a spurious no-mass error.

Fix

Scale finite non-negative weights by their maximum before summing and normalizing. This also improves robustness for extremely small finite weights.

@FlorianPfaff
FlorianPfaff enabled auto-merge (squash) August 25, 2026 12:19
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 7.93s
✅ JSON prettier 7 0 0 0 0.96s
✅ JSON v8r 7 0 0 4.92s
✅ MARKDOWN markdownlint 68 0 0 0 2.04s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.41s
✅ PYTHON black 2023 6 0 0 66.23s
✅ PYTHON isort 2023 8 0 0 3.0s
✅ REPOSITORY betterleaks yes no no 1.23s
✅ REPOSITORY checkov yes no no 35.08s
✅ REPOSITORY git_diff yes no no 0.14s
✅ REPOSITORY secretlint yes no no 106.04s
✅ REPOSITORY syft yes no no 3.38s
✅ REPOSITORY trivy-sbom yes no no 2.82s
✅ YAML prettier 11 0 0 0 0.72s
✅ YAML v8r 11 0 0 17.9s
✅ YAML yamllint 11 0 0 1.06s

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 ef33ff2 into main Aug 25, 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