SQLite: 92 million lines of tests Dijkstra: Tests can only prove the presence of bugs, never their absence!
https://news.ycombinator.com/item?id=18442941
Tracking down the 16-year-old WAL-reset SQLite bug
241–250 of 263 posts
Re: Tracking down the 16-year-old WAL-reset SQLite bug
#242Re: Tracking down the 16-year-old WAL-reset SQLite bug
#243Earlier quoted context omitted.
Just because you can't exhaustively test one thing doesn't mean you can't exhaustively test anything.
Not being able to exhaustively test simple problem absolutely means you can't exhaustively test massively more complex problem . For a monotonically increasing function f, which I think we can agree a function mapping from the size of the input set to the runtime of an exhaustive execution of all elements in the set qualifies as, if |small| < |large| then f(small) < f(large). Therefore if f(small) is too big then f(l…
"Simple"/"complex" doesn't necessarily imply "small"/"large", respectively. Testing whether the Collatz conjecture holds is "simple", but its search space is (potentially) infinitely large. Testing correctness of concurrent data structures is (probably) a more "complex" problem, and yet it's still possible to perform exhaustive tests of their functionality [0].
In the end, the practicality of exhausting the 64-bit integer search space is irrelevant since it says nothing about the size of the write + checkpoint search space. I could just as easily say that it's easy to exhaust the 16-bit integer search space, but that doesn't mean exhaustively testing for this particular bug is easy.
[0]: http://demsky.eecs.uci.edu/publications/c11modelcheck.pdf
Re: Tracking down the 16-year-old WAL-reset SQLite bug
#244For this particular category of bug, SQLite's existing testing methodology is demonstrably outclassed by modern deterministic concurrency testing. https://antithesis.com/blog/2026/wal-reset-bug/
Re: Tracking down the 16-year-old WAL-reset SQLite bug
#245Earlier quoted context omitted.
Being an identity provider for anything important is the freaking worst. Exposes you to a million problems. You need human support for login problems and lost MFA tokens, and you are an attack magnet.
Which is why you want magic links. Don't be the identity provider, have the email host be the identity provider (which it is anyway if you have a forgot password prompt). Agreed 100% that nobody should still be using passwords in 2026 though.
This is an extreme case, yes, but I have similar issues with several services that only support magic links and GitHub login, and it's hard to configure services to use a new catch-all address when they harvest my address from GitHub login and won't let me change it. Magic links are a great tool, but they should _never_ be the only option. They should supplement existing login methods. Password managers exist for a reason. Several services that I have since stopped using for this reason have in the past decided that they should start sending emails to the addresses they harvested from login with other service. Two services have gotten my magic link address stuck in their system because it's not associated with an account (the account has been deleted) and thus I can't manage subscriptions.
Re: Tracking down the 16-year-old WAL-reset SQLite bug
#246Earlier quoted context omitted.
Everyone doesn’t seem to know that, because tests are often cited as a way to ensure that AI-generated code is correct.
I was very excited about formal proofs, which are now very cheap to produce, in service of validating AI generated code. But I had a funny experience recently where an agent implemented an entire feature completely wrong (exactly backwards, actually, in a way that defeated the purpose, introduced security issues etc.). It happily supplied tests for the new functionality, and all the tests passed. What I realized was,…
This never changed with AI; in fact, I think it made this need more visible than it ever had been before. You can't get away with not being able to describe in detail what you want. As with working with humans, any ambiguities will be interpreted, and not always in the way you hoped.
Re: Tracking down the 16-year-old WAL-reset SQLite bug
#247Earlier quoted context omitted.
Everyone doesn’t seem to know that, because tests are often cited as a way to ensure that AI-generated code is correct.
I was very excited about formal proofs, which are now very cheap to produce, in service of validating AI generated code. But I had a funny experience recently where an agent implemented an entire feature completely wrong (exactly backwards, actually, in a way that defeated the purpose, introduced security issues etc.). It happily supplied tests for the new functionality, and all the tests passed. What I realized was,…
Yes, that has always been the case with formal proofs. Even a mathematical proof with Lean is useless if the proven formal statement doesn’t match what the mathematician meant. And that’s why humans working with formal languages won’t be going away. Natural language is imprecise by nature, even when we have precise ideas in mind. In that case, it’s often better to specify what we mean in a formal language than in natural language.
Re: Tracking down the 16-year-old WAL-reset SQLite bug
#248This is just proof that it can't be used in real-world applications.
SCNR
Re: Tracking down the 16-year-old WAL-reset SQLite bug
#249This was a great technical writeup and very interesting to read, but it's not clear to me why once the suspected source of the bug was identified, they seemingly didn't build a automated way to trigger the condition? It seems like that could have cut down on the uncertainty of whether the fix worked over a painfully long period of time.
The sqlite dev team did. It's in the article. > It could exist that long because it was rare—so rare, the SQLite developers had to add code to deliberately trigger it in their testing environments.
Re: Tracking down the 16-year-old WAL-reset SQLite bug
#250Earlier quoted context omitted.
Yeah it’s a pity that wasn’t addressed in the article. This is a little like “we shot ourselves in the foot and then performed surgery on our foot, and everything is resolved now.”
That assumes that they do actually believe it's a mistake. They didn't explain the reasons they've gone for this architecture in much/any detail. I'd be interested in hearing them talk more about that in the future. Perhaps you or I would make a different decision based on the aims that lead them there. But there isn't enough information to say whether or not their decision was a mistake, even if it has lead to a pec…
They also touch on this when they say that it worked for them for a long time.
This is a pretty classic symptom of a system that was designed a certain way early on and then runs into issues as the system grows.
One can argue that this was due to a bug, but it's a bug that they shouldn't really have had to deal with - a consequence that the design opened them up to.