Skip to content

perf: optimize polygon intersection predicates - #34

Merged
pentatonick merged 15 commits into
mainfrom
perf/optimize-polygon-intersection-predicates
Jul 15, 2026
Merged

perf: optimize polygon intersection predicates#34
pentatonick merged 15 commits into
mainfrom
perf/optimize-polygon-intersection-predicates

Conversation

@pentatonick

Copy link
Copy Markdown
Owner

Summary

  • Optimize polygon intersection predicates

Test plan

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo build --workspace --all-targets
  • cargo test --workspace

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 98.46154% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/geometry-strategy/src/intersects.rs 92.59% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Snap cardinal azimuth components to exact zero to match Boost's degree-aware semantics. Tighten public parity coverage and remove unreachable test-only and invariant branches that distorted coverage.
Behavior-preserving cleanups across the overlay, rtree, and geographic
paths, plus a small amount of new parity coverage:

- replace assert_eq! on floating-point results with epsilon comparisons
  (float_cmp) in the concave-hull, earcut, and parity tests
- use let-else in merge, merge the rtree Intersects/CoveredBy match arms,
  and drop needless dereferences in the WKT parser
- simplify the KarneyInverse seed search: seed `best` eagerly with the
  first candidate instead of threading an Option through the loop
- add a disjoint-component stitch_triangles parity test and document the
  panic condition on is_valid_with / is_valid_polygon_with
Replace the hand-maintained feature table in the root README with one
generated by .github/scripts/feature_table.py, so it can no longer drift
from the code. The table's rows come from `// feature-group:` comment tags
on each crate's `pub use` lines; the script derives function names, no_std
status (reused from the no-std table), and docs.rs links, and fails if any
public free-function export is left unclassified.

- add feature_table.py (regex-parses Cargo.toml so it runs on the hook's
  Python, matching crate_readme.py); group display order lives in a
  GROUP_ORDER map, group name/description stay in lib.rs next to the code
- tag every table-bearing pub use across the algorithm, overlay, rtree,
  proj, and io crates; render 12 groups / 69 rows between markers
- wire the generator into CI (git diff --exit-code) and the pre-commit hook
- add a "How it stays type-agnostic" README section (blurb + collapsed
  deep-dive) explaining the concept-trait / tag-dispatch technique
- document the generator and tagging workflow in CONTRIBUTING
@pentatonick
pentatonick merged commit e422395 into main Jul 15, 2026
3 checks passed
@pentatonick
pentatonick deleted the perf/optimize-polygon-intersection-predicates branch July 15, 2026 06:24
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.

2 participants