一句话:提出 TraceLink,将执行 trace 映射到经过验证的形式设计,自动检测编译实现与设计之间的偏差。
形式验证的分布式系统设计与其实现之间存在正确性鸿沟:即使从已验证设计自动编译实现,编译器缺陷、部署环境假设错误或配置错误也会使运行时行为偏离设计。本文提出完全自动化的 trace 验证方法 TraceLink,将捕获执行行为的 trace 映射到对应形式设计。作者为从 Modular PlusCal 到 TLA+ 与 Go 的编译器 PGo 实现 TraceLink,给出把执行 trace 解释为 TLA+ 的形式语义,并用模板化策略缩减 tracing 规约;还提出 sidestep 路径验证策略,以更低开销更快发现缺陷。在多个分布式系统(含 MPCal 版 Raft 键值存储)上评估,发现 PGo TCB 中 9 个此前未检测到的多样缺陷,包括 PGo 编译器自身缺陷,并验证了模板化与 sidestep 的有效性。
An important correctness gap exists between formally verifiable distributed system designs and their implementations. Recently proposed work bridges this gap by automatically extracting, or compiling, an implementation from the formally-verified design. The runtime behavior of this compiled implementation, however, may deviate from its design. For example, the compiler may contain bugs, the design may make incorrect assumptions about the deployment environment, or the implementation might be misconfigured. In this paper we develop TraceLink, a methodology to detect such deviations through trace validation. TraceLink maps traces, that capture an execution’s behavior, to the corresponding formal design. Unlike previous work on trace validation, our approach is completely automated. We implement TraceLink for PGo, a compiler from Modular PlusCal to both TLA + and Go. We present a formal semantics for interpreting execution traces as TLA + , along with a templatization strategy to minimize the size of the TLA + tracing specification. We also present a novel trace path validation strategy, called sidestep , which detects bugs faster and with little additional overhead. We evaluated TraceLink on several distributed systems, including an MPCal implementation of a Raft key-value store. Our evaluation demonstrates that TraceLink is able to find 9 previously undetected and diverse bugs in PGo’s TCB, including a bug in the PGo compiler itself. We also show the effectiveness of the templatization approach and the sidestep path validation strategy.
@article{paperbot2968,
title = {TraceLinking Implementations with Their Verified Designs},
author = {Finn Hackett and Ivan Beschastnikh},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {OOPSLA2},
year = {2025},
doi = {10.1145/3763128}
}