This project provides:
- a progressively stronger chess engine in Rust
- UCI protocol support (usable in GUIs and match runners)
- scripts/tools to run matches and estimate Elo
cargo build --releaseEngine binary:
./target/release/rust_chess_engine
printf "uci\nisready\nposition startpos moves e2e4 e7e5\ngo depth 4\nquit\n" | ./target/release/rust_chess_engineExpected output includes:
uciokreadyokbestmove ...
perft tests are included for the starting position:
cargo test- Stockfish in PATH
- cutechess-cli
./scripts/run_vs_stockfish.sh \
./target/release/rust_chess_engine \
stockfish \
1400 \
100 \
10+0.1 \
./matches/sf_1400.pgnThis plays 100 games against Stockfish constrained by:
UCI_LimitStrength=trueUCI_Elo=1400
cargo run --bin pgn_elo -- --pgn ./matches/sf_1400.pgn --engine rust-engineThis returns an estimated Elo difference (engine - opponent) and a 95% CI.
Absolute estimate:
engine_elo ~= opponent_elo + elo_delta
Run a short gauntlet:
./scripts/calibrate_elo.sh \
./target/release/rust_chess_engine \
stockfish \
"1400 1600 1800 2000" \
60 \
10+0.1Pick the level where your score is near 50%. That level is usually your closest "similar-strength" anchor.
Search:
- iterative deepening alpha-beta negamax
- principal variation search (PVS)
- transposition table (hash move + bound reuse)
- killer moves + history heuristic
- null-move pruning
- late move reductions (LMR)
- quiescence search on tactical moves
Evaluation:
- material + piece-square tables
- mobility terms
- pawn-structure terms (isolated/doubled/passed pawns)
- rook open/semi-open file activity
- king shelter heuristics
- bishop pair bonus
Opening phase:
- built-in opening repertoire for common
1.e4,1.d4, and1.c4structures
- With
go depth N, search is depth-limited toN. - With
go movetime ...orgo wtime/btime ..., search is time-managed and can keep deepening up to internal max depth.
Elo estimates from short matches can swing a lot. Prefer at least 100-200 games per level for stable conclusions.