Efficient Extraction for Effectful E-graphs
Oliver Flatt, Anjali Pal, Yihong Zhang, Ryan Tjoa, Kirsten Graham, Alex Fischman, Chandrakana Nandi, Eli Rosenthal,
Key points
From the paper's conclusion- We implement the algorithm in EGGCC, a prototype e-graph-based compiler for imperative Bril programs, and demonstrate that effect-aware extraction is no longer a bottleneck.
Abstract
E-Graphs have enabled recent advances in program optimization, synthesis, and verification, yet remain difficult to apply to effectful programs whose memory and I/O operations must respect execution order. Existing effect-aware extraction algorithms rely on integer linear programming (ILP) and dominate total runtime. We introduce Statewalk DP, a new extraction algorithm that enforces effect ordering efficiently without external solvers. We prove that finding any effect-safe extraction is NP-complete, but show that Statewalk DP is tractable in statewalk width, a parameter that measures the complexity of dataflow interactions among effects. In practice, statewalk width generally remains small, enabling Statewalk DP to achieve order-of-magnitude speedups over ILP extraction while producing programs comparable to LLVM across our benchmarks. We implement the algorithm in EGGCC, a prototype e-graph-based compiler for imperative Bril programs, and demonstrate that effect-aware extraction is no longer a bottleneck.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- egg: Fast and Extensible Equality SaturationCommunications of the ACM · 2026
- How to prove equations using diagrams: A categorical and operational semantics for e-graphsarXiv · 2026
- A New Approach to Optimal Function Inlining for Code Size Minimization via E-graphsProceedings of the ACM on Programming Languages · 2026
- RefinementGuard: Counterexample-Directed Semantic Qualification for Hidden Agent-Tool ExecutionarXiv · 2026
- APG: Agentic Static-Analysis Infrastructure on LLVM-IR Graph DatabasesarXiv · 2026
- Formalizing the Linux eBPF Core ISA: A Mechanized Operational Semantics and Its Real-World ApplicationsProceedings of the ACM on Programming Languages · 2026