ruicoelhopedro / pawn

An experimental UCI chess engine
GNU General Public License v3.0
10 stars 1 forks source link
chess uci-chess-engine

pawn

A UCI alpha-beta chess engine, largely inspired by Stockfish.

As with most UCI chess engines, pawn should be used with a compatible graphical user interface (such as CuteChess). It plays both standard chess and Chess960.

The engine uses an efficiently updatable neural network (NNUE) for evaluation. Currently, the net is shallow with a single 256-neuron layer and 4 output buckets (selected according to the number of pieces on the board). A separate set of PSQ tables is directly propagated to the output, which is also initialised using the material values of each piece. All training data has been generated in self-play at low depth using the tools in the branch data_gen. The training scripts can also be found in that branch, which use a PyTorch backend. The default network is embedded in the binary file with incbin.

Getting pawn

The latest official version can be downloaded in the Releases tab. Binaries for both Windows and Linux are available. For each platform, two 64-bit versions are provided: a generic version for most x86 processors (slower) and one with the instruction set from haswell (faster with BMI2, AVX2 and POPCNT, but may not be supported for older CPUs).

For the most up-to-date (and likely stronger) version, it is recommended to compile directly from sources for the target architecture, as described below.

Compiling from sources

To compile under Linux or Windows with MSYS2, simply call

make

in the root directory to generate an executable optimised for the building machine. The resulting binary and object files can be found in the build directory. Verify the signature of the binary by running the bench command and checking if the number of nodes searched matches the Bench field of the last commit message.

To compile generic binaries or to a specific architecture, use

make ARCH=target

where target is the target passed to -march=.

Progress

The progression of pawn in self-play since the first public version is illustrated in the table below. The ratings are computed with ordo (anchored at zero for the first commit and with errors relative to pool average) using the noob_3moves book under LTC conditions (single-thread with TC 60+0.6 and 64MB hash).

Date Commit Elo Error(+/-)
24/01/12 3.0 349.8 19.8
23/11/30 e276c44 296.8 19.7
23/10/31 795d3c0 288.2 19.5
23/10/06 2.0 235.2 15.2
23/08/31 5a5ea8a 169.9 15.8
23/06/30 b68c1df 163.4 15.7
23/04/24 c777eef 121.7 14.6
23/03/12 1.0 0.0 14.0
23/02/11 527fe63 -17.5 15.0
23/01/31 d7b26dc -36.5 15.0
22/12/20 ecf549f -226.0 14.2
22/11/18 c22a7e5 -240.1 13.8
22/10/06 567797f -360.4 14.3
22/09/23 132140b -370.2 16.9
22/08/30 25607d9 -404.3 17.1
22/07/30 638dc4c -463.1 17.5
22/06/27 069e93a -562.0 18.4
22/05/27 78c2f15 -755.4 19.6
22/04/27 5fd6e1d -1004.7 22.6
22/03/18 fa8e828 -1040.8 22.6
22/02/28 0a131bd -1062.2 22.7
21/10/29 61edb2a -1073.7 22.6
21/09/28 cadf61b -1193.2 24.8
21/08/31 056c448 -1387.1 30.4

UCI Options

The following UCI options are supported:

Furthermore, the following non-standard commands are available:

Main Features

Syzygy endgame tablebases

The Syzygy endgame tablebases support uses Fathom for probing the WDL and DTZ tables. Similarly to the original implementation in Stockfish, pawn has two modes of operation:

Board representation