Page 1 of 1

Possible Glaurung 2.2 bug

Posted: Fri Mar 27, 2009 7:32 pm
by Gian-Carlo Pascutto
search.cpp:

Code: Select all

  Depth CheckExtension[2] = {OnePly, OnePly};
  Depth SingleReplyExtension[2] = {OnePly / 2, OnePly / 2};

ucioption.cpp

Code: Select all

    { "Check Extension (PV nodes)", "2", "2", SPIN, 0, 2, {""} },
    { "Check Extension (non-PV nodes)", "1", "1", SPIN, 0, 2, {""} },
    { "Single Reply Extension (PV nodes)", "2", "2", SPIN, 0, 2, {""} },
    { "Single Reply Extension (non-PV nodes)", "2", "2", SPIN, 0, 2, {""} },
I think that what "uci" is reporting as the defaults aren't really the defaults.

Re: Possible Glaurung 2.2 bug

Posted: Sat Mar 28, 2009 6:26 am
by zamar
I was mislead by the same thing when I started to examine Glaurung's source. However the answer is trivial. Ucioptions shall always (whether they are modified by user or not) override the ones hardcoded in source.

The bad thing here is that people examining source for first time almost certainly read wrong values for the default extensions :(

Re: Possible Glaurung 2.2 bug

Posted: Sat Mar 28, 2009 10:03 am
by zullil
zamar wrote:I was mislead by the same thing when I started to examine Glaurung's source. However the answer is trivial. Ucioptions shall always (whether they are modified by user or not) override the ones hardcoded in source.

The bad thing here is that people examining source for first time almost certainly read wrong values for the default extensions :(

Code: Select all

/* Source code can include comments! */

Re: Possible Glaurung 2.2 bug

Posted: Sat Mar 28, 2009 11:09 am
by Tord Romstad
Gian-Carlo Pascutto wrote:search.cpp:

Code: Select all

  Depth CheckExtension[2] = {OnePly, OnePly};
  Depth SingleReplyExtension[2] = {OnePly / 2, OnePly / 2};

ucioption.cpp

Code: Select all

    { "Check Extension (PV nodes)", "2", "2", SPIN, 0, 2, {""} },
    { "Check Extension (non-PV nodes)", "1", "1", SPIN, 0, 2, {""} },
    { "Single Reply Extension (PV nodes)", "2", "2", SPIN, 0, 2, {""} },
    { "Single Reply Extension (non-PV nodes)", "2", "2", SPIN, 0, 2, {""} },
I think that what "uci" is reporting as the defaults aren't really the defaults.
Hi Gian-Carlo,

Joona is right: The values of the UCI options always override the default values of the variables in search.cpp. Sometimes I am just too lazy to update both places. In one sense, this isn't a bug, because the program uses the default values I intend for the above extensions. From another perspective, it is a bug, because readability of the code for new users is just as important as how the program plays.

I should probably fix this somehow. Just changing the initial values of the variables in search.cpp would be easy, but in that case I would certainly make a similar mistake some time in the future. It's probably better to just leave the variables uninitialized in search.cpp, and add a comment explaining that they are read from UCI parameters.

Thanks for pointing this out!

Tord