Automatic Linear Resource Bound Analysis for Rust via Prophecy Potentials
Qihao Lian, Di Wang

TL;DR
This paper introduces RaRust, a novel static analysis tool that uses type-based linear resource bounds and prophecy potentials to accurately analyze resource consumption in Rust programs, including complex borrow scenarios.
Contribution
RaRust is the first resource-bound analysis for Rust that leverages its unique borrow mechanisms using prophecy potentials within a type-based framework.
Findings
RaRust infers symbolic linear resource bounds for complex Rust programs.
RaRust effectively handles shared and mutable borrows, reborrows, and heap-allocated data.
Experimental results show RaRust's capability to analyze real-world Rust code.
Abstract
Rust has become a popular system programming language that strikes a balance between memory safety and performance. Rust's type system ensures the safety of low-level memory controls; however, a well-typed Rust program is not guaranteed to enjoy high performance. This article studies static analysis for resource consumption of Rust programs, aiming at understanding the performance of Rust programs. Although there have been tons of studies on static resource analysis, exploiting Rust's memory safety -- especially the borrow mechanisms and their properties -- to aid resource-bound analysis, remains unexplored. This article presents RaRust, a type-based linear resource-bound analysis for well-typed Rust programs. RaRust follows the methodology of automatic amortized resource analysis (AARA) to build a resource-aware type system. To support Rust's borrow mechanisms, including shared and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Formal Methods in Verification · Software System Performance and Reliability
