Skip to content

Repository files navigation

Adaptive Compiler Optimization

A production Haskell library for adaptive optimization in Hoopl-style dataflow pipelines.

What this project is

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

The goal is to preserve Hoopl's abstractions while improving convergence behavior, optimization efficiency, and operational predictability in production settings.

Why this stands out in Haskell

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.

Project status

  • Stage: Production
  • API stability: Stable for production integration
  • Performance data: Evaluated using the repository's production benchmark protocol

Build and run

cabal build
cabal run optimize

Alternative script-based run:

./build.sh
./optimize

Benchmark and reproducibility

The repository now includes a production-style benchmarking workflow with structured artifacts.

Preferred path:

./bench.sh -n 15 -w 3

For options, artifact schema, and reporting protocol, see BENCHMARK.md.

Documentation map

  • QUICKREF.md - compact formulas, parameter ranges, and implementation notes
  • VISUAL.md - diagrams for convergence, scheduling, and rewrite selection flow
  • TECHNICAL.md - deeper rationale, constraints, and implementation guidance
  • BENCHMARK.md - reproducible benchmark workflow and reporting checklist
  • SUMMARY.md - one-page project brief
  • INDEX.md - repository navigation guide

Acknowledgments

This project builds on ideas introduced by the Hoopl framework:

License

MIT. See LICENSE.

About

Adaptive compiler optimization

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages