Skip to content

Reject non-finite sliding-window smoother weights - #4292

Closed
FlorianPfaff wants to merge 17 commits into
mainfrom
agent/reject-nonfinite-sliding-window-weights-20260713
Closed

Reject non-finite sliding-window smoother weights#4292
FlorianPfaff wants to merge 17 commits into
mainfrom
agent/reject-nonfinite-sliding-window-weights-20260713

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

  • validate SlidingWindowManifoldMeanSmoother.window_weights for finiteness before sign and mass checks
  • reject NaN, positive infinity, and negative infinity with a clear ValueError
  • add focused regression coverage for all three non-finite cases

Bug

SlidingWindowManifoldMeanSmoother checked only whether window_weights were negative and whether their sum was positive.

Those checks do not reject non-finite values:

  • comparisons with NaN are false, so a vector containing NaN passed both checks
  • a vector containing +inf had positive total mass and was accepted

When an active window was normalized, these values produced NaN weights (NaN / NaN or inf / inf) and consequently non-finite smoothed states.

Fix

Require every configured window weight to be finite using the active backend before applying the existing non-negativity and positive-mass validation.

Validation

  • standalone numerical reproduction confirms the previous checks accept both NaN and +inf and normalization produces non-finite weights
  • regression covers NaN, +inf, and -inf
  • branch is two commits ahead of current main and zero behind
  • final diff is limited to four source additions/one import-line adjustment and one focused test module

The full multi-backend test matrix is delegated to GitHub Actions.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 21.69s
✅ JSON prettier 7 0 0 0 1.01s
✅ JSON v8r 7 0 0 4.05s
✅ MARKDOWN markdownlint 68 0 0 0 1.89s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.69s
✅ PYTHON black 1490 182 0 0 85.01s
✅ PYTHON isort 1490 327 0 0 2.51s
✅ REPOSITORY betterleaks yes no no 2.6s
✅ REPOSITORY checkov yes no no 51.92s
✅ REPOSITORY gitleaks yes no no 13.75s
✅ REPOSITORY git_diff yes no no 0.33s
✅ REPOSITORY secretlint yes no no 56.82s
✅ REPOSITORY syft yes no no 5.99s
✅ REPOSITORY trivy-sbom yes no no 6.08s
✅ REPOSITORY trufflehog yes no no 30.64s
✅ YAML prettier 11 0 0 0 0.63s
✅ YAML v8r 11 0 0 9.66s
✅ YAML yamllint 11 0 0 0.42s

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 force-pushed the agent/reject-nonfinite-sliding-window-weights-20260713 branch from e7cf6bc to f5ef1e8 Compare July 13, 2026 16:31

Copy link
Copy Markdown
Owner Author

Closing as an obsolete conflicted stack. This branch carries a large inherited commit chain on an old base, so the focused change cannot be reviewed or repaired safely in place. Recreate the small fix from current main if it is still missing.

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