Asked AI to Review a Known Concurrency Bug, It Came Back Clean

cto_junior · x · 2026-09-23

The author tested AI code review against a bug their team already knew about: during a worker shift change, worker A had applied updates past the checkpoint, and incoming worker B would re-apply them. The fix requires A to undo the extra updates while a lock makes B wait — but the real code releases the lock early and bets the undo wins the race. The model came back clean: both the code and the model assumed the undo was one atomic step nothing could cut into, so every check passed even though the bug was real. Only after splitting the undo into its real steps and making the lock visible to the scheduler did the model find it, via the counter example (1 → 2 vs 1 → 3, same input, two answers).

Related event: Engineers Use LLMs to Hunt Concurrency Bugs Tests Miss(4 posts)→

Original post →

More from coding & agent

coding & agent channel →