Lune

PLDI2024Top-tier venue

Robust Resource Bounds with Static Analysis and Bayesian Inference

Long Pham, Feras A. Saad, Jan Hoffmann

Abstract

There are two approaches to automatically deriving symbolic worst-case resource bounds for programs: static analysis of the source code and data-driven analysis of cost measurements obtained by running the program. Static resource analysis is usually sound but incomplete. Data-driven analysis can always return a result, but its lack of robustness often leads to unsound results. This paper presents the design, implementation, and empirical evaluation of hybrid resource bound analyses that tightly integrate static analysis and data-driven analysis. The static analysis part builds on automatic amortized resource analysis (AARA), a state-of-the-art type-based resource analysis method that performs cost bound inference using linear optimization. The data-driven part is rooted in novel Bayesian modeling and inference techniques that improve upon previous data-driven analysis methods by reporting an entire probability distribution over likely resource cost bounds.

A key innovation is a new type inference system called Hybrid AARA that coherently integrates Bayesian inference into conventional AARA, combining the strengths of both approaches. Hybrid AARA is proven to be statistically sound under standard assumptions on the runtime cost data. An experimental evaluation on a challenging set of benchmarks shows that Hybrid AARA (i) effectively mitigates the incompleteness of purely static resource analysis; and (ii) is more accurate and robust than purely data-driven resource analysis.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • A cost-aware logical framework cites Liquidate your assets: reasoning about resource usage in liquid Haskell
  • A cost-aware logical framework cites Recurrence extraction for functional programs through call-by-push-value
  • Integrating Resource Analyses via Resource Decomposition cites A cost-aware logical framework
  • Integrating Resource Analyses via Resource Decomposition cites Liquidate your assets: reasoning about resource usage in liquid Haskell
  • Integrating Resource Analyses via Resource Decomposition cites Recurrence extraction for functional programs through call-by-push-value
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. KRAKEN: Program-Adaptive Parallel FuzzingAnshunkang Zhou, Heqing Huang, Charles ZhangISSTA 2025
  2. Integrating Resource Analyses via Resource DecompositionLong Pham, Yue Niu, Nathaniel Glover, Feras Saad et al.OOPSLA 2025

Builds on11

  1. Sampling with Riemannian Hamiltonian Monte Carlo in a Constrained SpaceYunbum Kook, Yin Tat Lee, Ruoqi Shen, Santosh S. VempalaNeurIPS 2022 · 53 citations
  2. A modular cost analysis for probabilistic programsMartin Avanzini, Georg Moser, Michael SchaperOOPSLA 2020 · 41 citations
  3. Liquidate your assets: reasoning about resource usage in liquid HaskellMartin A. T. Handley, Niki Vazou, Graham HuttonPOPL 2020 · 38 citations
  4. A cost-aware logical frameworkYue Niu, Jonathan Sterling, Harrison Grodin, Robert HarperPOPL 2022 · 23 citations
  5. Recurrence extraction for functional programs through call-by-push-valueG. A. Kavvos, Edward Morehouse, Daniel R. Licata, Norman DannerPOPL 2020 · 20 citations

Related papers

  1. Automatic Amortized Resource Analysis with Regular Recursive TypesJessie Grosen, David M. Kahn, Jan HoffmannLICS 2023 · 5 citations
  2. Handling Exceptions and Effects with Automatic Resource AnalysisEthan Chu, Yiyang Guo, Jan HoffmannOOPSLA 2026
  3. Verifying and Synthesizing Constant-Resource Implementations with TypesVan Chan Ngo, Mario Dehesa-Azuara, Matthew Fredrikson, Jan HoffmannS&P 2017 · 51 citations
  4. Automatic Linear Resource Bound Analysis for Rust via Prophecy PotentialsQihao Lian, Di WangOOPSLA 2025 · 1 citation
  5. Quantitative Bounds on Resource Usage of Probabilistic ProgramsKrishnendu Chatterjee, Amir Kafshdar Goharshady, Tobias Meggendorfer, Dorde ZikelicOOPSLA 2024 · 16 citations
Dusk over the sea between two cliffs drawn in fine vertical lines