A Chess engine written from scratch in Rust.
If you use this code verbatim, or as a reference, please credit me!
Rating Lists featuring Maxwell: CCRL Blitz | MCERL
Play against Maxwell on Lichess! | Some of Maxwell's Games
- Tweak search values & thresholds
- Internal Iterative Deepening
- Static Exchange Evaluation
- Late Move Pruning
- Write an NNUE implementation! I've learned how Neural Networks work, so I'm really excited to get started on that
- Multithreading
- fen=<FEN STRING>: Sets up the board by a fen string (Doesn't work for UCI games) (default=STARTING_FEN)
- debug_output=<BOOLEAN>: Toggle debug output that gets outputed per ply (default=true)
- opening_book=<BOOLEAN>: Toggle built-in opening book (default=false)
- time_management=<BOOLEAN>: Toggle time management, if false the bot will use all the remaining time (default=true)
- hash_size=<INTEGER>: Sets the hash size in Megabytes, there's also a UCI option for this under the name "Hash" (default=256)
- uci, isready, ucinewgame, position, go, stop, and quit commands
- "position" is only implemented for "position startpos", "position fen" is not yet implemented
- "Hash" UCI option, which sets the hash / transposition table size in Megabytes
- Purely bitboards
- Supports loading from FEN strings
- Basic handcrafted opening book
- Magic bitboards for sliding pieces
- Hardcoded pawn movement
- Bitboard masks for other pieces calculated at startup
- Calculates pseudo-legal moves, then skips illegal moves in move loop
- Material count
- Piece square tables
- Separate middlegame and endgame tables for pawns and kings
- Passed, isolated and doubled pawns
- Attacked squares around kings
- Best move from the previous iteration, otherwise whatever move from the transposition table
- MVV-LVA
- 2 Killer Moves
- History Heuristic
- Indexed by side to move, move start square, move end square
- Single Threaded ~ For now ;)
- Negamax
- Iterative Deepening
- Alpha-Beta Pruning
- Late Move Reductions
- Principal Variation Search
- Reverse Futility Pruning (Static Null Move Pruning)
- Null Move Pruning
- Razoring
- Internal Iterative Reductions
- Quiescence Search
- Delta Pruning
- No TT Lookups
- Transposition Table
- UCI "Hash" option to change max size, default is 256 MB
- Replacement scheme prefers higher depth and exact evaluation bound
- Search Extensions
- Checks
- Pawn moves to the 2nd or 7th rank
- Time management
- If less than 7 moves have been played, it uses 2.5% of it's remaining time, otherwise 7%
- This value is then also clamped between 0.05 and 30.0 seconds