Move eggcc to latest egglog experimental#790
Open
oflatt wants to merge 1 commit into
Open
Conversation
edbf664 to
f0dc009
Compare
Rebase onto main and migrate to the latest egglog-experimental (egglog v2,
backed by the egg-smol fork).
- Bump egglog-experimental dep 38b3898 -> 08771f9 in both crates.
- Bump rust-toolchain 1.87 -> 1.88 (egglog v2 uses stable let-chains).
- egglog v2 API migration:
- EGraph::serialize() now returns SerializeOutput; take .egraph.
Drop the per-function `unextractables` set (the API no longer exposes
it; tiger reads extractability from the serialized egraph directly).
- desugar_program() -> resolve_program() + sanitize_internal_names().
- Replace top-level `(unstable-fresh! ...)` with throwaway constructors
in test_tuple_ith (the macro only desugars inside rule actions).
- test_context_of_panics_if_two: egglog now surfaces `(panic ...)` as an
Err instead of unwinding, so assert on the error.
- Run egglog single-threaded: pin the rayon global pool to 1 thread before
creating each egraph (egglog v2 gates all parallelism on
rayon::current_num_threads() > 1).
- Accept 34 snapshot updates (output verified equivalent: all interpreter
correctness checks still pass).
- Inline format args newly flagged by clippy 1.88.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9ce432d to
65245c7
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates eggcc and the dag_in_context subcrate to use the latest egglog-experimental API, adapting term representations and e-graph construction/extraction accordingly, and refreshes snapshot expectations to match the new output formatting.
Changes:
- Migrate dependencies to
egglog-experimentaland neweregraph-serialize/ordered-float, updating Rust toolchain to 1.88. - Refactor egglog term plumbing to use
TermId/TermDagAPIs and create experimental e-graphs (including single-threaded execution setup indag_in_context). - Update many test snapshots and tweak infra nightly packaging behavior.
Reviewed changes
Copilot reviewed 76 out of 78 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Switch top-level crate to egglog-experimental, bump egraph-serialize/ordered-float. |
| rust-toolchain | Bump Rust toolchain to 1.88.0. |
| infra/nightly.py | Adjust nightly output packaging to copy locally but move in non-local mode. |
| src/util.rs | Use experimental e-graph APIs; sanitize internal names for egglog visualization; update cutoff test logic. |
| src/main.rs | Minor formatting updates in error output/format strings. |
| src/lib.rs | Minor formatting updates to panic messages. |
| src/cfg/to_bril.rs | Minor formatting update for BlockName label formatting. |
| src/cfg/mod.rs | Minor formatting update for BlockName::Named display. |
| src/rvsdg/to_dag.rs | Formatting updates for panic/assert messages. |
| src/rvsdg/to_cfg.rs | Formatting update for panic message. |
| src/rvsdg/rvsdg2svg.rs | Formatting updates for SVG attribute string formatting. |
| src/rvsdg/from_dag.rs | Formatting updates for panic/assert messages. |
| tests/files.rs | Update panic formatting in duplicate filename check. |
| tests/snapshots/files__strong_loop-optimize.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__strong_loop-optimize-sequential.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__strong_loop-optimize-no-ctx.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__simple_select_after_block_diamond-optimize.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__simple_select_after_block_diamond-optimize-sequential.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__simple_select_after_block_diamond-optimize-no-ctx.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__select-optimize-no-ctx.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__pull_out_small-optimize.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__pull_out_small-optimize-sequential.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__pull_out_small-optimize-no-ctx.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__loop_with_mul_by_inv-optimize.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__loop_strength_reduction-optimize.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__loop_hoist-optimize.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__loop_hoist-optimize-sequential.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__if_push_in-optimize.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__if_push_in-optimize-sequential.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__if_push_in-optimize-no-ctx.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__if_invariant_dont_pull_out-optimize.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__if_invariant_dont_pull_out-optimize-sequential.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__if_invariant_do_pull_out-optimize.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__if_invariant_do_pull_out-optimize-sequential.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__if_in_loop-optimize.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__if_in_loop-optimize-sequential.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__if_dead_code_nested-optimize-sequential.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__gamma_condition_and-optimize-no-ctx.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__fib_recursive-optimize.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__fib_recursive-optimize-sequential.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__branch_hoisting-optimize.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__branch_hoisting-optimize-no-ctx.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__branch_duplicate_work-optimize.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__branch_duplicate_work-optimize-sequential.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__block-diamond-optimize-sequential.snap | Refresh snapshot output for new egglog/printing behavior. |
| tests/snapshots/files__block-diamond-optimize-no-ctx.snap | Refresh snapshot output for new egglog/printing behavior. |
| dag_in_context/Cargo.toml | Switch to egglog-experimental, bump egraph-serialize/ordered-float, add rayon. |
| dag_in_context/Cargo.lock | Lockfile updates for new egglog stack and dependency bumps. |
| dag_in_context/rust-toolchain | Bump Rust toolchain to 1.88.0. |
| dag_in_context/build.rs | Formatting update to panic message. |
| dag_in_context/src/lib.rs | Introduce single-threaded experimental e-graph creation; migrate term printing/caching to TermId; update serialization/extraction plumbing. |
| dag_in_context/src/to_egglog.rs | Migrate term construction and caching from Term to TermId. |
| dag_in_context/src/from_egglog.rs | Migrate conversion cache and traversal APIs to TermId-based access. |
| dag_in_context/src/schema_helpers.rs | Update TermDag::to_string usage to TermId signature. |
| dag_in_context/src/pretty_print.rs | Use experimental e-graph APIs and updated extraction interfaces. |
| dag_in_context/src/add_context.rs | Migrate caches to use TermId. |
| dag_in_context/src/util.rs | Suppress unused memory-limit variable warning on macOS path. |
| dag_in_context/src/typechecker.rs | Formatting updates to panic/assert messages. |
| dag_in_context/src/interpreter.rs | Formatting updates to panic/display output. |
| dag_in_context/src/remove_context.rs | Formatting update for S-expression printing. |
| dag_in_context/src/remove_dead_code_nodes.rs | Formatting updates to panic messages. |
| dag_in_context/src/fastercbcextractor.rs | Ensure cost adjustments use NotNan consistently. |
| dag_in_context/src/type_analysis.egg | Simplify type mismatch action to a direct panic (removes extracts). |
| dag_in_context/src/utility/util.rs | Replace temporary context mechanism with fresh/placeholder contexts in tests. |
| dag_in_context/src/utility/util.egg | Remove TmpCtx constructor and always-run panic rule. |
| dag_in_context/src/utility/subst.rs | Formatting update for check string. |
| dag_in_context/src/utility/subst.egg | Simplify substitution type mismatch action to a direct panic (removes extracts). |
| dag_in_context/src/utility/expr_size.rs | Formatting update for loop binding string. |
| dag_in_context/src/utility/context_of.rs | Update test to expect egglog error instead of Rust panic unwinding. |
| dag_in_context/src/optimizations/rec_to_loop.egg | Replace TmpCtx usage with unstable-fresh! context. |
| dag_in_context/src/optimizations/non_weakly_linear.egg | Replace TmpCtx usage with unstable-fresh! context. |
| dag_in_context/src/optimizations/loop_unroll.egg | Replace TmpCtx usage with unstable-fresh! context. |
| dag_in_context/src/optimizations/loop_strength_reduction.egg | Replace TmpCtx usage with unstable-fresh! context. |
| dag_in_context/src/optimizations/loop_invariant.egg | Replace TmpCtx usage with unstable-fresh! context. |
| dag_in_context/src/optimizations/ivt.egg | Replace TmpCtx usage with unstable-fresh! context. |
| dag_in_context/src/optimizations/loop_invariant.rs | Formatting updates for egglog test program strings. |
| dag_in_context/src/optimizations/memory.egg | Adjust set/union usage and helper rules for updated egglog behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+79
to
+82
| shutil.copytree(data_dir, output_data_dir, dirs_exist_ok=True) | ||
| else: | ||
| # otherwise move | ||
| shutil.move(str(data_dir), str(output_data_dir)) |
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.
No description provided.