Sunfish: a Python Chess Engine in 111 lines of code
Sunfish is a Python chess engine that fits a working implementation into 111 lines of code, built with a focus on extreme compactness. The project demonstrates this by packing the engine into a self-extracting executable of just a few kilobytes through minification and compression. Beyond the minimal core, Sunfish provides formal verification of its search algorithm written in Lean 4, proving the correctness of its fail-soft alpha-beta search without relying on external libraries like Mathlib. The project also includes infrastructure for running Sunfish as a bot on the Lichess chess platform using cloud free tiers (Google Cloud and Oracle Cloud), with support for both pypy3 and python3 interpreters for performance optimization.