Mojo-based UCI chess engine with legal move generation, alpha-beta search, perft checks, and Elo benchmarking against Stockfish.
src/mojo_engine/main.mojo: pure-Mojo UCI engine with legal move generation, search, and perft.scripts/uci_smoke.py: protocol smoke test (uci,isready, onego).scripts/perft_check.py: verifies perft counts against known reference positions.scripts/legality_check.py: checks generated moves are legal in self-play.scripts/run_matches.py: runs matches vs Stockfish at chosen Elo anchors.scripts/estimate_elo.py: estimates your engine Elo with confidence intervals from match scores.scripts/elo_math.py: Elo math shared by scripts.docs/ROADMAP.md: practical build path from scaffold to a real engine.
mojoinstalled and available onPATH.cutechess-cliinstalled.stockfishinstalled.- Python 3.10+.
chessPython package installed in your virtualenv.
mojo build src/mojo_engine/main.mojo -o build/mojo_enginepython3 scripts/uci_smoke.py \
--engine-path ./build/mojo_engine \
--timeout 20python3 scripts/legality_check.py
python3 scripts/perft_check.py
python3 scripts/perft_check.py --fullpython3 scripts/run_matches.py \
--engine-path ./build/mojo_engine \
--engine-dir "$(pwd)" \
--opponent-elo 1320 1500 1700 \
--games 40 \
--tc 1+0.1 \
--concurrency 1For weaker, closer opponents you can disable Elo anchoring and cap Stockfish:
python3 scripts/run_matches.py \
--engine-path ./build/mojo_engine \
--engine-dir "$(pwd)" \
--opponent-elo 1320 \
--no-opponent-limit-strength \
--opponent-skill-level 0 \
--opponent-depth 1 \
--games 40 \
--tc 0.5+0.05This writes a timestamped folder under results/ with:
- one PGN per opponent Elo,
- raw cutechess logs,
summary.json,summary.txt.
python3 scripts/estimate_elo.py --input results/<run-id>/summary.json- The current engine is intentionally simple and lightweight; strength comes from deeper search and better eval terms.
- Run at least 200 games near your estimated level for tighter confidence intervals.