| I checked Clojure's core with Lean and found unreported bugs(s.conao3.com) | |
| 237 points by encyclopedism 4 days ago | 81 comments | |
tl;dr: Using Lean 4 to model small Clojure core functions and differential testing against java.util collections, the author found 17 previously unreported bugs in Clojure 1.12.7. Notable issues include an infinite loop in `reduce` on `vector-of` with ≥65505 elements (caused by a bad 0xffe0 bitmask), a HAMT `dissoc` bug that stores the wrong hash on collision nodes and can hide keys, and `.removeIf` returning different results depending on whether a type hint triggers reflection. The large persistent data structures themselves (HAMT, vector trees, red-black trees) showed no mismatches. | |
HN Discussion:
| |