⚡ Zig chess engine ⚡
- Fancy Magic Bitboards
- Staged Move Generation
- Transposition Table Move Ordering
- Principal Variation Move Ordering
- Static Exchange Evaluation
- Chess960 support
- Principal Variation Search
- Alpha-Beta Pruning through Negamax
- Aspiration Window
- Late Move Reductions
- Late Move Pruning
- Null Move Pruning
- Reverse Futility Pruning
- Futility pruning
- Mate pruning
- Razoring
- Internal iterative reductions
- Quiescence Search
- Multi threading using lazy SMP
- Threefold Repetition
- Time Management
- Tuned Piece-square Tables
- AlphaZero Average Piece Values
- Tapered Evaluation
- Transposition Table Evaluation
- Endgame Heuristics
- Pawn Structures Heuristics
- Bishop pair bonus
- Mobility Bonus
Time control: 120+1
CCRL blitz benchmark.
| Rank | Name | CCRL | Elo | + | - | games | score | oppo. | draws |
|---|---|---|---|---|---|---|---|---|---|
| 1 | radiance_4.4 | 2243 | 14 | 14 | 3456 | 88% | 1834 | 11% | |
| 2 | radiance_4.3 | 2071 | 2071 | 9 | 9 | 7008 | 77% | 1816 | 14% |
| 3 | radiance_4.2 | 1803 | 1917 | 8 | 8 | 7008 | 57% | 1861 | 20% |
| 4 | radiance_4.1 | 1674 | 1754 | 8 | 8 | 8283 | 46% | 1762 | 15% |
| 5 | radiance_4.0.1 | 1596 | 8 | 8 | 15176 | 61% | 1413 | 8% | |
| 6 | radiance_3.5 | 1321 | 1338 | 8 | 8 | 10216 | 66% | 1141 | 11% |
| 7 | radiance_3.4 | 1299 | 1314 | 8 | 8 | 10218 | 64% | 1144 | 11% |
| 8 | radiance_3.3 | 1262 | 8 | 8 | 10216 | 59% | 1150 | 11% | |
| 9 | radiance_3.2 | 1251 | 8 | 8 | 10215 | 58% | 1152 | 11% | |
| 10 | radiance_3.1.1 | 1117 | 1081 | 8 | 8 | 9552 | 45% | 1131 | 9% |
| 11 | radiance_3.0.1 | 804 | 9 | 9 | 9552 | 20% | 1166 | 9% | |
| 12 | radiance_2.4 | 763 | 9 | 9 | 9552 | 16% | 1171 | 10% | |
| 13 | radiance_2.3 | 872 | 718 | 9 | 10 | 9552 | 13% | 1177 | 9% |
zig build run -release=fast
zig build deploy
zig build test --release=safe
| Name | Type | Default value | Valid values | Description |
|---|---|---|---|---|
Hash |
spin | 256 | [1, 65535] | Memory allocated to the transposition table (in MB). |
Threads |
spin | 1 | [1, 1] | Number of threads used to search. |
Evaluation |
combo | "PSQ" | ["PSQ", "Shannon", "Materialist"] | Type of evaluation function. |
Search |
combo | "NegamaxAlphaBeta" | ["NegamaxAlphaBeta", "Random"] | Type of search function. |
UCI_Chess960 |
check | false | ["true", "false"] |
licenseuciisreadysetoption name <string> [value <string>]ucinewgameposition [(fen <string> | startpos | kiwi | lasker) [moves <string>...]]go [movetime <int> | wtime <int> | btime <int> | winc <int> | binc <int> | nodes <int> | depth <int> | searchmoves <string>... | infinite | perft <int>]stopdbenchbenchvevalquit
This project was originaly written in C++ before 4.0 version and archived under the name radiance_archived.
- Avalanche engine is a great example of how a zig project should be coded. Radiance engine still uses its pseudo random number generator (MIT License - Copyright (c) 2023 Yinuo Huang).
- Stockfish with its aggressive pruning methods.
- Chess Programming Wiki.
I'm radiant!
