v2.0.0
934 lines of C99
Strength & Performance
v2.0.0 is estimated at ~3100 Elo, a gigachadeous leap of +368 Elo over v1.4.1 (~2750 Elo).
SPRT test vs. v1.4.1 (8+0.08, 16MB hash, UHO_Lichess_4852_v1.epd):
Elo: 368.72 +/- 48.50, nElo: 561.23 +/- 37.37
LOS: 100.00 %, DrawRatio: 6.02 %, PairsRatio: 51.00
Games: 332, Wins: 272, Losses: 11, Draws: 49, Points: 296.5 (89.31 %)
Ptnml(0-2): [0, 3, 10, 42, 111], WL/DD Ratio: 4.00
LLR: 2.96 (100.6%) (-2.94, 2.94) [0.00, 5.00]
Fixed 1000 STC Games against Potential 3.0.0 (8+0.08s - 64MB Hash)
Score of Chal 2.0.0 vs Potential 3.0.0: 591 - 190 - 219 [0.701]
... Chal 2.0.0 playing White: 324 - 80 - 96 [0.744] 500
... Chal 2.0.0 playing Black: 267 - 110 - 123 [0.657] 500
... White vs Black: 434 - 347 - 219 [0.543] 1000
Elo difference: 147.6 +/- 20.2, LOS: 100.0 %, DrawRatio: 21.9 %
SPRT: llr 0 (0.0%), lbound -inf, ubound inf
1000 of 1000 games finished.
- Speed: ~4M NPS (up from ~800k NPS in v1.4.1 5x speedup)
- Architecture: Complete transition from 0x88 HCE to Magic Bitboards and toy NNUE network (768 → 32 → 1) trained on selfplay data of 1.4.1 HCE
- LOC: 934 lines of code (excluding comments/whitespace) which is 65 lines fewer than the 999 LOC of the 0x88 engine, while incorporating bitboard magic tables and neural SIMD evaluation.
Notes
It has been 5 months of sleepless nights, endless debugging, and relentless rewriting to reach this point.
When I released v1.4.1 at 999 lines, I was exhausted. I wrote that cutting lines to compensate for strength code was starting to feel like a fight against the soul of the project, and I worried it would take a very long time before I could figure out how to take the next step without compromising what Chal is.
Bitboards and neural networks usually mean one thing in chess programming: a lot of code. Most bitboard engines with NNUE run anywhere from 8k lines of code or more. Everything fights against brevity.
Chal v2.0.0 is the answer to that challenge.
Not only did I make the leap to magic bitboards and NNUE but doing it in 934 lines of C code even fewer lines than our old 0x88 engine. And we didn't sacrifice readability a lot to do it. The entire engine is still laid out linearly across 8 sections, written to be read top-to-bottom like a textbook.
Going from 800k NPS to 4 MNPS while gaining hundreds of Elo and shrinking the codebase is probably the single most rewarding thing I've accomplished in my entire journey till now.
Thank you to the chess programming community for the constant inspiration, and to the CCRL testers (Gabor, Andres, and Graham) for your time and dedication in tracking engines like Chal.
And once again, my deepest gratitude to nescitus (Pawel Koziol). You have been here as a mentor, and friend through every milestone. This milestone belongs to you just as much as it does to me.