Add eager merge container primitives#918
Conversation
This reverts commit 081498a.
…ve-body-runtime-apis # Conflicts: # CHANGELOG.md # src/lib.rs
Merging this PR will improve performance by 7.61%
Performance Changes
Tip Curious why this is faster? Comment Comparing Footnotes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #918 +/- ##
==========================================
- Coverage 87.17% 86.57% -0.61%
==========================================
Files 88 90 +2
Lines 26106 27019 +913
==========================================
+ Hits 22759 23392 +633
- Misses 3347 3627 +280 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Just a note, I think maybe and either seem like egglog-experimental type things right? |
|
|
||
| fn reserved_primitives() -> Vec<&'static str> { | ||
| vec!["unstable-fn", "unstable-app"] | ||
| vec!["unstable-fn", "unstable-app", "unstable-if"] |
There was a problem hiding this comment.
TODO should remove this extra change here
Yeah that sounds nice! The issue is that we have to inline certain type registration in the To move those to experimental, we could add some kind of thing in core to allow registering callbacks here... I think I could do that, in a way that is non specific to unstable function... Would definately be nice to move a bunch of this stuff to experimental I agree! Also to be able to add particular other function registration to other sorts like Map that are in experimental.
Yeah once all my in flight PRs (besides this one) land in egglog/experimental I will make a PR to see how that looks! |
|
Closing and replacing with an experimental PR |
Stack
Draft PR built on top of #881.
This branch includes the commits from that PR until #881 lands, so review should focus on the final commit,
Add eager merge container primitives.What changed
MaybeandEithercontainer sorts with unwrap/match primitives.unstable-if, a Unit-thunk-conditioned primitive that eagerly returns one of two already-built values.unstable-if, Maybe match, and Either match in both declaration orders needed by generated egglog programs..eggtests forMaybe,Either,UnstableFn, and late registration.Why
eggcc is moving merge functions away from constructor-producing encodings. These primitives let merge bodies compute eagerly over container values, so generated
:mergeexpressions can return an existing value rather than creating a constructor node only to rewrite it later.Validation
cargo build --releasecargo build --release --bin egglog-experimentalin the dependent egglog-experimental worktreefish -lc 'cargo build --release'in eggccfn,maybe,either, andpair.