Efficient Extraction for Effectful E-Graphs

📅 2026-09-25
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This study addresses the inefficiency of traditional ILP-based extraction algorithms in E-Graph optimization, where programs with side effects require strict execution order preservation. To overcome this limitation, this work proposes the Statewalk DP algorithm and formally proves the NP-completeness of safe extraction. By introducing the concept of "statewalk width," the method transforms a high-dimensional search space into a tractable dynamic programming problem, enabling efficient handling of side-effect ordering without external solvers. Experimental results demonstrate that the proposed approach achieves speedups of several orders of magnitude over ILP methods while generating code quality comparable to LLVM. Integrated with the eggcc prototype and Bril language support, this work effectively eliminates the extraction bottleneck for effectful programs within E-Graphs.
📝 Abstract
Egraphs 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 eqcc, a prototype egraph-based compiler for imperative Bril programs and demonstrate that effect-aware extraction is no longer a bottleneck.
Problem

Research questions and friction points this paper is trying to address.

E-graphs
effectful programs
extraction
integer linear programming
execution order
Innovation

Methods, ideas, or system contributions that make the work stand out.

E-graphs
Statewalk DP
Effectful programs
Extraction algorithm
Statewalk width
🔎 Similar Papers
No similar papers found.
💼 Related Jobs
No related jobs found.
O
Oliver Flatt
University of Washington, USA
A
Anjali Pal
University of Washington, USA
Yihong Zhang
Yihong Zhang
University of Washington
Programming LanguagesDatabase theory
Ryan Tjoa
Ryan Tjoa
Undergraduate, University of Washington
Computer Science
K
Kirsten Graham
University of Washington, USA
A
Alex Fischman
University of Washington, USA
C
Chandrakana Nandi
Certora Inc., USA and University of Washington, USA
E
Eli Rosenthal
Google, USA
Zachary Tatlock
Zachary Tatlock
University of Washington
CompilersVerificationProgram SynthesisComputational Fabrication
Haobin Ni
Haobin Ni
University of Washington, USA