Toad is a work-in-progress chess engine, and serves as my personal excuse to write fun code in Rust.
It was originally built upon my chessie
crate, which is a chess library that handles board representation, move generation and all other rules of chess.
Up for a game? Play against Toad on Lichess!
By default, running Toad will cause it to print its version and authors and await input via stdin
.
For convenience, you can run any of Toad's commands on startup and Toad will exit immediately after that command's execution.
To run multiple commands on startup, pass them in with the -c "<command>"
flag.
You can pass in the --no-exit
flag to continue execution after the command(s) have finished executing.
Run the engine and execute the help
command to see a list of available commands, and --help
to view all CLI flags and arguments.
Toad abides (mostly) by the Universal Chess Interface protocol, and communicates through stdin
and stdout
.
The parsing of UCI commands and responses is handled by my uci-parser
crate.
The following UCI commands (and arguments) are supported:
uci
debug [ on | off ]
isready
setoption name <x> [value <y>]
ucinewgame
position [fen <fenstring> | startpos] [moves <move_1> ... <move_i>]
position kiwipete
.go wtime <x> btime <x> winc <x> binc <x> depth <x> nodes <x> movetime <x> infinite
go perft <x>
stop
quit
In addition to the above UCI commands, Toad also supports the following custom commands:
Commands:
await Await the current search, blocking until it completes
bench Run a benchmark with the provided parameters
display Print a visual representation of the current board state
eval Print an evaluation of the current position
exit Quit the engine
fen Generate and print a FEN string for the current position
flip Flips the side-to-move. Equivalent to playing a nullmove
hashinfo Display information about the current hash table(s) in the engine
makemove Apply the provided move to the game, if possible
moves Shows all legal moves in the current position, or for a specific piece
option Display the current value of the specified option
perft Performs a perft on the current position at the supplied depth, printing total node count
psqt Outputs the Piece-Square table value for the provided piece at the provided square, scaled with the endgame weight
splitperft Performs a split perft on the current position at the supplied depth
help Print this message or the help of the given subcommand(s)
For specifics on how a command works, run toad <COMMAND> --help
Name | Values | Default | Description |
---|---|---|---|
Clear Hash |
Clear the hash table(s) | ||
Hash |
1..=1024 |
16 |
Set the size (in MB) of the hash table(s) |
Threads |
1..=1 |
1 |
Only implemented for use with OpenBench |
UCI_Chess960 |
true , false |
false |
Enable support for Chess960 |
To run Toad, head over to the releases page to grab the latest pre-compiled release for your platform. Alternatively, you can build from source:
git clone git@github.com:dannyhammer/toad.git
cargo run --release
or run make
to generate an executable named toad-<version>
.
make
./toad-<version>
Note: Development has primarily been done on Linux (Ubuntu 22.04), with minimal testing on Windows 10 and no testing on MacOS. If you are willing to test the installation and execution of Toad on other operating systems, please provide feedback!
K < P < N < B < R < Q
, so KxR
is ordered before PxR
.More features will be added as development continues! You can see most of my future plans in the backlog.
More people have helped me on this journey than I can track, but I'll name a few notable resources/people here: