UCI chess engine with NNUE evaluation
A UCI-compatible chess engine. The engine uses an alpha-beta search with many enhancements, and evaluation is handled by a small-size, efficiently updatable neural network (NNUE) trained on data from simulated games against itself.
The last major release (5.1.0 as of the time of typing this) has been rated 3493 Elo in CCRL Blitz and 3410 for CCRL 40/15.
CLI:
- Functional (but not complete) UCI implementation
- Custom Commands:
printstate
: shows the state of the board.perftsuite <suite>
: performs a suite of perft tests, currently only supports the suite ethereal.perft <depth>
: performs a perft test from the current position and outputs the result.splitperft <depth>
: performs a perft test from the current position and outputs the result seperated by which move is the first one done.getfen
: outputs a string of Forsyth-Edwards Notation (FEN) that encodes the current position.incheck
: outputs if the current position is in check or not.evaluate
: outputs the evaluation of the current position.bench <depth>
: performs the bench test, a fixed depth search on a series of 50 positions.position kiwipete
: loads the position known as kiwipete, with the FEN ofr3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1
.makemove <move>
: takes in one move in long algebraic notation and performs it on the board.undomove
: undoes the most recent move on the board.nullmove
: switches the current color to move, also known as a null move.undonullmove
: undoes a null move.isrepeated
: outputs a boolean of if the current position is a repeat.tunablejson
: outputs the text contents of a JSON file of all of the tunable parameters within Clarity.
Board Representation:
- Copymake moves
- Board represented using 8 bitboards
- Pext bitboards / Magic bitboards, lookups, and setwise move generation
- Repetition detection
- Incremental Zobrist hashing
- Incremental NNUE Updates
- Rudimentary board visualization
Search:
- Fail-Soft PVS search with alpha-beta pruning
- Transposition Table (TT) (with adaptable sizing)
- Internal Iterative Reductions
- Improving Detection + Modifications
- Razoring
- Reverse Futility Pruning (Static Null Move Pruning)
- Null Move Pruning
- Check Extensions
- Move Ordering (More on this later)
- Mate Distance Pruning
- Incremental Move Sorting
- Futility Pruning
- Late Move Pruning
- Late Move Reductions
- Static Exchange Evaluation (SEE) Pruning
- History Pruning
- Singular Extensions
- Multicut
- Double Extensions
- Negative Extensions
- Quiescence Search
- TT cutoffs
- Stand Pat Shenanigans
- Move Ordering
- Incremental Move Sorting
- SEE Pruning
- Dedicated capthist for Q search
Evaluation:
- (768->768)x2->1x8 NNUE trained using Bullet and self-play data
Move Ordering:
- Transposition Table Best Move
- Good Captures (As described by SEE) are sorted with MVV and Capthist
- Killer Move
- Quiets are scored with main history and ply - 1 and ply - 2 conthist
- Bad Captures are also sorted with MVV and capthist but are not boosted above quiets.
- Dedicated and simplified move ordering function for Q search
Toanth: General help and explaining things I didn't understand before
Ciekce: Preventing the cardinal sins of C++ since day 1
RedBedHed: Lookup tables for move generation
JW: More random C++ things
A_randomnoob: Helping with a lot of random engine bits
zzzzz: Ideas, planning, and a lot that I probably forgot
Logo generated by AI