Ponder a rust future#109
Draft
timj wants to merge 2 commits into
Draft
Conversation
Design a phased migration of sphgeom's implementation to a canonical Rust core, with three end-state consumers: native Rust, Python via PyO3, and downstream C++ via the existing headers plus a thin delegation veneer. During the migration the public build is left untouched; the Rust path is exercised as a development aid (a parallel PyO3 `_sphgeom2` extension selected by an environment variable) so the existing Python suite can validate it with no effect on what anyone installs. The end-state packaging (maturin pure-Rust PyPI wheel, plus CMake-built libsphgeom under conda-forge for downstream C++) and the C++ veneer are deferred to a dedicated cutover phase. Records the C ABI bridge contract, the bit-identical parity contract, the build model, the roadmap, and a plan-ready Phase 0 (orientation predicates) slice. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Plan the first migration slice as a development aid that leaves the public build untouched: port the orientation predicates to a Rust core crate (Rust edition 2024, num-bigint for the exact fallback), expose them through an optional PyO3 `_sphgeom2` extension, and route the ported names through it via the SPHGEOM_RUST environment variable in __init__.py. Validate with a golden-vector differential harness (Rust vs current C++, bit-identical) and a Python parity test. Enforce cargo fmt and cargo clippy (-D warnings) via pre-commit hooks and CI. No C ABI, C++ glue, libsphgeom linking, or public build-file changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #109 +/- ##
=======================================
Coverage 72.44% 72.44%
=======================================
Files 115 115
Lines 7215 7215
Branches 2289 2289
=======================================
Hits 5227 5227
Misses 404 404
Partials 1584 1584 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
doc/changes