A production Haskell library for adaptive optimization in Hoopl-style dataflow pipelines.
This repository delivers adaptive optimization techniques for production dataflow workflows:
- Adaptive fixpoint iteration: momentum-style damping to reduce oscillation in cyclic CFGs
- Scheduled fuel: phase budgets that start aggressive and taper as optimization stabilizes
- Learned rewrite policy: profile-guided rewrite selection with exploration/exploitation balance
- Bounded join: guardrails that cap unstable fact growth in problematic domains
- Container-polymorphic rewrite banks: higher-kinded
Foldableabstractions without changing runtime behavior
The goal is to preserve Hoopl's abstractions while improving convergence behavior, optimization efficiency, and operational predictability in production settings.
Most Haskell compiler optimization examples focus on fixed iteration schedules and static pass ordering. To our knowledge, this project is an uncommon end-to-end example of adaptive dataflow control in the Haskell ecosystem, while still using the same core ingredients compiler engineers already trust: lattices, monotone transfer functions, and composable rewrites.
- Stage: Production
- API stability: Stable for production integration
- Performance data: Evaluated using the repository's production benchmark protocol
cabal buildOr using the build script:
./build.shThe executable supports modular execution:
# Run all components
cabal run optimize
# Or directly after building
./optimize
# Run specific components
./optimize dataflow # Adaptive dataflow analysis only
./optimize graph # Shape-indexed graph evaluation only
./optimize examples # Concrete benchmark examples only
./optimize help # Display command optionsProduction-style benchmarking with reproducible artifacts:
# Standard benchmark (5 runs, 2 warmups)
./bench.sh
# High-confidence evaluation (15 runs, 3 warmups)
./bench.sh -n 15 -w 3
# Custom output and labels
./bench.sh -o bench-results/my-eval -l "custom-label"
# Full options and reporting protocol
./bench.sh --helpBenchmark results are structured JSON and CSV artifacts. See BENCHMARK.md for schema and reproducibility checklist.
QUICKREF.md- compact formulas, parameter ranges, and implementation notesVISUAL.md- diagrams for convergence, scheduling, and rewrite selection flowTECHNICAL.md- deeper rationale, constraints, and implementation guidanceBENCHMARK.md- reproducible benchmark workflow and reporting checklistSUMMARY.md- one-page project briefINDEX.md- repository navigation guide
This project builds on ideas introduced by the Hoopl framework:
- Paper: Hoopl: A Modular, Reusable Library for Dataflow Analysis and Transformation
- Repository: ezyang/hoopl
MIT. See LICENSE.