Stockfish's "centipawn" evaluation is decoupled from the classical value of a pawn, and is calibrated such that an advantage of "100 centipawns" means the engine has a 50% probability to win from this position in selfplay at fishtest LTC time control.
To update Stockfish's internal WDL model, the following steps are needed:
-
Obtain a large collection of engine-vs-engine games (at fishtest LTC time control) in pgn format and save the pgn files in the
pgns
folder. This can, for example, be achieved by runningpython download_fishtest_pgns.py --path pgns
once a day. -
Use
make
to compilescoreWDLstat.cpp
, which will produce an executable namedscoreWDLstat
. -
Run
scoreWDLstat
to parse the pgn files in thepgns
folder. A different directory can be specified withscoreWDLstat --dir <path-to-dir>
. The computed WDL statistics will be stored in a file calledscoreWDLstat.json
. The file will have entries of the form"('D', 1, 78, 35)": 668132
, meaning this tuple for(outcome, move, material, eval)
was seen a total of 668132 times in the processed pgn files. -
Run
python scoreWDL.py
to compute the WDL model parameters from the data stored inscoreWDLstat.json
. The script needs as input the value--NormalizeToPawnValue
from within Stockfish'suci.h
, to be able to correctly convert the centipawn values from the pgn files to the unit internally used by the engine. The script will output the new values forNormalizeToPawnValue
inuci.h
andas[]
,bs[]
inuci.cpp
. See e.g. official-stockfish/Stockfish#4373
Other scripts that can be used to visualize different WDL data:
scoreWDLana_moves.py
: similar toscoreWDL.py
, analyze wrt to movesscoreWDLana_material.py
: similar toscoreWDL.py
, analyze wrt to material