Skip to content

Initialize hyperhemispherical particle filter on valid manifold points - #5342

Closed
FlorianPfaff wants to merge 2 commits into
mainfrom
agent/fix-hyperhemispherical-pf-initialization
Closed

Initialize hyperhemispherical particle filter on valid manifold points#5342
FlorianPfaff wants to merge 2 commits into
mainfrom
agent/fix-hyperhemispherical-pf-initialization

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

  • initialize HyperhemisphericalParticleFilter with deterministic unit vectors at the upper-hemisphere north pole instead of uninitialized memory
  • add regression coverage that requires every initial particle to have unit norm and lie on the upper hemisphere

Bug

HyperhemisphericalParticleFilter.__init__() constructed its initial HyperhemisphericalDiracDistribution from empty((n_particles, dim + 1)). On NumPy/PyTorch this can expose arbitrary allocator contents; on backends that zero-fill empty, it produces zero vectors. Neither is a valid deterministic point set on the unit hyperhemisphere, so a freshly constructed filter can start with off-manifold or non-finite particle locations before a caller assigns a prior.

The neighboring HypersphericalParticleFilter already avoids this by initializing with valid sphere points.

Fix

Initialize all particles at the north pole [0, ..., 0, 1]. This is deterministic, has unit norm, and is in the upper hemisphere for every supported dimension.

Validation

  • focused regression checks particle norms, upper-hemisphere membership, and the north-pole coordinate
  • branch is based directly on current main and changes only the filter constructor plus its existing test module
  • modified source passes Python syntax compilation locally
  • full backend/test validation is delegated to GitHub Actions because this environment cannot clone the repository over the network

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 5.79s
✅ JSON prettier 7 0 0 0 0.57s
✅ JSON v8r 7 0 0 3.89s
✅ MARKDOWN markdownlint 68 0 0 0 1.74s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.35s
✅ PYTHON black 1983 10 0 0 45.75s
✅ PYTHON isort 1983 20 0 0 2.16s
✅ REPOSITORY betterleaks yes no no 1.16s
✅ REPOSITORY checkov yes no no 27.45s
✅ REPOSITORY git_diff yes no no 0.18s
✅ REPOSITORY secretlint yes no no 77.36s
✅ REPOSITORY syft yes no no 2.43s
✅ REPOSITORY trivy-sbom yes no no 1.58s
✅ YAML prettier 11 0 0 0 0.75s
✅ YAML v8r 11 0 0 13.48s
✅ YAML yamllint 11 0 0 0.75s

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 commented Aug 18, 2026

Copy link
Copy Markdown
Owner Author

Correction: the earlier triage note was based on stale/mismatched PR metadata. This PR is the valid-manifold initialization fix for HyperhemisphericalParticleFilter, not the hemisphere particle-count change. Reopening it and evaluating it on its own merits/CI.

Copy link
Copy Markdown
Owner Author

Closing as superseded by #5345, which fixes the same HyperhemisphericalParticleFilter initialization bug and additionally covers HyperhemisphereCartProdParticleFilter with regression tests. Keeping the broader fix avoids duplicate changes.

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