hn.today

The Unreasonable Effectiveness of Vibeproving for Bug Finding

kcsrk.info4 points0 comments
Screenshot of The Unreasonable Effectiveness of Vibeproving for Bug Finding

A month-long effort used coding agents to hunt bugs in the roughly 60,000-line C and assembly runtime of OCaml 5, whose shared-memory concurrency makes its garbage collector especially difficult to reason about. The collector combines per-domain minor heaps with a shared, concurrently collected major heap; domains, threads and fibers can start, stop or run callbacks at points that interrupt GC work. Agents both audited the C directly and built formal models of the collector, treating domains as distributed processes and barriers, counters and stop-the-world pauses as protocols. Between 5 and 20 November, the effort filed 124 issues - 83 public and 41 private - and 67 involved concurrency. Most early findings came from direct code audits, and none of the 124 bugs was first discovered by a proof.

The models nevertheless exposed several subtle races. In one, a collector sweeping a weak array could read a dead key, then erase a live value another domain had just stored in the same slot. A model checker found the interleaving; a test hook reproduced it reliably, and later stress tests reproduced it without the hook. The fix made the collector’s write conditional on the slot remaining unchanged. As the Veil model expanded to cover domain lifecycles, ephemerons, finalisers, shutdown and heap behavior, it found six reported bugs, including lost ephemeron data, incorrect finaliser calls and a GC cycle that could fail to complete. The central lesson is that agents can find real runtime bugs, while explicit models and executable reproductions help distinguish plausible suspicions from defects that matter.

Read on kcsrk.info0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.