Anodos is a UCI-compatible chess engine written in Rust. Built from scratch with bitboard-based move generation and alpha-beta optimised search.
- Move generation
- Bitboards for pseudo-legal move generation
- Fancy magic sliding piece attacks
- Search
- Iterative deepening
- Aspiration windows
- Negamax with alpha/beta pruning
- Null-move pruning
- Extended/reverse futility pruning
- Principal variation search
- Quiescence search
- Check extension
- Transposition table with Zobrist keys
- Move ordering
- TT move
- MVV/LVA
- Killer moves
- History heuristic
- Evaluation
- Basic material counting
- MG/EG PSQTs (currently with game phase tapering for the king only)
- Universal Chess Interface
- Play via any UCI-compatible GUI (e.g. Cute Chess, En Croissant)
- Basic time management with
movetime/wtime/btime/winc/binc
- Search
- Late move reductions
- Counter-move heuristic
- Static exchange evaluation
- Multi-threading
- Evaluation
- Insufficient material draw detection
- Tapered PSQTs for all other pieces
- Syzygy tablebase support
Supported commands:
uci
isready
ucinewgame
position startpos [moves ...]
position fen <fen> [moves ...]
go [infinite]
go depth <n>
go nodes <n>
go movetime <ms>
go wtime <ms> btime <ms> [winc <ms>] [binc <ms>]
setoption name Hash value <MB>
stop
quit
Beyond the UCI protocol, the engine supports these debugging/utility commands:
| Command | Description |
|---|---|
perft <depth> |
Run perft to validate move generation |
printboard |
Display the current position |
printfen |
Output the current position as a FEN string |
domove <move> |
Make a move on the current position (e.g., domove e2e4) |
This project uses Rust edition 2024, so you'll need Rust 1.85+ (stable).
For the best performance, always use release mode:
cargo build --release
./target/release/anodosAlternatively, you can run in release mode directly:
cargo run --releaseTo enable debug assertions (useful during development for catching bugs), use:
cargo runOnly use debug mode for testing and development; release mode is strongly recommended for actual games or benchmarks.
Binaries published on the Releases page are built with PGO (see .github/workflows/cd.yml).
To run a local PGO build:
rustup component add llvm-tools-preview
cargo install cargo-pgo
# Build an instrumented binary
cargo pgo build
# Collect profiles by running the benchmark command
cargo pgo run -- bench
# Build the optimised (PGO) binary
cargo pgo optimizeRun the test suite:
cargo testThis includes a shallow perft check from the starting position (depth 5).
To run the deeper perft test suite (ignored by default), include ignored tests and use release mode:
cargo test --release -- --include-ignoredTo measure the engine's nodes-per-second performance, run the binary as follows:
./anodos bench [--depth <DEPTH>] [--tt-mb <MB>]--depth(default: 12) sets the search depth for each position--tt-mb(default: 64) sets the transposition table size in MB
