Thunfisch is a UCI-compatible chess engine written from scratch in Rust. It is a listed Bot-Account on Lichess. If it is online you can challenge it here.
Estimated Strength: ~2400 Elo
- Direct legal move generation with Fixed Shift White Magic Bitboards
- Piece Square Table only evaluation using PeSTO's Evaluation Function
- Basic Time Management
- Search:
- Move Ordering:
- Staged Move Picker with incremental move generation
- Transposition Table for move ordering
- MVV-LVA Move Ordering
- Killer Heuristic
- Planned
Thunfisch is a command-line application that implements the Universal Chess Interface (UCI). To play against it comfortably, you should load the compiled binary into a chess GUI. We recommend Cutechess. There are instruction on how to add the bot to the gui here.
General Setup Steps:
- Build the engine using
cargo build --release. - Locate the compiled executable at
target/release/thunfisch. - Open your preferred chess GUI and look for an "Add Engine" or "Manage Engines" option in the settings.
- Point the GUI to the executable file. You can then start a new game and select Thunfisch as your opponent.
uci - Identify engine and author
isready - Engine readiness check
ucinewgame - Start new game (resets engine state)
position [options] - Set up position (see below)
go [parameters] - Start search (see below)
quit - Exit engine
fen - Print current FEN
position options
startpos - Set up the standard chess starting position
fen <FEN> - Set up a position from a FEN string
moves <m1> <m2> - Play moves from the given position
go parameters:
depth <n> - Search to fixed depth n (plies)
wtime <ms> - White time left (ms)
btime <ms> - Black time left (ms)
winc <ms> - White increment per move (ms)
binc <ms> - Black increment per move (ms)
movestogo <n> - Moves to next time control
movetime <ms> - Search exactly this many ms
Examples:
position startpos moves e2e4 e7e5
go depth 6
go wtime 60000 btime 60000 winc 0 binc 0
perft <depth> [--debug|--perftree|--rayon] - Perft Test
search [--help] - Better formatted go
draw - Print board
moves - Print legal moves
eval - Prints current Evaluation with Depth of 0
do <move> - Play move (e.g. do e2e4)
For easy isolation of individual engine features, these have been added as compiler features to the project. See Cargo.toml for what features are available, and settings.rs for how they relate to the code.
cargo build
# or: cargo build --features allFor example, say you want only Quiescence Search, Alpha Beta and MVV-LVA move ordering enabled. Then run this command:
cargo build --no-default-features --features "ab,qs,mvv-lva"- Thanks to the awesome community from the Engine Programming Discord server
- Thanks to Perftree for debugging the move generation
- Thanks to Fastchess for allowing the testing of changes with SPRT tests
- Thanks to all other open source engines but especially these ones in no particular order:
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
