Chess variant stats

This project generates statistics for chess variants using Fairy-Stockfish and its python binding pyffish.


Generating statistics consists of the following steps:

  1. to generate a set of positions in FEN/EPD format from playing engine games. This step can be skipped if positions are extracted from other sources such as databases of human games.
  2. to fit piece values on the generated data using logistic regression.
  3. to identify endgames occuring in the generated positions and collect their result statistics.

Steps 2 and 3 are independent of each other, but they can be run on the same input data to save resources on generation.


The scripts require at least python3.2 as well as the dependencies from the requirements.txt. Install them using

pip3 install -r requirements.txt


A simple example of running the scripts is:

python3 --engine fairy-stockfish.exe --variant chess --book chess.epd --movetime 10 --count 1000 > test.epd
python3 test.epd
python3 test.epd --max-pieces 4

Run the scripts with -h to get help on the supported parameters.

For reliable results you usually need to generate at least 100k positions, or more depending on the number of pieces, imbalances, and game phases. As starting positions for the data generation (--book) you can either use pregenerated opening books or use the book generator yourself.


View Github