I had a bug that would not move. Three hours of staring, adding print statements, removing print statements, and re-reading the same fifteen lines as if they'd confess if I looked hard enough. They didn't. I was at the stage where I'd stopped reading the code and started just resenting it.
So I got on the bike. Not as a productivity tactic, I'd like to be clear, just to get out of the chair before I said something unkind to a perfectly innocent function.
Somewhere on a long flat stretch with nothing to think about, the answer turned up uninvited. I wasn't debugging. I was watching a tractor pull out of a field. And the thought arrived fully formed: the timestamp was in the wrong timezone before it ever reached the function I'd been blaming. The bug wasn't where I was looking. It never had been.
I didn't rush home. I finished the ride, because the fix wasn't going anywhere and I'd earned the rest of the loop. It took two minutes to apply once I sat back down.
I know the neuroscience-flavoured explanation, the diffuse mode, the background process, all of that. I don't really care why it works. I just know that the hardest bugs I've solved were rarely solved at the desk. Step away. Move. Let the thing go quiet. It's not giving up, it's the most reliable debugging tool I own, and it has tyres.