Possible Glaurung 2.2 bug

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Gian-Carlo Pascutto
Posts: 1243
Joined: Sat Dec 13, 2008 7:00 pm

Possible Glaurung 2.2 bug

Post 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.
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: Possible Glaurung 2.2 bug

Post 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 :(
Joona Kiiski
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Possible Glaurung 2.2 bug

Post 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! */
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Possible Glaurung 2.2 bug

Post 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