Notes on Debugging Things That Shouldn't Be Broken
The bugs that eat the most time aren't the complicated ones. They're the ones where every piece of evidence tells you the bug can't exist, and yet here it is, reproducing reliably in front of you.
A few things I've learned to do the moment I hit that wall:
1. Stop trusting your model of the system
If your mental model says X is impossible and X is happening, your model is wrong somewhere — not the universe. Go find where.
2. Bisect ruthlessly
Cut the reproduction in half. Then cut that half in half. Don't try to reason your way to the cause from first principles when you can just narrow the search space mechanically.
3. Distrust the "obviously fine" assumption most
The line you skipped because it "obviously can't be the problem" is where the bug lives more often than chance would suggest. That's not superstition, it's selection bias — you already ruled out the things you scrutinized.
4. Write down what you've ruled out
Not for anyone else. For you, twenty minutes from now, when you're tired and about to re-check something you already eliminated.
Debugging is mostly a discipline problem, not an intelligence problem. The engineers who are fast at it aren't smarter — they're just more willing to be systematic when it's tempting to guess.