Compiling Distributed System Models with PGo
A. Finn Hackett, Shayan Hosseini, Renato Costa, Matthew Do, Ivan Beschastnikh
Abstract
Distributed systems are difficult to design and implement correctly. In response, both research and industry are exploring applications of formal methods to distributed systems. A key challenge in this domain is the missing link between the formal design of a system and its implementation. Today, practitioners bridge this link through manual effort.
We present a language called Modular PlusCal (MPCal) that extends PlusCal by cleanly separating the model of a system from a model of its environment. We then present a compiler tool-chain called PGo that automatically translates MPCal models to TLA + for model checking, and that also compiles MPCal models to runnable Go code. PGo provides system designers with a new ability to model and check their designs, and then re-use their modeling efforts to mechanically extract runnable implementations of their designs.
Our evaluation shows that the PGo approach works for complex models: we model check, compile, and evaluate the performance of MPCal systems based on Raft, CRDTs, and primary-backup. Compared to previous work, PGo requires less time to develop a checked model and derive a fully working implementation. With PGo we created a formally checked Raft model and its corresponding implementation in under 1 person-month, which is 3× less time than Ivy. Our evaluation shows that a PGo-based Raft KV store with three nodes has 41% higher throughput than a Raft KV store based on Ivy, the highest performing verified Raft-based KV store from related work. A PGo-based CRDT set has a latency within 2× of a CRDT set implementation from SoundCloud called Roshi.
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.
7 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- DuoAI: Fast, Automated Inference of Inductive Invariants for Verifying Distributed Protocols cites Finding Invariants of Distributed Systems: It's a Small (Enough) World After All
- DuoAI: Fast, Automated Inference of Inductive Invariants for Verifying Distributed Protocols cites DistAI: Data-Driven Automated Invariant Learning for Distributed Protocols
- DistAI: Data-Driven Automated Invariant Learning for Distributed Protocols cites Finding Invariants of Distributed Systems: It's a Small (Enough) World After All
- Multi-Grained Specifications for Distributed System Model Checking and Verification cites Finding Invariants of Distributed Systems: It's a Small (Enough) World After All
- Multi-Grained Specifications for Distributed System Model Checking and Verification cites DuoAI: Fast, Automated Inference of Inductive Invariants for Verifying Distributed Protocols
- Multi-Grained Specifications for Distributed System Model Checking and Verification cites DistAI: Data-Driven Automated Invariant Learning for Distributed Protocols
- Multi-Grained Specifications for Distributed System Model Checking and Verification cites Model Checking Guided Testing for Distributed Systems
- Multi-Grained Specifications for Distributed System Model Checking and Verification cites Using Lightweight Formal Methods to Validate a Key-Value Storage Node in Amazon S3
- SandTable: Scalable Distributed System Model Checking with Specification-Level State Exploration cites Model Checking Guided Testing for Distributed Systems
- SandTable: Scalable Distributed System Model Checking with Specification-Level State Exploration cites Using Lightweight Formal Methods to Validate a Key-Value Storage Node in Amazon S3
- Model Checking Guided Testing for Distributed Systems cites Understanding and Detecting Software Upgrade Failures in Distributed Systems
- Smart Casual Verification of the Confidential Consortium Framework cites SandTable: Scalable Distributed System Model Checking with Specification-Level State Exploration
- Smart Casual Verification of the Confidential Consortium Framework cites Model Checking Guided Testing for Distributed Systems
- Smart Casual Verification of the Confidential Consortium Framework cites Using Lightweight Formal Methods to Validate a Key-Value Storage Node in Amazon S3
Cited by top-tier papers7
- Model Checking Guided Testing for Distributed SystemsDong Wang, Wensheng Dou, Yu Gao, Chenao Wu et al.EuroSys 2023 · 21 citations
- Smart Casual Verification of the Confidential Consortium FrameworkHeidi Howard, Markus A. Kuppe, Edward Ashton, Amaury Chamayou et al.NSDI 2025 · 13 citations
- SandTable: Scalable Distributed System Model Checking with Specification-Level State ExplorationRuize Tang, Xudong Sun, Yu Huang, Yuyang Wei et al.EuroSys 2024 · 8 citations
- Multi-Grained Specifications for Distributed System Model Checking and VerificationLingzhi Ouyang, Xudong Sun, Ruize Tang, Yu Huang et al.EuroSys 2025 · 4 citations
- ProfiX: Improving Profile-Guided Optimization in Compilers with Graph Neural NetworksHuiri Tan, Juyong Jiang, Jiasi ShenNeurIPS 2025 · 4 citations
Builds on11
- DistAI: Data-Driven Automated Invariant Learning for Distributed ProtocolsJianan Yao, Runzhou Tao, Ronghui Gu, Jason Nieh et al.OSDI 2021 · 76 citations
- Finding Invariants of Distributed Systems: It's a Small (Enough) World After AllTravis Hance, Marijn Heule, Ruben Martins, Bryan ParnoNSDI 2021 · 69 citations
- Using Lightweight Formal Methods to Validate a Key-Value Storage Node in Amazon S3James Bornholt, Rajeev Joshi, Vytautas Astrauskas, Brendan Cully et al.SOSP 2021 · 63 citations
- DuoAI: Fast, Automated Inference of Inductive Invariants for Verifying Distributed ProtocolsJianan Yao, Runzhou Tao, Ronghui Gu, Jason NiehOSDI 2022 · 50 citations
- Understanding and Detecting Software Upgrade Failures in Distributed SystemsYongle Zhang, Junwen Yang, Zhuqi Jin, Utsav Sethi et al.SOSP 2021 · 40 citations
Related papers
- TraceLinking Implementations with Their Verified DesignsFinn Hackett, Ivan BeschastnikhOOPSLA 2025 · 1 citation
- AutoMan: Facilitating Verified Distributed Systems Development Through Automatic Code Generation and Manual OptimizationsZihao Zhang, Ti Zhou, Christa Jenkins, Omar Chowdhury et al.SOSP 2025 · 2 citations
- Grove: a Separation-Logic Library for Verifying Distributed SystemsUpamanyu Sharma, Ralf Jung, Joseph Tassarotti, M. Frans Kaashoek et al.SOSP 2023 · 18 citations
- Performal: Formal Verification of Latency Properties for Distributed SystemsTony Nuda Zhang, Upamanyu Sharma, Manos KapritsosPLDI 2023 · 4 citations
- Verifying a high-performance distributed transaction system using permissioned state machinesYun-Sheng Chang, Joseph Tassarotti, Frans Kaashoek, Nickolai ZeldovichSOSP 2026
