Skip to content

Avoid diagonal-only hypertoroidal particle initialization - #5220

Open
FlorianPfaff wants to merge 3 commits into
mainfrom
agent/fix-hypertoroidal-particle-diagonal-init
Open

Avoid diagonal-only hypertoroidal particle initialization#5220
FlorianPfaff wants to merge 3 commits into
mainfrom
agent/fix-hypertoroidal-particle-diagonal-init

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Bug

For dim > 1, HypertoroidalParticleFilter tiled the same one-dimensional angular grid into every coordinate. Every initial particle therefore satisfied

x_1 = x_2 = ... = x_dim

The nominally uninformative initial particle set was confined to a diagonal submanifold of the torus and encoded perfect artificial dependence between angular coordinates. For example, the empirical first-harmonic dependence |E[exp(i (x_1 - x_2))]| was exactly 1.0.

Fix

Initialize multidimensional filters with a deterministic, centered Latin-hypercube design:

  • one evenly spaced angular sample per marginal bin;
  • reproducible construction that does not consume the global random stream;
  • joint support no longer collapsed to the diagonal;
  • the existing one-dimensional equidistant initialization remains unchanged.

Regression coverage

Add a focused three-dimensional constructor test that verifies:

  • the particle matrix has the requested shape;
  • the first two coordinates are not identical particle by particle;
  • every angular marginal retains uniform wrapped spacing.

Validation

  • reproduced the old joint-dependence magnitude as 1.0;
  • the 32-particle replacement gives approximately 0.0953 for the same diagnostic;
  • the focused Latin-hypercube regression passed locally;
  • the modified implementation passes python -m py_compile;
  • branch comparison: 2 commits ahead, 0 behind main;
  • diff is limited to the hypertoroidal particle initializer and its existing test module.

GitHub Actions provides the authoritative full backend, lint, packaging, and integration validation.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 27.22s
✅ JSON prettier 7 0 0 0 1.02s
✅ JSON v8r 7 0 0 4.08s
✅ MARKDOWN markdownlint 68 0 0 0 1.83s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.86s
✅ PYTHON black 1865 87 0 0 91.19s
✅ PYTHON isort 1865 140 0 0 2.76s
✅ REPOSITORY betterleaks yes no no 2.56s
✅ REPOSITORY checkov yes no no 52.51s
✅ REPOSITORY gitleaks yes no no 17.73s
✅ REPOSITORY git_diff yes no no 0.33s
✅ REPOSITORY secretlint yes no no 83.69s
✅ REPOSITORY syft yes no no 5.62s
✅ REPOSITORY trivy-sbom yes no no 6.67s
✅ REPOSITORY trufflehog yes no no 30.5s
✅ YAML prettier 11 0 0 0 0.74s
✅ YAML v8r 11 0 0 13.09s
✅ YAML yamllint 11 0 0 0.54s

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

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