8000 Clamp polygon bbox latitudes to the valid sphere range by Hashim1999164 · Pull Request #1226 · uber/h3 · GitHub
[go: up one dir, main page]

Skip to content

Clamp polygon bbox latitudes to the valid sphere range - #1226

Merged
isaacbrodsky merged 1 commit into
uber:masterfrom
Hashim1999164:fix/clamp-polygon-bbox-latitude
Sep 29, 2026
Merged

isaacbrodsky merged 1 commit into
uber:masterfrom
Hashim1999164:fix/clamp-polygon-bbox-latitude

Conversation

@Hashim1999164
@Hashim1999164 Hashim1999164 commented Aug 22, 2026 •
Copy link
Copy Markdown
Contributor

Summary

Finite but wildly out of range latitudes were accepted when building a polygon bounding box. That made bbox size estimates huge and caused polygonToCellsExperimental to spend minutes on a tiny fuzzer input (issue 1225).

After constructing the loop bbox, north and south are now clamped to plus or minus pi/2, matching the clamp already used in scaleBBox. In range polygons are unchanged. A unit test covers the extreme latitude case from the fuzzer artifact.

Fixes #1225

Test plan

  1. Build and run the polygon internal test suite, including bboxFromGeoLoopClampsOutOfRangeLatitude.
  2. Confirm existing bboxFromGeoLoop cases still pass.
  3. Optionally replay the libFuzzer timeout artifact and confirm maxPolygonToCellsSizeExperimental returns quickly.

Out of range finite latitudes produced huge bounding boxes and made polygonToCellsExperimental spend minutes on a tiny fuzzer input. Clamp north and south to +/- pi/2 after bbox construction, matching scaleBBox.
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 99.7%. remained the same — Hashim1999164:fix/clamp-polygon-bbox-latitude into uber:master

@Hashim1999164
Copy link
Copy Markdown
Contributor Author

@isaacbrodsky any update

@isaacbrodsky
isaacbrodsky merged commit 4859333 into uber:master Sep 29, 2026
47 checks passed A980
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.

fuzzerPolygonToCellsExperimentalNoHoles times out on master: out-of-range vertex latitude produces a huge bbox estimate

4 participants

0