/Smallbrain

A UCI chess engine written in C++

Primary LanguageC++GNU General Public License v3.0GPL-3.0

Smallbrain

History

During the pandemic I rediscovered chess and played a lot of games with my friends.
Then I started to program my first engine python-smallbrain in python, with the help of python-chess.

I quickly realized how slow python is for chess engine programming, so I started to learn C++.
My first try was cppsmallbrain, though after some time I found the code very buggy and ugly.
So I started Smallbrain from scratch, during that time, I also joined Stockfish development.

After some time I began implementing a NNUE into Smallbrain, with the help of Luecx from Koivisto.
As of now Smallbrain has a NNUE trained on 500m depth 9 fens generated with the built in data generator and using CudAD trainer to ultimately train the network.

News

The latest development version support for FRC has been added, the neural network has been retrained
with additional FRC data while being on par in classical.

Compile

Compile it using the Makefile in ./src

make
.\smallbrain.exe bench

compare the Bench with the Bench in the commit messages, they should be the same.

or download the latest the latest executable directly over Github.
At the bottom you should be able to find multiple different compiles, choose one that doesnt crash.

Ordered by performance you should try x86-64-avx2 first then x86-64-modern and at last x86-64.

Elo

Name Elo + -
Smallbrain 6.0 4CPU 3309 +24 −23
Smallbrain 6.0 3227 +23 −23
Smallbrain 5.0 4CPU 3211 +23 −23
Smallbrain 5.0 3137 +20 −20
Smallbrain 4.0 2978 +25 −25
Smallbrain 2.0 2277 +28 −29
Smallbrain 1.1 2224 +29 −30
Name Elo + -
Smallbrain 6.0 3336 +18 −18
Smallbrain 5.0 3199 +18 −18
Smallbrain 4.0 3005 +18 −18
Smallbrain 3.0 2921 +20 −20
Smallbrain 1.1 2174 +20 −20
no Program Elo + - Games Score Av.Op. Draws
34 Smallbrain 6.0 avx2 3345 7 7 9000 52.1% 3331 49.9%
no Program Elo + - Games Score Av.Op. Draws
271 Smallbrain 6.0NN x64 1CPU 3203 16 16 1300 42.8% 3258 51.2%

UCI settings

  • Hash
    The size of the hash table in MB.

  • Threads
    The number of threads used for search.

  • EvalFile
    The neural net used for the evaluation,
    currently only default.nnue exist.

  • SyzygyPath
    Path to the syzygy files.

Engine specific commands

  • go perft <depth>
    calculates perft from a set position up to depth.

  • print
    prints the current board

  • captures
    prints all legal captures for a set position.

  • moves
    prints all legal moves for a set position.

  • rep
    checks for threefold repetition in a position

  • eval
    prints the evaluation of the board.

  • perft
    tests all perft position.

Features

  • Evaluation
    • As of v6.0 the NNUE training dataset was regenerated using depth 9 selfplay games + random 8 piece combinations.

Datageneration

* .\smallbrain.exe -gen -threads \<int> -book \<path/to/book> -tb \<path/to/tb> -depth \<int>
  • Example:
.\smallbrain.exe -gen -threads 30 -book E:\Github\Smallbrain\src\data\DFRC_openings.epd -tb E:/Chess/345
.\smallbrain.exe -gen -threads 30 -tb E:/Chess/345