Port tuple-output functions from egglog#938#3
Closed
oflatt-claude wants to merge 4 commits into
Closed
Conversation
This was referenced Jul 7, 2026
Term-encoding congruence via native :merge (proof mode, ~15% faster)
oflatt-claude/egglog-encoding#2
Closed
Ports egraphs-good/egglog#938 ("Add tuple-output functions") into the vendored egglog/ subtree. A function may declare more than one output sort, stored as separate value columns (no boxing); outputs are destructured in queries, written in actions, and merged per column with a (values ...) clause. Restricted to plain functions and unsupported by the term/proof encoding. The upstream diff applied cleanly except for one context conflict in src/proofs/proof_encoding_helpers.rs (this fork carries an extra NaiveEqSortPrimitiveFact reason); the TupleOutputFunction variant and guard were reapplied by hand. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The workspace root now builds egglog-experimental alongside egglog, so it must handle the tuple-output additions from the #938 port: add `extra_outputs: vec![]` to the fresh! constructor Schema, and a `ResolvedCall::Values(_) => Context::Pure` arm (tuple construct/destructure reads/writes no tables). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
942d7fc to
ed920b5
Compare
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fix a doubled word and grammar in the `function` command doc, drop the redundant sentence on `Schema::extra_outputs` (already covered by `Schema::outputs`), and trim the memory-representation aside from the CHANGELOG entry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`input_file` built rows and validated types using only `schema.output`, so loading a tuple-output custom function from a TSV rejected valid rows (too many fields) and would have inserted too few columns. Use `schema.outputs()` for both the type check and the row schema. Adds a regression test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
|
closing , out of date |
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.
Ports egraphs-good/egglog#938 ("Add tuple-output functions") into the vendored
egglog/subtree of this repo.What it adds
Tuple-output functions — a function may declare more than one output sort:
Outputs are stored as separate value columns (no boxing); the functional dependency maps keys to a tuple of values. They are:
(= (values lo hi) (interval x))(set (interval x) (values 0 100))(values e0 e1 …)clause whereeimerges columni, referencing the bound variablesold0,new0,old1,new1, …This collapses analyses that previously needed one function per output into a single function.
Tuple outputs are restricted to plain functions (not constructors/relations/view tables) and are not supported by the term/proof encoding (reported cleanly via
ProofEncodingUnsupportedReason::TupleOutputFunction).Porting notes
gh pr diff 938) applies onto the vendoredegglog/subtree with a single conflict insrc/proofs/proof_encoding_helpers.rs: this fork carries an extraNaiveEqSortPrimitiveFactreason/check that shifted the surrounding context, so the newTupleOutputFunctionenum variant and the tuple-output guard incommand_supports_proof_encodingwere reapplied by hand. All other 19 files applied cleanly.cargo build --release --tests,cargo test --release --test tuple_outputs(11/11), and the fullcargo test --releasesuite.Draft — first step of porting egglog changes into this fork.
🤖 Generated with Claude Code