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 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 66f00c81-68fe-4cc3-8271-08b99389a7efCited 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
