byte-knight
is a UCI compliant chess engine written in Rust. It started as a port of the chess engine I submitted for Sebatian Lague's Chess Engine Challenge where it placed in the top 32 out of 600+ entries.
byte-knight
is my first "real" Rust project. I'm a long time C++ developer and have been itching to learn Rust. I really enjoyed participating in the chess challenge a while back and thought that writing a new chess engine from scratch would be a good way to learn the language.
byte-knight
is a command line chess engine and does not come with any sort of user interface. There are many chess GUIs out there that you can use like cutechess.
New features are tested via my OpenBench intance using SPRT testing.
- Bitboard board representation
- Magic bitboards for sliding piece attacks
- Zobrist hashing with board state history
- Legal move generator
- Iterative deepening
- Negamax with alpha/beta pruning
- Quiescence search
- Transposition Table
- Time control
- Basic hard/soft limits
- Move ordering
- MVV/LVA with transposition table priority
- Piece square tables with tapered evaluation using PeSTO values.
UCI is a standard protocol for chess engines. byte-knight
implements the following commands:
uci
ucinewgame
isready
position <fen> moves <move list>
go
depth <depth>
nodes <nodes>
wtime <wtime> btime <btime> winc <winc> binc <binc>
stop
quit
To see all commands that byte-knight
supports, type:
byte-knight help
To see all options for a given command, type byte-knight <cmd> --help
.
bench
- This runs a fixed depth search on a variety of positions. This is used by OpenBench for scaling based on engine performance.
Name | Value Range | Default | Description |
---|---|---|---|
Hash | [1 - 1024] | 16 | Set the TT table size in MB |
Threads | [1] | 1 | How many threads to use in search |
Clone the repo and run:
cargo run --release
The project is licensed under the GPL license. See LICENSE for more details.
Thanks/acknowledgement for those who have inspired and helped with this project:
- Sebastian Lague for his chess YouTube vidoes and for hosting a fun coding challenge.
- The Chess Programming Wiki for all the free information. Thank you to all the various authors.
- Analog-Hors for some excellent write ups on chess, especially regarding magic numbers.
- Many members of the Engine Programming discord for helping see how little I really know.
- Danny Hammer for providing feedback, for helping me with troubleshooting my engine and for writing the
chessie
anduci-parser
crates. Thanks for inspiring some of the techniques and methods used inbyte-knight
. - Marcel Vanthoor for his Rustic engine and associated book.
@DeveloperPaul123 |
---|