Page 2 of 2

Re: compiling stockfish with more options

Posted: Mon Jan 14, 2019 6:02 am
by Rebel
syzygy wrote:
Sun Jan 13, 2019 1:03 pm
Rebel wrote:
Sun Jan 13, 2019 3:57 am
syzygy wrote:
Sun Jan 13, 2019 2:09 am
majkelnowaq wrote:
Sat Jan 12, 2019 7:21 pm
Here is my problem. I can add new tuning option just visually by adding something like "o["X"] << Option(100, 0, 100);" in ucioption.cpp but i cant actually connect it in proper way to some value. For example i want for "X" to change parameters in types.h file, we can say "QueenValueMg".
QueenValueMg is a compile-time constant. Compile-time constants cannot be changed at runtime.

You would have to turn QueenValueMg into a global variable. This is not trivial, since other places in Stockfish expect its value to be known at compile time. It would also slow Stockfish down a bit.
Actually QueenValueMg can be changed without loss of speed and change of code,
Not at runtime, as you seem to admit yourself.
The #define changes the constant during compilation, no loss of speed, no size change of the executable.

Re: compiling stockfish with more options

Posted: Mon Jan 14, 2019 5:14 pm
by mcostalba
You could use the 'tune' branch: https://github.com/official-stockfish/S ... /tree/tune

It has some code to allow automatic tuning of a variable in fishtest changing it's value at every game by means of an UCI option.

It has no slowdowns for non const parameters, and a possible small slow down for const ones because they should be converted to non-const for tune to work.

Read the comments in tune.h to get an idea of how to use it.