Guard antimeridian boundary vertex appends#205
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78277aeed5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const int maxVerts = sizeof(boundary->verts) / sizeof(boundary->verts[0]); | ||
|
|
||
| SPLIT_ASSERT( | ||
| boundary->numVerts < maxVerts, |
There was a problem hiding this comment.
Use a larger split buffer for seam vertices
When a valid H3 boundary already uses more than six of CellBoundary's fixed vertex slots, the polar splitter appends the original vertices plus four synthetic antimeridian/pole vertices; this new guard turns those cases into Cell boundary split exceeds CellBoundary vertex capacity errors for h3_cell_to_boundary_wkb/geometry instead of producing the boundary. The bounds check needs to be paired with a split representation sized for the extra seam vertices, otherwise high-resolution polar or distorted antimeridian cells remain unusable.
Useful? React with 👍 / 👎.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds a new ChangesBoundary Vertex Capacity Enforcement
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Motivation
CellBoundary.vertscapacity.Description
boundary_add_vert(CellBoundary *, const LatLng *)that asserts theCellBoundaryhas room before appending a vertex inh3_postgis/src/wkb_indexing.c.part->verts[part->numVerts++]andres->verts[res->numVerts++]writes inboundary_split_180andboundary_split_180_polarwith calls toboundary_add_vertto enforce the bound.SPLIT_ASSERT) when a split would exceed the vertex array instead of allowing silent overflow.Testing
cc -fsyntax-onlywith temporary PostgreSQL/H3/WKB stubs, which succeeded.git diff --checkto validate no whitespace/git-diff issues, which passed.cmake -S . -B build -DBUILD_TESTING=OFF, which failed due to an externalFetchContentdownload of H3 v4.5.0 returning HTTP 403 from the environment proxy, so full integration build/tests could not complete in this environment.Codex Task