Skip to content

Fix high-dimensional ellipsoidal-ball volume overflow - #5426

Merged
FlorianPfaff merged 2 commits into
mainfrom
fix/ellipsoidal-volume-overflow
Aug 25, 2026
Merged

Fix high-dimensional ellipsoidal-ball volume overflow#5426
FlorianPfaff merged 2 commits into
mainfrom
fix/ellipsoidal-volume-overflow

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

  • compute the unit-ball volume prefactor in log space for dimensions above 4
  • avoid premature gamma overflow (starting around 342 dimensions in float64)
  • add an 80-digit mpmath regression check for both manifold volume and the uniform PDF

Bug

get_manifold_size() previously formed

pi**(d/2) / gamma(d/2 + 1)

before taking its logarithm. At d = 342, gamma(172) overflows to infinity although the true unit-ball volume is still representable (~8.30e-225). This made the reported volume zero and the uniform density at interior points infinite.

The fix evaluates the dimension-only prefactor directly in log space with lgamma, then combines it with the existing log-Cholesky determinant calculation.

@FlorianPfaff
FlorianPfaff enabled auto-merge (squash) August 25, 2026 06:07
@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.4s
✅ JSON prettier 7 0 0 0 0.61s
✅ JSON v8r 7 0 0 5.6s
✅ MARKDOWN markdownlint 68 0 0 0 2.38s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.57s
✅ PYTHON black 2020 4 0 0 70.67s
✅ PYTHON isort 2020 5 0 0 3.04s
✅ REPOSITORY betterleaks yes no no 1.39s
✅ REPOSITORY checkov yes no no 39.82s
✅ REPOSITORY git_diff yes no no 0.15s
✅ REPOSITORY secretlint yes no no 113.48s
✅ REPOSITORY syft yes no no 2.82s
✅ REPOSITORY trivy-sbom yes no no 3.08s
✅ YAML prettier 11 0 0 0 0.73s
✅ YAML v8r 11 0 0 16.69s
✅ YAML yamllint 11 0 0 1.0s

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 6e240d2 into main Aug 25, 2026
25 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