Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: question for Bob Hyatt about iterate.c

Author: Matthew McKnight

Date: 07:49:40 11/26/03

Go up one level in this thread


On November 26, 2003 at 08:50:43, Matthias Gemuh wrote:

>On November 26, 2003 at 08:32:18, Matthew McKnight wrote:
>
>>On November 26, 2003 at 04:24:31, Matthias Gemuh wrote:
>>
>>>On November 26, 2003 at 00:53:50, Matthew McKnight wrote:
>>>
>>>>Hi Bob,
>>>>
>>>>iterate.c
>>>>
>>>>In the iterative deepening algorithm, where you adjust your alpha and beta
>>>>values for researching, i notice this fragment:
>>>>
>>>>
>>>>        else if (value <= root_alpha) {
>>>>   -----> if (!(root_moves[0].status&2)) {
>>>>            root_moves[0].status&=255-128;
>>>>            root_moves[0].nodes=0;
>>>>            root_moves[0].status|=1;
>>>>   ----->   if (root_moves[0].status&2) root_beta=MATE+1;
>>>>
>>>>            ..... //code omitted
>>>>          }
>>>>          else break;
>>>>        }
>>>>
>>>>I drew arrows to the lines in question.  Correct me if I'm wrong, but isn't this
>>>>a contradiction?  How will root_beta=MATE+1 ever be executed?  I'm looking for
>>>>ideas on adjusting alpha/beta at the root, as my current scheme seems poor.  Is
>>>>there something here I don't understand?
>>>>
>>>>Matt
>>>
>>>
>>>
>>>Hi Matt,
>>>the line  "root_moves[0].status&=255-128;" seems to make things possible,
>>>though I have not tried to understand this complex stuff.
>>>/Matt.
>>
>>255-128 = 127 (or 0x7F - all 1's), and-ing 127 to a number that we know has 0 in
>>the second bit, isn't going to change that bit.  Nor, is or-ing in a 1.  Maybe I
>>just can't see it?  Time to retire from chess programming?
>>
>>
>>Matt
>
>
>
>
>
>You have definitely found a Crafty bug !
>Looks like I should retire from chess programming again.
>
>/Matthias.

I'm not sure it's a bug, because everything may still work properly, it just
looks like some code that will never be executed.

Matt



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.