Possible Glaurung 2.2 bug

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

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
Gian-Carlo Pascutto
Posts: 1166
Joined: Sat Dec 13, 2008 6:00 pm
Contact:

Possible Glaurung 2.2 bug

Post by Gian-Carlo Pascutto » Fri Mar 27, 2009 7:32 pm

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 6:03 am

Re: Possible Glaurung 2.2 bug

Post by zamar » Sat Mar 28, 2009 6:26 am

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: 5593
Joined: Mon Jan 08, 2007 11:31 pm
Location: PA USA
Full name: Louis Zulli

Re: Possible Glaurung 2.2 bug

Post by zullil » Sat Mar 28, 2009 10:03 am

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 8:19 pm
Location: Oslo, Norway

Re: Possible Glaurung 2.2 bug

Post by Tord Romstad » Sat Mar 28, 2009 11:09 am

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

Post Reply