]> git.sesse.net Git - stockfish/commit
Fishtest Tuning Framework
authorMarco Costalba <mcostalba@gmail.com>
Sat, 4 Apr 2015 06:54:15 +0000 (08:54 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sat, 2 May 2020 15:32:11 +0000 (17:32 +0200)
commitc527c3ad44f7465c79cef93f1e8cfebd998dc627
tree1b204143cca84f212efbe152cbb836143dd6c4be
parenteb4a124b8859a6029b61f403e0a9415fa748e4bd
Fishtest Tuning Framework

The purpose of the code is to allow developers to easily and flexibly
setup SF for a tuning session. Mainly you have just to remove 'const'
qualifiers from the variables you want to tune and flag them for
tuning, so if you have:

int myKing = 10;
Score myBonus = S(5, 15);
Value myValue[][2] = { { V(100), V(20) }, { V(7), V(78) } };

and at the end of the update you may want to call
a post update function:

void my_post_update();

If instead of default Option's min-max values,
you prefer your custom ones, returned by:

std::pair<int, int> my_range(int value)

Or you jus want to set the range directly, you can
simply add below:

TUNE(SetRange(my_range), myKing, SetRange(-200, 200), myBonus, myValue, my_post_update);

And all the magic happens :-)

At startup all the parameters are printed in a
format suitable to be copy-pasted in fishtest.

In case the post update function is slow and you have many
parameters to tune, you can add:

UPDATE_ON_LAST();

And the values update, including post update function call, will
be done only once, after the engine receives the last UCI option.
The last option is the one defined and created as the last one, so
this assumes that the GUI sends the options in the same order in
which have been defined.

closes https://github.com/official-stockfish/Stockfish/pull/2654

No functional change.
src/Makefile
src/main.cpp
src/tune.cpp [new file with mode: 0644]
src/tune.h [new file with mode: 0644]
src/types.h