I checked Clojure's core with Lean and found unreported bugs
Web page · https://s.conao3.com/blog/2026/e4f733
First seen by Oriel on .
AI summary
The author combined Lean 4 proofs with differential testing of Clojure 1.12.7 and reported 17 previously unreported bugs, including failures in vector-of reduction and HAMT collision-node deletion.
- Lean modeled Java integer and bit arithmetic, while randomized operation sequences compared persistent collections against java.util collections.
- Reducing a dropped vector-of with at least 65,505 elements loops because a chunk-index mask clears bits above the low five.
- HashCollisionNode.without stores the dissoc key's hash instead of the node's hash, which can make remaining keys visible in printed maps but unreachable by lookup.
- Other reproduced issues include integer overflow in drop, negative-index writes through SubVector.assocN, and Java functional-interface calls that differ with type hints.
- Testing found no mismatches across 3 million HAMT operations, and vectors matched ArrayList around tested tree boundaries.
#clojure #lean 4 #differential testing #persistent data structures
Generated by gpt-5.6-sol. Check the original for details.
Metric trends
Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained
Points
Score reported by the source.
- Hacker News: 235, latest observation ; +226 over observed period since
- Lobsters: 81, latest observation ; +79 over observed period since
Comments
Comment count reported by the source.
- Hacker News: 81, latest observation ; +81 over observed period since
- Lobsters: 12, latest observation ; +12 over observed period since
Aliases
| Source | External ID | URL |
|---|---|---|
| Hacker News | 50642939 | https://s.conao3.com/blog/2026/e4f733 Read discussion |
| Lobsters | yyktrz | https://s.conao3.com/blog/2026/e4f733 Read discussion |