From Sequential to Dataflow: Formally-verified Compilation for Concurrent and Distributed Architectures
Abstract
On serverless cloud platforms, an application consists of many functions that communicate through the network, which makes it hard to debug, monitor and verify. A growing line of work therefore lets developers write a sequential, imperative program and compiles it into a distributed application. The correctness of these compilers, however, rests on informal arguments, and a mechanized guarantee is hard to obtain: the compiled program runs concurrently but must keep the order of the updates to each state, it must not deadlock, and it may be run by many different executors. We implement a compiler from a sequential, imperative language with state, loops and tail recursion to a dataflow language, and verify it in Rocq. The compiler translates a program directly into a graph of nodes connected by channels: each state becomes a chain of channels that orders its updates, and each tail recursion becomes a loop in the graph that feeds the result of one round back as the argument of the next. To verify the compiler, we give both languages a semantics with interaction trees, derive weakest precondition calculi from these semantics, and show that every weakest precondition proved for the sequential program holds for its compiled graph. Our result is stated against a contract of graph execution, which fixes the order of calls and iterations, leaves every other firing free, and requires that the graph never gets stuck. It therefore holds for every executor that meets the contract. We show that a scheduler meets it under every schedule, and so does an executor without a scheduler, in which nodes fire in parallel as soon as their inputs hold data.
Create a lesson
Metadata
- Categories
- cs.PL, cs.DC
- Comments
- 39 pages (25 pages main text, references, 10 pages of appendices), 7 figures, 1 table. Rocq mechanization available from the authors on request
Related papers
Teal: Verifiable Kernel Compilation through Instruction-Centric Lifting
Shared title terminologycs.PLShriram Chandran, Alexandru Calotoiu, Marcin Copik et al.
CompCert4Lean: Porting a Verified C Compiler to Lean in Six Weeks with Parallel Coding Agents
Shared title terminologycs.PLCong Wang, Zhiyang Chen, Fan Long et al.
Urdu-C: A Localized Educational C-Like Compiler with Multi-Backend Code Generation and Program Visualization
Shared title terminologycs.PLSyed Sarib Sultan, Adnan Rashid
SALTyRN: An End-to-End Tool for Verified and Optimized Neon-to-RVV Kernel Translation
Shared title terminologycs.PLKeagan Chern, Charles Hong, Yakun Sophia Shao et al.
Automating Induction-Reduction for Concurrent Object Proofs
Shared title terminologycs.PLMihai Nicola, Constantin Enea, Eric Koskinen
ConstraintFlow: Specifying, Verifying, and Executing DNN Certifiers
Shared title terminologycs.PLAvaljot Singh, Yasmin Chandini Sarita, Qiuhan Gu et al.