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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext a91ecfd0-cd4d-4a90-96cc-435e90ea0496Cited by top-tier papers2
- KRAKEN: Program-Adaptive Parallel FuzzingAnshunkang Zhou, Heqing Huang, Charles ZhangISSTA 2025
- Integrating Resource Analyses via Resource DecompositionLong Pham, Yue Niu, Nathaniel Glover, Feras Saad et al.OOPSLA 2025
Builds on11
- Sampling with Riemannian Hamiltonian Monte Carlo in a Constrained SpaceYunbum Kook, Yin Tat Lee, Ruoqi Shen, Santosh S. VempalaNeurIPS 2022 · 53 citations
- A modular cost analysis for probabilistic programsMartin Avanzini, Georg Moser, Michael SchaperOOPSLA 2020 · 41 citations
- Liquidate your assets: reasoning about resource usage in liquid HaskellMartin A. T. Handley, Niki Vazou, Graham HuttonPOPL 2020 · 38 citations
- A cost-aware logical frameworkYue Niu, Jonathan Sterling, Harrison Grodin, Robert HarperPOPL 2022 · 23 citations
- Recurrence extraction for functional programs through call-by-push-valueG. A. Kavvos, Edward Morehouse, Daniel R. Licata, Norman DannerPOPL 2020 · 20 citations
Related papers
- Automatic Amortized Resource Analysis with Regular Recursive TypesJessie Grosen, David M. Kahn, Jan HoffmannLICS 2023 · 5 citations
- Handling Exceptions and Effects with Automatic Resource AnalysisEthan Chu, Yiyang Guo, Jan HoffmannOOPSLA 2026
- Verifying and Synthesizing Constant-Resource Implementations with TypesVan Chan Ngo, Mario Dehesa-Azuara, Matthew Fredrikson, Jan HoffmannS&P 2017 · 51 citations
- Automatic Linear Resource Bound Analysis for Rust via Prophecy PotentialsQihao Lian, Di WangOOPSLA 2025 · 1 citation
- Quantitative Bounds on Resource Usage of Probabilistic ProgramsKrishnendu Chatterjee, Amir Kafshdar Goharshady, Tobias Meggendorfer, Dorde ZikelicOOPSLA 2024 · 16 citations
