compiling stockfish with more options

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
Posts: 5786
Joined: Thu Aug 18, 2011 10:04 am

Re: compiling stockfish with more options

Post by Rebel » Mon Jan 14, 2019 6:02 am

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.
90% of coding is debugging, the other 10% is writing bugs.

Posts: 2684
Joined: Sat Jun 14, 2008 7:17 pm

Re: compiling stockfish with more options

Post by mcostalba » Mon Jan 14, 2019 5:14 pm

You could use the 'tune' branch: ... /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.

Post Reply