Skip to content

Draft: add in-repo Rust backend connector package#1251

Draft
gustavorubim wants to merge 3 commits into
astroautomata:masterfrom
gustavorubim:rust-backend-inrepo-connector
Draft

Draft: add in-repo Rust backend connector package#1251
gustavorubim wants to merge 3 commits into
astroautomata:masterfrom
gustavorubim:rust-backend-inrepo-connector

Conversation

@gustavorubim

Copy link
Copy Markdown

Summary

This is a draft comparison PR for the architecture Miles asked to evaluate: the Python/Rust connector package lives in the PySR repository instead of in astroautomata/symbolic_regression.rs.

It is intentionally based on the existing Rust backend adapter PR (#1242), then adds an in-repo pysr_rust_backend/ subproject that builds the pysr-rust-backend distribution and exposes the symbolic_regression_rs import module consumed by PySR's adapter.

What this demonstrates

  • Keeps the main PySR adapter plumbing from Add experimental Rust backend adapter #1242.
  • Vendors the Python/Rust connector interface into this repository as pysr_rust_backend/.
  • Leaves the Rust engine crates in astroautomata/symbolic_regression.rs; the connector uses Git dependencies for symbolic_regression and dynamic_expressions.
  • Adds connector CI that installs the subpackage, runs wrapper tests, builds wheel/sdist artifacts, and smoke-tests those artifacts.

Why draft

This is for design evaluation, not an immediate merge candidate. It lets maintainers compare two structures:

Validation

  • cargo check --manifest-path pysr_rust_backend/Cargo.toml
  • cargo fmt --check --manifest-path pysr_rust_backend/Cargo.toml
  • python -m pytest pysr_rust_backend/tests -q: 12 passed
  • python -m pysr test rust: 14 passed with the in-repo connector installed
  • Parsed .github/workflows/CI_rust_backend_connector.yml with PyYAML

Related PRs

@gustavorubim

Copy link
Copy Markdown
Author

Hi @MilesCranmer, following up on the in-repo connector comparison you requested. This PR demonstrates the connector living in PySR, while astroautomata/symbolic_regression.rs#47 contains the wrapper-first design used by #1242. The initial contract feedback has been addressed and both paths were validated. Which placement would you prefer us to consolidate around? Once decided, I can update the selected branch and mark the appropriate PR ready for review.

@MilesCranmer

Copy link
Copy Markdown
Member

Hi @gustavorubim,
This will require significant effort from me to review, if I do decide to pursue this exact design, so I probably won't be able to get to this for a long time. My apologies.
Best,
Miles

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