Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chess-mojo

Mojo-based UCI chess engine with legal move generation, alpha-beta search, perft checks, and Elo benchmarking against Stockfish.

What is included

  • 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, one go).
  • 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.

Prerequisites

  • mojo installed and available on PATH.
  • cutechess-cli installed.
  • stockfish installed.
  • Python 3.10+.
  • chess Python package installed in your virtualenv.

0) Build the engine binary

mojo build src/mojo_engine/main.mojo -o build/mojo_engine

1) Smoke-test your engine

python3 scripts/uci_smoke.py \
  --engine-path ./build/mojo_engine \
  --timeout 20

2) Validate legal move generation + perft

python3 scripts/legality_check.py
python3 scripts/perft_check.py
python3 scripts/perft_check.py --full

3) Run Elo ladder matches

python3 scripts/run_matches.py \
  --engine-path ./build/mojo_engine \
  --engine-dir "$(pwd)" \
  --opponent-elo 1320 1500 1700 \
  --games 40 \
  --tc 1+0.1 \
  --concurrency 1

For 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.05

This writes a timestamped folder under results/ with:

  • one PGN per opponent Elo,
  • raw cutechess logs,
  • summary.json,
  • summary.txt.

4) Recompute Elo estimate from stored summary

python3 scripts/estimate_elo.py --input results/<run-id>/summary.json

Notes

  • 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages