Formal methods is going through a bit of a manic episode now that AI is making everybody else take us seriously. I predict that in 12 months, we'll either be a little more chill OR have accidentally kickstarted the paperclip apocalypse

Hillel
@hillelogramDeveloper educator at @AntithesisHQ. Formal methods, software history, chocolatiering. Newsletter: http://is.gd/zWfYjd Book: https://logicforprogrammers.com
- Followers
- 20.1KFollowing 2
- Typical Views
- 2.2K30d · 22 posts1/7d
- Bookmark %
- 0.7%Like 1.2%Eng. 1.9%
- Authority
- 68/ 100
- 30d Breakout Hits
- 4Peak 7.0×
3-Day Follower Growth
Hover to inspect daily follower changes
14-Week Posting Cadence
- 14w Posts
- 22
- Active Days
- 13/31
- Active Weeks
- 5/5
- Avg / Week
- 5.0
- Peak Day
- 3
- Peak Day/Wk
- Fri
Ten years ago, there was this weird trend in software engineering where people based their identities around what kind of verification software they used.
Some people would be like, "I use TDD, I never want to see a type in my life", and others would say "if it typechecks it's correct I don't even need to bother running it."
Nowadays, I think we're a bit more aware that techniques don't just complement each other, but actively synergize. For example, if you have both types and tests, you can use the types to generate inputs for your tests!
One of the cooler ways synergies I've seen in trace validation. Normally, testing finds bugs in codebases, while "formal specification" finds bugs in designs. Neither by itself can verify if the code actually *matches* the design, though. With trace validation, we generate logs of the executed system, translate them into abstract behaviors, and check if they match the abstract specification. It's a cool fusion of experiment and proof!
And if those logs are generated with fuzzing and deterministic simulation testing, you've got something really special going.
My coworker @moarbugs just published a demonstration of this, using formal specification and @antithesishq to verify Raft implementations against their designs. He did the bulk of the work but I wrote a sections on the caveats, long-term consequences, and an explainer of what trace validation actually is. Come check our work out!
- Trace validation turns execution logs into abstract behaviors and checks them against an abstract specification.
- The author describes combining this method with fuzzing and deterministic simulation testing.
- The cited demonstration examines etcd-raft and HashiCorp Raft, and the follow-up notes the specification was proved in TLAPS and Veil.
By combining Antithesis with formal methods, we can mathematically prove safety for conformant models of production distributed systems! We demonstrated this process in depth for etcd-raft and HashiCorp Raft.
For a substantial subset of their features, we can show how, after patching a few bugs, their implementations achieve the properties stated in the Raft paper, such as Election Safety and State-Machine Safety.
Yesterday Microsoft did something really bad and it destroyed every business in the world. I didn't bother to learn anything else about it because I was too busy writing my 10k whitepaper about how all the problems were all caused by one simple mistake: not drinking my patented Miracle Tonic™®.
Developers who drink my Miracle Tonic write code 100% faster with 100% fewer bugs. This would have prevented the Outlook outage, the 2024 CrowdStrike plane grounding, Ariane 5, Therac-25, and Jensen Huang's infidelity. Developers are also happier at work, suffer no burnout, and keep all standups to exactly five minutes.
The Miracle Tonic is so effective that it should be immoral not to drink it. It's like if surgeons didn't wash their hands. If you write code for a living and you don't drink my Miracle Tonic, do us all a favor and never touch a computer again. You idiot. You absolute moron. I can't believe you call yourself a "professional".
Frequently Asked Questions
> Do you have any actual evidence that Miracle Tonic actually helps programmers?
Yes I do! All sorts of studies prove the effectiveness of Miracle Tonic:
1. One survey found that 68% of devs drinking miracle tonic say their code is "awesome". That means it works! 2. A double-blind clinical trial found that 7 undergraduates who were given Miracle Tonic wrote 10% better code (using the Hills-Bourne-Davidio Corrected Dolorimetry metric) than the control group (6 undergraduates who were punched in the face). 3. Someone found twelve projects on GitHub that didn't use Miracle Tonic and they had 268% worse failure rates than this one project I did with it. That's a P value of 0.00004!
That's so many studies! I can say with 100% confidence that Miracle Tonic is proven to work beyond a shadow of a doubt.
> I read a study saying that Miracle Tonic gives people headaches.
Why are you trusting studies? Are you really gonna listen to some graduate student dweeb who's never been a real programmer?! If you're curious about Miracle Tonic, just try it and see for yourself.
> Are there any downsides to drinking Miracle Tonic?
Of course, there is no silver bullet, everything is tradeoffs, etc etc etc. The downside of Miracle Tonic is it doesn't work if your company is a toxic feature factory that cares more about micromanaging mindless worker drones than cultivating good engineers. And don't drink it if you're allergic to peanuts.
> This tastes revolting.
I've trained five Miracle Tonic Brand Ambassadors and they all tell me it's delicious. Your taste buds must be wrong.
> I tried drinking your Miracle Tonic and it didn't make me a better programmer.
How DARE you. How dare you spread FUD about the most important programming technology ever made. Were you drinking exactly 12.063 mL at 67° C every 75 minutes? Yeah, thought not. Of course it's not going to work if you didn't follow it properly. And you'd know this if you took my $1500 three-day "how do drink Miracle Tonic" course. Which you didn't. Get out of my sight.
> How does Miracle Tonic compare to competing products, like toad oil, Pirelli's Miracle Elixir, or AGI?
Fucking charlatans, all of them.
We (@AntithesisHQ) have just done something incredibly cool: used our fuzzer to beat Nethack with every race and class.
And then we wrote a 20,000 word blog post about the crazy things we learned along the way.
My 14yo self is finally avenged.
New newsletter: my least favorite example in all of software engineering!
My first blog post for @AntithesisHQ is out!
Ostensibly it's about why a formal methods person would want to join the company. Actually it's a romp through formal methods, the problems of abstraction, and how we can break nondeterminism over our knee.
You're not a real programmer unless you can
1. Implement a linked list 2. Reverse it 3. Bop it 4. Bop it 5. Twist it 6. Pull it 7. Bop it
There is an inescapable tradeoff between what a software technology can do (its abilities) and what you know for certain about what it does (its guarantees).
For example:
- Unicode is able to represent strings like `中文🌴`, but ASCII guarantees that all visible characters are exactly one byte. - Safe rust guarantees an absence of (certain kinds of) memory errors, but it isn't able to encode as many valid programs as unsafe rust can. - `map` can't do every computation a `foreach` loop can, but `map` always guarantees the output list is the same size as the input list. - Graphs can represent more kinds of data than DAGs, which represent more than trees, which represent more than lists. But DAGs are orderable, trees have at most one path between nodes, and lists guarantee one order.
The tradeoff exists whether we're talking formats, data structures, languages, or tools. It's so fundamental because it's universal. Give me any software topic and I will give you an example of this tradeoff.
What's causing this? There's a surprisingly simple mathematical explanation! Abilities correspond to `some` quantifiers over a set, while guarantees correspond to `all` quantifiers. `some` is "monotonically true" over the size of the set, meaning when we grow the set, it can flip from false to true but not from true to false. Conversely, `all` is monotonically false, meaning it can flip from true to false but not vice versa.
In other words: to increase a technology's guarantees we need to "shrink the corresponding set", which by definition decreases its abilities.
The ability-guarantee tradeoff is one of the running motifs of my book Logic for Programmers: not the subject of a chapter, but an idea that runs through many chapters. The tradeoff connects diverse topics like testing, optimization problems, and domain-driven design. If this interests you, the book is available in pdf, epub, and print formats. Check the link below!
(Or, if you want to participate in the November charity drive, check out the link in the next Tweet!)
There is no silver arrow.
I predict that no single development, either in technology or in writing technique, will cause a tenfold improvement in the speed we can write books.
Yes, there are have been many marginal improvements in our lifetime. Switching from tablets to papyrus mean we no longer have to lug around heavy lumps of clay. New "fountain pens" mean we don't have to dip our quills in inkwells every six words. The switch from logographic to phonetic alphabets 100xed the number of people who could write at all.
But these are all accidental complexity in the process of writing. The essential complexity is unchanged: coming up with the right words and the motions that make our letters legible. No technology can fix this for us.
Some people think that the printing press will give us the 10x improvement we want. This is wrong. Printing presses will make it easier to distribute books, but they don't speed up the act of producing the first book! In fact it's even slower, since you have to composite all the metal type!
"You can include pages that other people wrote," pressvangelists say. But have you considered the work involved in writing all the glue prose to connect these disparate chunks into a coherent story? We've traded one source of accidental complexity for another!
Others point to shorthand as a way of writing faster. And yes, if you're willing to put the years into learning shorthand, you can write words 5-10x faster. But this approach simply isn't scalable to the entire storytelling industry. It makes the 10x writers faster but does nothing for the overwhelming majority of 1x writers.
Don't expect any innovations to change the essential complexity. I don't know what people will invent in the future, but I can guarantee it won't provide an order-of-magnitude improvement to how fast we can write our stories.
One of the craziest bugs I remember involved two separate product features for two separate teams that both shared a database table, and both teams had slightly different interpretations of what the data meant.
That, combined with a couple of infrastracture automations, lead to a bug that took me two days to work out and a third to convince everybody what the root cause was, because nobody believed it could be something so weird.
I wish I still had the source code, because I'm pretty sure Opus would find the same bug in 15 minutes.
I think about that sometimes.
There are two factors that determine how much people will use a correctness tool:
1. How easy it is to use. 2. How much it actually helps with finding bugs.
These two form the tool's "strength-weight ratio". If a tool takes 1 hour of labor to find 10 bugs, it has the same ratio as a tool that takes 10 hours of labor to find 100 bugs. We can say roughly that they have the same strength/weight ratio of 10:1. People overwhelmingly prefer tools with better ratios, so we'd expect that these tools would be equally balanced.
In theory.
In my years of working with and teaching powerful tools, I've learned that ease of use matters far more to the ratio than "how much it helps". To torture my analogy a bit more, we're comparing the hours of labor to the square root of bugs found. So the 1-hour tool has a strength/weight ratio of about 3:1, while the 10-hour tool has a ratio of 1:1. The first tool will be way more popular!
This means that, if we want to spread a powerful correctness tool, we will be more successful making it easier to use than making it even more powerful than it already is.
That's why it's been so exciting to work at @AntithesisHQ. They can drop the entire system- workers, databases, caches, and all- into a simulator and find bugs caused by faults. This is incredibly powerful. But more excitingly, this is so much easier than techniques with comparable strength. No need to write thousands of integration tests, or rewrite everything in Rust, or learn the dark arts of formal verification. Just provide a codebase, provide some workloads, and you're on your way to finding crazy bugs.
That's one way that it's "easier". For a long time, Antithesis has been "hard" in a different way: client onboarding.
We take customer security extremely seriously. This causes a lot of downstream technical decisions that, historically, meant we had to set up each new customer one-on-one. This made us, at best, a luxury tool available to a few select companies. An absurdly high strength-weight ratio for some, a NaN ratio for everyone else.
That's why we're so excited to finally roll out a self-service option. Sign up, grab our skills, tell your favorite agent to find bugs, and let our tool find the 10-service interaction bug that would cause you a nightmare outage.
We're currently opening up to 30 people as a test run. So if you want to see what's at the cutting edge of software testing technology, come check us out!
Today we're making it radically easier for developers everywhere to deliver bug-free software.
First, we’re launching an Antithesis plugin that gives you native access to Antithesis right from your coding agent. It handles the Antithesis workflow end-to-end, from system setup to test creation to debugging and validating fixes.
Here's the plugin at work. Check out the prompt: "/antithesis test HashiCorp Raft for bugs." Our announcement has more on the results.
And now that your coding agent is an expert in Antithesis, our new Teams plan offers low-cost, self-serve access to Antithesis for just $2,999 a month, with an early-access offer of 25% off your first month.
Sign up for Teams: t.co/aF5CdNFFCz Announcement: t.co/00NbRLFjSW Plugin repo:
For the month of November, use the code `feedchicago2026` to get Logic for Programmers for 50% off! All proceeds go to the Greater Chicago Food Depository.
(Only PDF for now because I don't yet know how to make Amazon coupons)
Would you rather spend a day debugging broken software or get a root canal? // Do you floss at least once a day?
The voters have spoken and we have a mandate: rename "X" back to "Twitter"
3 predictions:
1) In <2 years we won't even have computers 2) We'll all just strap psychic dogs to our brains 3) And beam each other psychic barks
3 predictions:
1) In < 2 years most code will be written in Lean4 or equivalent 2) The final binary will be faster than Rust or C 3) Compiler architecture will change, with builtin intelligence and drastically more aggressive optimizations
Have you ever tried having an AI represent code or a program as a high-level pseudocode? What makes this work well? Any interesting pseudocode constructs you or the AI create?
This whole verified business makes fun name changes extremely annoying
Current update on going all-in on Nixos: being able to swap Gnome for Niri is pretty cool. Now if I can just restore all of the affordances I lost...
Similar Creators
Explore AI →IBM AI engineer, Fluent React author, coding-show host, keynote speaker, and angel investor.
Engineer/Portfolio Manager - Join our free newsletter with 19,000+ subscribers - http://techinvestments.io
The sports newsletter guy. Words and emails @YahooSports. Previously: @axios and @espn. Founder: @sports_internet (acquired by Axios)
🦞 Microsoft Autopilot, Corporate Vice President @ Microsoft. I write a newsletter on products http://omarknows.com & http://omarknows.ai