Skip to content

Fix overflow in tracklet edge distances - #4974

Closed
FlorianPfaff wants to merge 2 commits into
mainfrom
agent/fix-tracklet-edge-distance-overflow-20260801
Closed

Fix overflow in tracklet edge distances#4974
FlorianPfaff wants to merge 2 commits into
mainfrom
agent/fix-tracklet-edge-distance-overflow-20260801

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Bug

constant_velocity_edge_cost() computed endpoint displacement with numpy.linalg.norm. For large but finite coordinates such as [1e308, 1e308], the internal sum of squares overflows even though the Euclidean norm (about 1.4142e308) is still representable.

The resulting infinite edge cost is filtered out by build_tracklet_adjacency(), so a mathematically valid and feasible tracklet transition can disappear from the association graph solely because of an avoidable intermediate overflow.

Fix

  • compute the Euclidean displacement with NumPy's scale-safe repeated hypot reduction
  • preserve ordinary-scale edge costs and speed gating
  • add a regression under strict overflow/invalid floating-point handling at the largest useful finite scale

Validation

  • reproduced the current failure locally: numpy.linalg.norm([1e308, 1e308]) overflows to infinity
  • verified the replacement returns the finite value from numpy.hypot(1e308, 1e308) and preserves a [3, 4] displacement cost of 5
  • the branch-local focused validation syntax-compiles the modified source and regression before committing the final two-file patch

The repository's normal pull-request checks provide the full integration matrix.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 25.3s
✅ JSON prettier 7 0 0 0 1.08s
✅ JSON v8r 7 0 0 4.93s
✅ MARKDOWN markdownlint 68 0 0 0 1.74s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.69s
✅ PYTHON black 1809 57 0 0 92.52s
✅ PYTHON isort 1809 89 0 0 2.76s
✅ REPOSITORY betterleaks yes no no 1.69s
✅ REPOSITORY checkov yes no no 54.48s
✅ REPOSITORY gitleaks yes no no 16.2s
✅ REPOSITORY git_diff yes no no 0.36s
✅ REPOSITORY secretlint yes no no 78.28s
✅ REPOSITORY syft yes no no 5.49s
✅ REPOSITORY trivy-sbom yes no no 6.84s
✅ REPOSITORY trufflehog yes no no 31.46s
✅ YAML prettier 11 0 0 0 0.74s
✅ YAML v8r 11 0 0 12.63s
✅ YAML yamllint 11 0 0 0.61s

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

Copy link
Copy Markdown
Owner Author

Closing as low value. This hardens tracklet rotation only for coordinates near the floating-point limit (around 1e308), which is not a practical supported state-estimation regime. The added scale-specific machinery would increase complexity without meaningful application benefit.

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