The #define changes the constant during compilation, no loss of speed, no size change of the executable.syzygy wrote: ↑Sun Jan 13, 2019 2:03 pmNot at runtime, as you seem to admit yourself.Rebel wrote: ↑Sun Jan 13, 2019 4:57 amActually QueenValueMg can be changed without loss of speed and change of code,syzygy wrote: ↑Sun Jan 13, 2019 3:09 amQueenValueMg is a compile-time constant. Compile-time constants cannot be changed at runtime.majkelnowaq wrote: ↑Sat Jan 12, 2019 8: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".
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.
compiling stockfish with more options
Moderators: hgm, Rebel, chrisw
-
- Posts: 6997
- Joined: Thu Aug 18, 2011 12:04 pm
- Full name: Ed Schröder
Re: compiling stockfish with more options
90% of coding is debugging, the other 10% is writing bugs.
-
- Posts: 2684
- Joined: Sat Jun 14, 2008 9:17 pm
Re: compiling stockfish with more options
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.
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.