
Spec engineering with mathematical precision
Seattle, United States
Joined November 2026
- Tweets29
- Following1
- Followers112
- Likes93
Kubernetes APF can remove a queue while a finished request still holds seats, and the server can panic when that request's timer fires.
We specified "empty" in Lean, proved a model of the fixed code, and generated a fix that matches the PR byte for byte:
functorial.inc/blog/2026/ver…
Replying to @abhi9u @vpatryshev
4
Agreed, you cannot delegate the writing of the spec to an LLM
Reasons I'm extremely skeptical about formal verification taking off:
1. Simpler, cheaper alternatives like enforcing invariants via the type system itself
2. Writing the specification / contract that gets verified is much harder than it sounds for complex, important things - and not something you can delegate to an LLM.
3. Are you going to verify that the formal verification actually verifies what you think it's verifying? Same problem as reading reams of LLM-authored unit tests.
2
137
Replying to @jdlichtman @introsp3ctor
Working on a new version of Zero to Riemann Zeros functorial.inc/riemann that follows this skeleton and proves the GRH instead of he RH
1
11
5/ The proofs are about a model of the Go code, and the post lists what we proved, checked and trust. Code and proofs: github.com/Functorial-Inc/k8…
6
4/ Finally we generated the Go fix from the specification. It is byte-for-byte identical to the fix in Sai krishna Bodapati's PR, and the naive meaning of "empty" regenerates the buggy code.
1
13
3/ We wrote the strict meaning in Lean and proved that a model of the fixed code keeps the promise in every reachable state. Then we replayed 608 recordings of the real Go code through the model, and the checker rejected exactly the 80 runs where the bug happened.
1
17
2/ The Go interface promises APF won't discard a queue "unless and until it is undesired and empty". The code checks that nothing is waiting or executing, and never checks for a request that has finished but still holds seats. The bug comes down to what "empty" means.
1
21
1/ Kubernetes APF has an open bug: the API server can remove a queue while a finished request still holds seats in it, and it can panic when that request's timer fires.
The post shows how we specified the fix in Lean and generated it from the spec. 🧵
functorial.inc/blog/2026/ver…
Functorial retweeted
Spec engineering will be the next big thing in 2027
Replying to @infinterenders
You can now learn all 76k lines of Lean through spaced repetition and interactive practice here: functorial.inc/riemann
17
Zero to Riemann Zeros 0.4.0 is out!
The course now reads the new compact edition of the Lean proof of the Riemann Hypothesis: 794 files and about 76,000 lines, down from 175,187 files.
functorial.inc/riemann
At Functorial, we are betting that the future of software will be specification engineering, where the attention of human engineers will be spent almost entirely on one thing: getting the spec right.
Get the spec right, and sleep at night.
Lean 4 for Programmers
academy.functorial.inc/cours…
Lean 4 for Mathematicians
academy.functorial.inc/cours…
2
85
Intro to Proofs (in Lean)
academy.functorial.inc/cours…
Replying to @satnam6502
We also explain it as part of our course on Lean and the proof of the Riemann hypothesis: academy.functorial.inc/cours…
1
21


