Specula: Scaling formal specifications for autonomous model checking of system code

Murat · 2026年8月12日

AI 摘要 AI 生成,可能有误

该文章回顾了 Specula——一个智能体系统,它通过从代码中推导 TLA+ 规约、以轨迹验证来检验代码与规约的一致性、用模型检测查找并发缺陷、并通过集成测试复现这些缺陷,从而实现缺陷查找的自动化,以一键式方式在 48 个系统中发现了 249 个缺陷(其中 207 个为新缺陷),成果令人印象深刻。作者称赞其'铁磨铁'式的设计——轨迹验证将规约拉向代码,而模型检测则反向制约以防奖励作弊——但也批评其启发式方法缺乏原则性的论证,包括从同一份有缺陷的代码中推断意图的循环性、防止过拟合的协议级不变式占比过小,以及对底层前沿大语言模型的高度依赖。作者的结论是,尽管 Specula 是一项出色的实用性成就,但其临时拼凑的方法预示着一种正在兴起的启发式'智能体科学',而这种科学在哲学层面上仍难以令人满意。

Specula is an agentic system that automates the process of software bug finding through authoring and model-checking a spec for the code. It derives TLA+ specifications automatically from the code, checks code-spec conformance through trace validation, model checks the spec to find concurrency bugs, and reproduces the bug at the code layer by writing integration tests with precise timing.

I remember reading the Daikon paper "Quickly detecting relevant program invariants" in 2000 and getting impressed by it, and here we are after 26 years, solving the end-to-end problem much better than I ever thought would be possible in a push-button manner in the year of our lord 2026.

But somehow, I am still somewhat unsatisfied with the paper. This may be me being hypercritical and trying to get more out of the paper by arguing with it. So bear with me until I resolve (or learn to accept) these problems over time. I know many of the authors of the Specula work, and respect them, and I know they won't take my critiques about the larger problem in a wrong way... I am trying to make sense of the terrain myself. 

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 Murat Demirbas

Meaningful Human-in-the-Loop Checking of GenAI Synthesis for Restricted Languages

AI 摘要The article reviews an ECOOP 2026 paper introducing PICK, a human-in-the-loop tool that resolves ambiguity in LLM-generated specifications for restricted languages (regexes, LTL, access-control policies) by deriving multiple candidate formulas, sampling concrete scenarios where the candidates disagree, and asking users to accept or reject them until only the correct candidate survives. Experiments showed PICK substantially improved accuracy over reading formulas directly (e.g., 60–72% versus 22% on regex tasks) and made users more likely to correctly reject all wrong candidates. The author also applies the same idea in reverse to build 'Do you Paxos?', an interactive tutor that teaches correct Paxos by quizzing users on behaviors distinguishing it from common misconceptions.

TLAPS-Bench: Formally Proving Correctness Of Real-World System Specifications With TLA+ Proof System

AI 摘要TLAPS-Bench is a benchmark of 265 proof targets drawn from 95 real-world TLA+ specifications (including etcd Raft, ZooKeeper, and MongoDB transactions), designed to measure how well AI agents can carry the burden of deductive correctness proofs using the TLA+ Proof System. Unlike existing verification benchmarks that provide scaffolding such as helper lemmas or invariants, it hands agents only the spec and target theorem—covering safety, liveness, and refinement properties—and its Tilapia harness supplies proof checking, model checking tools, and anti-cheating guards, notably using a 'falsify before you prove' recipe where TLC and Apalache quickly refute bad candidate invariants. On the 70 hardest targets, the best current model proved 44.3%, leaving substantial room for AI labs to improve agents' formal proof and autoformalization capabilities.

Writing as a thinking tool

AI 摘要The author argues that writing is fundamentally a tool for thinking, likening a human without writing to a finite automaton and one with writing to a Turing machine, and illustrates this with personal experiences from mind maps in school to paper reviews and blogging. They warn that delegating writing to LLMs outsources the very act of thinking, making personal writing a widening comparative advantage. The article closes with five practical rules: produce unrestrained first drafts, edit ruthlessly, keep prose simple and plain, write for yourself without expectations, and put writing on a regular schedule.

TLA-Verus: LLM agents prove temporal properties of TLA+ specs

AI 摘要This article reviews the TLA-Verus paper, which uses LLM agents in a prover-reviewer loop to translate TLA+ specs from GitHub into Verus and prove safety and liveness properties there. The author criticizes the paper for lacking any refinement proof linking the Verus spec back to the original TLA+ (and producing no executable Rust code at all), understating TLAPS's existing temporal proof capabilities, and presenting a skewed corpus and a benchmark filtered to tasks its own pipeline had already proven. Nonetheless, the author finds Verus itself and the paper's automated task generator genuinely useful contributions.

The Man from the Future: Why Johnny Can't Stop Abstracting

AI 摘要The article reviews Ananyo Bhattacharya's biography of John von Neumann, chronicling his early years in Budapest and his foundational contributions to an extraordinary range of fields, including set theory, quantum mechanics, game theory, economics, and computing. The author argues that von Neumann's real superpower was the 'art of abstraction'—reducing messy domains to their minimal objects and axioms, as seen in his rigorous Hilbert space formulation of quantum mechanics, his axiomatization of expected utility, and the stored-program computer architecture he deliberately released into the public domain. The piece also explores his upbringing, including his father's seminar-style dinners and multilingual education, as keys to understanding the 'Johnny phenomenon'.