Repository navigation
The first release of cb2026 (ChessBrain 2026): a UCI and XBoard chess engine in Rust, written from scratch as a learning tool, with a companion book, Building a Chess Engine in Rust, on how each part works.
Highlights
- Strength: about 3286 ± 17 on the CCRL Blitz scale, from 5,600 games at 8+0.08 against seven rated engines; 3236 ± 16 with the first network, and 2782 ± 11 with the hand-crafted evaluation. The weaker reference engines say little at this level, so the figure rests mostly on the two strongest, Weiss 1.0 and Stash v27.0.
- A built-in NNUE network. It is 768 → 256 × 2 → 1, trained by cb2026's own trainer (on the CPU, or the GPU through Metal) in two generations: the first network learnt from 104 million positions of the hand-crafted evaluation's games, and this one from 103 million of the first network's games, which made it about 144 Elo stronger in self-play.
EvalFileloads another network, andnoneselects the hand-crafted evaluation. The hand-crafted evaluation still plays at the strength levels, which were calibrated with it, and in endings with a lone king or with at most five men and no pawns, which it plays better. - Search: principal variation search with a transposition table and aspiration windows. Null-move pruning, late move reductions and late move pruning, reverse futility pruning, razoring, futility and SEE pruning. Singular, double and negative extensions, multi-cut and internal iterative reductions. Move ordering by killers, countermoves, history and continuation history, and correction history. Adaptive time management, and Lazy SMP up to 256 threads.
- Features: UCI and XBoard, Chess960, MultiPV, pondering, Syzygy tablebases (
SyzygyPath) and Polyglot opening books (OwnBook,BookFile). Strength levels 0–20, andUCI_LimitStrengthwithUCI_Elo600–2500 on a human scale (Lichess rapid, estimated from how often people blunder). An interactive shell for playing, watching the engine think and switching its techniques on and off, and the Chess Node Protocol (CNP). - Tested:
- 22,400 games against itself, from 1+0.01 to 40/60, single-threaded and at four threads each (10,000 of them with this network), with no time losses, illegal moves or crashes;
- En Croissant, Cute Chess, XBoard and HIARCS Chess Explorer;
- move generation exact on every perft suite;
- the tests pass on macOS, Windows and Linux.
Downloads
| File | What it is |
|---|---|
cb2026-v1.0.0-aarch64-apple-darwin.tar.gz |
Macs with Apple silicon (M1 and later) |
cb2026-v1.0.0-x86_64-apple-darwin.tar.gz |
Intel Macs |
cb2026-v1.0.0-x86_64-pc-windows-msvc.zip |
Windows, x86-64 |
cb2026-v1.0.0-x86_64-unknown-linux-gnu.tar.gz |
Linux, x86-64 |
cb2026-gen2-256.nnue |
The built-in network as a file, for anyone who wants it. Every binary already has it. |
cb2026-lichess-2026-09.bin |
An opening book in the Polyglot format, from Lichess's September 2026 games between players rated 2200 or more, at blitz or slower (CC0): 97,432 moves for the first 20 plies. Set BookFile to it and turn on OwnBook. |
THIRD-PARTY-NOTICES.txt |
The notices of the open-source libraries cb2026 is built with |
SHA256SUMS.txt |
Checksums of every file: shasum -a 256 -c SHA256SUMS.txt --ignore-missing |
Each package holds the cb2026 program, the README (which explains the options), the licences and the third-party notices. Add the program to your GUI as a UCI engine.
- The Mac programs are signed with a Developer ID and notarised by Apple. The first run asks Apple online, and after that they open with no warning.
- The Windows program isn't signed, so Windows may warn the first time it's opened ("More info", then "Run anyway").
- The binaries are built for each platform's baseline CPU, so they run everywhere. A build from source with
RUSTFLAGS="-C target-cpu=native"is a little faster.
Known limitations
- The strength levels' ratings are estimated from how often people of each rating blunder, not measured in games against people.
- Without tablebases, a few long endings are hard for it at fast time controls. In tests at 200,000 nodes a move, it converted K+B+N against K 11 times in 15, and K+Q against K+R 32 times in 45. With Syzygy tables it wins them every time.
- The Linux binary is built on a current Ubuntu, so it needs a similarly recent glibc. On older systems, build from source.
Licence
cb2026 is MIT OR Apache-2.0. The release binaries include Syzygy probing through shakmaty-syzygy, which is GPL-3.0-or-later, so each binary is GPL-3.0-or-later as a whole. The packages include all three licences. A build without the syzygy feature is MIT OR Apache-2.0 throughout.
What's Changed
- Add cb2026 PRD, README and CLAUDE.md by @cjus in #1
- Claude/prd by @cjus in #3
- PRD: decisions after review (name cb2026, tablebases, test Mac, GUIs, research log) by @cjus in #2
- M0: workspace skeleton, CI, licence checks, book and cloud setup by @cjus in #4
- CLAUDE.md: file items for Carlos as needs-carlos issues by @cjus in #13
- PRD, CLAUDE.md: record answers from needs-carlos issues; main is protected by @cjus in #14
- CLAUDE.md: Claude may merge its own PRs once CI is green by @cjus in #15
- Stage 1: board representation, FEN and the shell's board display by @cjus in #16
- Stage 2: legal move generation, make move and perft by @cjus in #18
- Stage 3: magic bitboards for sliding attacks by @cjus in #19
- Stage 4 (part 1): Zobrist hashing by @cjus in #21
- Stage 4 (part 2): standard algebraic notation by @cjus in #22
- Stage 4 (part 3): Engine API, UCI and a random mover by @cjus in #23
- Match tool with SPRT, opening suite and mac-sprt.sh by @cjus in #25
- Stage 5: material evaluation and negamax alpha-beta search by @cjus in #26
- match: keep the SPRT verdict from the game that crossed the bound by @cjus in #27
- Stage 6: iterative deepening and time management by @cjus in #28
- Stage 7: quiescence search and MVV-LVA move ordering by @cjus in #29
- Stage 8: transposition table by @cjus in #30
- Stage 9: piece-square tables and tapered evaluation by @cjus in #31
- Stage 10: killers, countermoves, history and staged move picking by @cjus in #32
- Gauntlet tool and mac-gauntlet.sh: ratings against reference engines by @cjus in #35
- Fuzz tests for the FEN, move and UCI parsers by @cjus in #38
- match: repeating time controls and a count of games that ended badly by @cjus in #39
- Release workflow: draft GitHub releases with binaries from version tags by @cjus in #40
- Stage 11: principal variation search and aspiration windows by @cjus in #33
- Stage 12: null-move pruning by @cjus in #41
- Stage 13: late move reductions and late move pruning by @cjus in #42
- Stage 14: SEE, futility, razoring and SEE pruning by @cjus in #43
- Stage 15: full hand-crafted evaluation by @cjus in #44
- Stage 16: Texel tuning on self-play data by @cjus in #45
- docs/status.md: where cb2026 stands and how to carry on by @cjus in #48
- Stage 17: Lazy SMP with a lock-free transposition table by @cjus in #46
- Stage 18, part 1: Syzygy tablebases and Chess960 start positions by @cjus in #49
- Stage 18, part 2: Polyglot opening books by @cjus in #50
- Stage 19: strength levels and MultiPV by @cjus in #51
- Stage 20: XBoard/CECP, pondering, conformance tests, Lichess setup by @cjus in #52
- Shell: stats, tree, explain, eval diff, see, techniques, ab by @cjus in #53
- Shell: redo, clocks, hint, resign, draw, PGN save and load by @cjus in #54
- Shell: match, selfplay, uci and xboard by @cjus in #55
- Record stage 17's thread scaling and the M0 perft gate by @cjus in #56
- Fuzz workflow: build for the runner's target, not musl by @cjus in #59
- Check extensions (off by default: no measured gain) by @cjus in #57
- Internal iterative reductions by @cjus in #58
- Improving heuristic, off by default (SPRT −32 Elo); long tests move to the M3 Mac by @cjus in #60
- Record the M3 Max as the test machine (#62) by @cjus in #64
- Improving, gentler (half a ply off the margin), off by default after its SPRT; root evaluation fix by @cjus in #63
- Improving in reverse futility pruning only (third version), off by default after its SPRT by @cjus in #65
- Time losses: record the move, time taken and clock; list problems in SPRT comments by @cjus in #67
- Record the time-loss checks: none on the M3 (#66) by @cjus in #68
- M5: continuation history by @cjus in #69
- M5: history in late move reductions by @cjus in #70
- M5: singular extensions and multi-cut by @cjus in #71
- M5: adaptive time management by @cjus in #72
- M5 experiment: history heuristic off loses −17.7 ± 9.9; history stays on by @cjus in #73
- M5: history in LMR, second version by @cjus in #74
- Status for a new session: the SPRT loop, watch-sprt.sh, next steps by @cjus in #75
- M5 experiment: adaptive time off at 40+0.4 loses −13.8 ± 8.6; it stays on by @cjus in #76
- M5: negative extensions, +4.9 ± 4.0 (chapter 14.1) by @cjus in #77
- SPRT progress comments every 2,000 games; the watcher flags undecided runs by @cjus in #79
- M5: singular extensions from depth 6, +5.0 ± 4.1 (chapter 14.1) by @cjus in #78
- Status: #80 running on the M3, and how a new session picks it up by @cjus in #81
- M5: singular extensions from depth 4 (chapter 14.1) by @cjus in #80
- Status: #82 is running on the M3; M3 commands end with tail -f by @cjus in #83
- singular_margin 3, for an SPRT (was 2) by @cjus in #82
- Status: #84 is running on the M3 by @cjus in #85
- singular_margin 4: failed (−1.8 ± 5.3), stays at 3 by @cjus in #84
- Status: #86 is running on the M3 by @cjus in #90
- Match runner: restart engines after a failure; abort, don't score, games that can't start (#89 A, B) by @cjus in #91
- Transposition table buckets: failed (−8.8 ± 8.6), off by default by @cjus in #86
- Status: #92 is running on the M3 by @cjus in #93
- One Game type in cb2026-chess for every game by @cjus in #94
- Status: #94 merged by @cjus in #95
- Transposition table buckets at 40+0.4: +1.6 ± 6.3, no verdict; off again (record) by @cjus in #92
- Status: #96 is running on the M3 by @cjus in #97
- Gauntlet reference engines: seven versions, built from source by a script (#36) by @cjus in #98
- Double extensions: no verdict (+3.6 ± 4.9), off by default by @cjus in #96
- M2 passed: stage 14 rated 2442 ± 11 by gauntlet by @cjus in #99
- M3 passed: stage 16 rated 2669 ± 10 by gauntlet by @cjus in #100
- Gauntlet on main: 2714 ± 10, above the v1.0 rating gate by @cjus in #102
- Level calibration: five engines from 1058 to 1794, and scripts/mac-levels.sh by @cjus in #104
- Status: the level calibration (#103) is running on the M3 by @cjus in #105
- Levels: UCI_Elo fitted to the calibration, 752 to 2599 by @cjus in #107
- UCI_Elo: 800 to 2600, widened after the calibration by @cjus in #108
- Status: the 40+0.4 check of three levels (#106) is running by @cjus in #109
- Status: the levels are being recalibrated at 40+0.4 (#106) by @cjus in #110
- Levels: recalibrated at 40+0.4, 629 to 2483, and UCI_Elo 650-2450 (#106) by @cjus in #111
- Position::parse_move: a move in SAN or coordinates, and why text names none by @cjus in #113
- Status: #112 (correction history) is running on the M3 by @cjus in #114
- Correction history: the static evaluation corrected by pawn structure by @cjus in #112
- Status: #115 (capture history) is running on the M3 by @cjus in #116
- Capture history: captures ordered by their cutoffs as well as by MVV-LVA by @cjus in #115
- Status: #117 (ProbCut) is running on the M3 by @cjus in #118
- ProbCut: cut a node off when a good capture beats beta by a margin in a shallower search by @cjus in #117
- Status: #119 (correction history's piece tables) is running on the M3 by @cjus in #120
- Correction history's piece tables: corrections by each side's pieces as well as the pawns by @cjus in #119
- Status: #121 (the piece tables' second version) is running on the M3 by @cjus in #122
- Correction history's piece tables, second version: added to the pawn table, not averaged by @cjus in #121
- Status: #123 (singular_tt_depth_margin 4) is running on the M3 by @cjus in #124
- singular_tt_depth_margin 4 failed: −7.4 ± 8.0 Elo; back to 3 by @cjus in #123
- Status: #125 (double extensions at a margin of 50) is running on the M3 by @cjus in #126
- Double extensions at a margin of 50, on by default: +13.0 ± 8.3 Elo by @cjus in #125
- Status: #127 (double extensions at a margin of 100) is running on the M3 by @cjus in #128
- Double extensions at a margin of 100 failed: −7.3 ± 8.0 Elo; back to 50 by @cjus in #127
- Status: #129 (capture history's second version) is running on the M3 by @cjus in #130
- Capture history's second version failed: −6.8 ± 7.8 Elo, off by default by @cjus in #129
- Status: the gauntlet on main (#131) is running on the M3 by @cjus in #132
- The gauntlet rates main 2782 ± 11, 68 ± 15 above 2026-10-18 by @cjus in #133
- Status: #134 (capture history in the main search only) is running on the M3 by @cjus in #135
- CI: spend fewer Actions minutes (cjus/chessgui#73) by @cjus in #136
- A flag falling against material that can't mate is a draw (FIDE 6.9) by @cjus in #137
- Capture history, third version: the main search only (failed, off by default) by @cjus in #134
- Status: #138 (double extensions at a margin of 70) is running on the M3 by @cjus in #139
- Double extensions at a margin of 70 (failed, back to 50) by @cjus in #138
- Status: #140 (history pruning) is running on the M3 by @cjus in #141
- Relicense cb2026 as MIT OR Apache-2.0 (cjus/chessgui#98) by @cjus in #142
- cb2026 speaks the Chess Node Protocol (cjus/chessgui#98) by @cjus in #144
- History pruning (failed, off by default) by @cjus in #140
- v1.0: scripts/mac-robustness.sh for the release's robustness run (#146) by @cjus in #147
- Status: #145 (larger reductions at expected cut nodes) is running on the M3 by @cjus in #148
- Third-party notices in every release package by @cjus in #149
- Larger reductions at expected cut nodes (passed, +11.6 ± 7.7) by @cjus in #145
- Status: the v1.0 robustness run (#146) is running on the M3 by @cjus in #150
- Weaker levels blunder as people do, on a human scale (cjus/chessgui#113) by @cjus in #151
- Book: how a person's horizon and the mistake counts are built by @cjus in #152
- v1.0's robustness run was clean: 10,000 games, no problems (#146) by @cjus in #153
- Status: #155 (cut-node reductions of 2 plies) is running on the M3 by @cjus in #156
- Cut-node reductions of 2 plies, as in Stockfish: passed, +8.7 ± 6.4 by @cjus in #155
- Status: #158 (smaller reductions at expected all-nodes) is running on the M3 by @cjus in #159
- Smaller reductions at expected all-nodes: failed, −8.5 ± 8.4, off by default by @cjus in #158
- Status: #160 (smaller reductions where the PV was) is running on the M3 by @cjus in #161
- CNP: engine/evaluate, cb2026's evaluation term by term by @cjus in #162
- CNP: a search sent once the last has answered is never Busy by @cjus in #163
- CI: GitHub checks main nightly, not pull requests by @cjus in #164
- Smaller reductions where the PV was (Stockfish's ttPv): no verdict, off by default by @cjus in #160
- Status: #165 (larger reductions after many fail highs) is running on the M3 by @cjus in #166
- Larger reductions after many fail highs: passed, +12.8 ± 8.2 by @cjus in #165
- Status: #167 (Stockfish 17's cutoff reductions) is running on the M3 by @cjus in #168
- An empty setoption value clears a string option by @cjus in #169
- XBoard mode sends every MultiPV line, each depth's best last by @cjus in #170
- Cutoff reductions in Stockfish 17's version, for an SPRT by @cjus in #167
- Status: #171 (reductions when the hash move is a capture) is running on the M3 by @cjus in #172
- PRD: stage 21's plan, with our own NNUE trainer on the GPU through Metal by @cjus in #175
- Fetch the tablebases from the mirror's new WDL and DTZ directories by @cjus in #176
- Stage 21: the NNUE's definition in crates/nnue by @cjus in #177
- Larger reductions when the hash move is a capture, for an SPRT by @cjus in #171
- NNUE training records: 32 bytes per position, written by datagen by @cjus in #178
- Status: the first Lichess book is building on the M3 (#174); #179 is next by @cjus in #181
- Balanced starts for NNUE training records by @cjus in #180
- Stage 21: the CPU NNUE trainer, with gradients written by hand by @cjus in #182
- Opening books from people's games: the make-book tool by @cjus in #173
- Status: #179's SPRT is running on the M3 by @cjus in #184
- Stage 21: the engine evaluates with an NNUE network when one is loaded by @cjus in #185
- Stage 21: the NNUE trainer trains on the GPU, through wgpu on Metal by @cjus in #186
- Stage 21: the GPU trainer prepares each batch on all the trainer's threads by @cjus in #188
- Stage 21: scripts/mac-nnue-data.sh makes the first net's data on the M3 and trains on it by @cjus in #189
- Larger reductions when the hash move is a capture, off the principal variation: failed, off by default by @cjus in #179
- CI: ci.yml loads again by @cjus in #192
- The GUI matrix passed: M4 (and M1) recorded; the book goes in v1.0.0 by @cjus in #193
- Version 1.0.0 by @cjus in #154
- Stage 21: mac-sprt.sh can give the engines NNUE networks, for net-vs-HCE SPRTs by @cjus in #194
- Stage 21: the first network, gen1 (SPRT: net vs HCE) by @cjus in #195
- Stage 21: the gen1 network is the default, built into every build by @cjus in #196
- Release: the robustness run with the network as the default was clean (#197) by @cjus in #200
- Release: add the book's line to SHA256SUMS.txt after uploading it by @cjus in #201
- Release: sign and notarise the Mac binaries (scripts/mac-sign-release.sh) by @cjus in #202
- Release testing: robustness runs with threads, and the testing pass before v1.0.0 by @cjus in #204
- Stage 21: small pawnless endings get the hand-crafted evaluation by @cjus in #208
- Release testing: 4-thread robustness clean, gauntlet 3236 ± 16 with the net by @cjus in #210
- README for v1.0.0, and the shell's elo help says 600-2500 by @cjus in #212
- gen2: the second networks' results, and the trainer's speed on the M3 Max by @cjus in #214
- gen2 as the built-in network, before v1.0.0 by @cjus in #216
Full Changelog: https://github.com/cjus/chessengine/commits/v1.0.0