A c++ chess engine that fits into 4KiB
It supports the following subset of the UCI protocol:
uciisreadyposition startpos moves ...go wtime ... btime ...quit
Additional support for non-4K builds:
ucinewgameposition fen ... moves ...go infinite
The first message is always regarded as uci due to the space restriction
Building c4ke requires g++ that supports c++23:
git clone https://github.com/citrus610/c4ke
cd c4ke
make c4ke
To build c4ke-mini on Linux, run:
make mini
The minifier isn't general-purpose and won't work on all c++ code
- Removing whitespaces
- Removing single-line comments
- Removing
#ifdefblocks (usually for OpenBench compliance code) - Finding and replacing
#defineconstants - Renaming identifiers
- Bitboard
- 8x8 Mailbox
- Hyperbola Quintessence move generation
- Iterative deepening
- Aspiration windows
- Lazy SMP
- Principal variation search
- Quiescence search
- Check evasions
- Transposition table
- Move ordering
- TT move
- MVV
- Quiet history
- Noisy history
- Continuation history
- 1-ply
- 2-ply
- Static exchange evaluation
- Selectivity
- Pruning
- Reverse futility pruning
- Null move pruning
- Late move pruning
- Futility pruning
- PVS SEE pruning
- QS SEE pruning
- Extensions
- Singular extensions
- Double extensions
- Triple extensions
- Multicut
- Singular extensions
- Reductions
- Late move reductions
- Pruning
- Static evaluation correction history
- Pawn correction history
- Non-pawn correction history
- Continuation correction history
- 1-ply
- 2-ply
- Material
- Rank/file piece-square tables
- Bishop pair
- Mobility
- Tempo
- Rook on open file
- Rook on semi-open file
- Pawn threats
- Pawn push threats
- Pawn structure
- Protected pawn
- Doubled pawn
- Passed pawn
- Pawn phalanx
- Passed pawn kings proximity
- King safety
- King on open file
- King on semi-open file
- Pawn shield
- King ring attack
- Queenless attack
- Endgame scaling
- Soft limit
- Hard limit
- Best move's node count scaling
