-
Notifications
You must be signed in to change notification settings - Fork 14
Switch to new backend #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Changes PyObjectSort to use new interface * Removes Rational since experimental not updated yet
CodSpeed Instrumentation Performance ReportMerging #291 will not alter performanceComparing Summary
|
CodSpeed WallTime Performance ReportMerging #291 will degrade performances by 50.11%Comparing Summary
Benchmarks breakdown
|
Blocked on egraphs-good/egglog#627 EDIT: resolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR switches the Egglog Python extension to the new backend architecture by migrating the Python object sort, adapting EGraph bindings for the new add_primitive!
interface, wrapping e-graph execution in thread-safe GIL calls, and updating the Python DSL to use unbound/let-ref declarations.
- Implements new
PyObjectSort
withBaseSort
andadd_primitive!
- Replaces
ArcPyObjectSort
withPyObjectSort
and registers it viaadd_leaf_sort
- Migrates Python declaration types from
VarDecl
toUnboundVarDecl
/LetRefDecl
, removessimplify
/QueryExtract
APIs
Reviewed Changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
src/py_object_sort.rs | Redefines PyObjectSort , implements BaseSort , primitives, and term reconstruction |
src/egraph.rs | Uses add_leaf_sort , wraps run_program and serialize in allow_threads |
src/lib.rs | Binds new PyObjectSort into the Python module |
src/conversions.rs | Fixes conversion for AddRuleset and Extract commands with spans |
rust-toolchain.toml | Bumps toolchain channel to 1.87.0 |
Cargo.toml | Upgrades to 2024 edition and switches to egglog-backend dependencies |
python/tests/ | Updates tests for the new Extract API, removes simplify usage |
python/egglog/runtime.py | Uses LetRefDecl for parameter defaults instead of VarDecl |
python/egglog/pretty.py | Replaces VarDecl with UnboundVarDecl /LetRefDecl in pretty printer |
python/egglog/egraph_state.py | Adds span() to AddRuleset /UnstableCombinedRuleset , uses unbound var types |
python/egglog/egraph.py | Removes global simplify , adapts let binding to LetRefDecl |
python/egglog/declarations.py | Introduces UnboundVarDecl and LetRefDecl types |
python/egglog/bindings.pyi | Updates stubs for new commands (Extract , UserDefined , spans) |
docs/reference/egglog-translation.md | Removes simplify example, updates code samples |
docs/reference/contributing.md | Adds debugging guide, moves "Making changes" under debugging section |
docs/changelog.md | Notes upgrade, breaking changes, removed simplify |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Adds support for new backend in Egglog. A follow up PR can expose the new custom costs mechanism and extraction.
TODO: