Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Researching after a deep fail low

Author: José Carlos

Date: 08:45:22 09/25/01

Go up one level in this thread


On September 24, 2001 at 16:27:37, Robert Hyatt wrote:

>On September 24, 2001 at 15:24:53, José Carlos wrote:
>
>>  First, the context:
>>
>>  Last night I finished implementing pondering for the first time. As usual, I
>>chose the easyest way to begin with, until I make sure I understand everything.
>>  So I did it this way: after moving, I guess the opponent move (second of the
>>pv), make it, and start thinking. When the opponent's move arrives, I unmake the
>>guessed move, make the real move, and start thinking normally. I expected the
>>program to get to the pondering depth due to the info in the hash table.
>>  This worked fine most of the time, but when the ponder search failed low deep,
>>the research didn't go straight to that point. Instead, it chose another move at
>>the begginning (because it saw the bad move in the hash table) and went
>>deepening slowly.
>>  I was very disapointed with this behavior, but when I started playing on ICC,
>>I saw a big rating increase. Actually, the explained behaviour turned out to
>>work really good, as usually the program made a good move even with less depth.
>>
>>  Now the question:
>>
>>  Has this been tried in _normal_ search? I mean, restarting from the begginning
>>after a deep fail low.
>>  Is this it a mistake to do what I'm doing? If so, what are the drawbacks?
>>
>>  Thanks in advance,
>>
>>  José C.
>
>
>I don't do it this way.  But there is a reasonable point for doing it that
>way.
>
>If you fail low, you can keep going to resolve the score and then try to improve
>it.  Or you can start the search over, knowing that the deep fail low score will
>stick around, and force you to find a different move at the root and iterate
>down through the depths on it as well.  If it fails low, you can continue this
>if you want.
>
>I simply remember the assumed move for pondering, and if the opponent makes this
>move, I just turn off the "pondering" flag, set the "start search time" to right
>_now_ and keep searching.  I set this start time so that I can later figure out
>how much time to take off my clock and how much time to take off the opponent's
>clock.  I use the total ponder + search time in the decision on when to stop
>the search due to time limit...

  Eventually, I'll try to do it the way you do. It's a matter of time, that I
need to get used to pondering tricks.
  The reason why I implemented that way was related to the execution flow. I
mean: I have an infinite loop, which calls ParseCommand() again and again.
  ParseCommand() reads a move from the opponent. If not in force mode, Think()
is called. When time is over, Think() returns, the move is printed, the time
adjusted, etc. Then, if pondering is enabled, the program switchs to ponder
mode, makes the guessed move, and calls search. When something is detected on
the keyboard (the search knows we are in ponder mode), the search is stopped.
  Then, ParseCommand() exists, and the infinite loop calls it again, which
allows to read the stdin, parse the move and, as the ponder flag is still
active, the programs knows it has to unmake the guessed move, and make the real
move. And then start thinking again...
  This is the better way I was able to figure out to keep things simple.
  I thought of a way to parse the opponent move without stopping the search but
failed to find a good way to implement. IE if I parse the move during the ponder
search, and I notice it is equal to the guessed move, and change the flag to
normal search (adjusting time as you discribed), when I finish thinking, I'll go
back to ParseCommand() just after the call to ponder, and then I must guess
another move and start pondering again. For avoiding infinite recursive calls to
ParseCommand(), I'd need to return to the loop so that it calls ParseCommand()
and then have a flag to know I must guess a move and start pondering until a
move comes :) I know this sounds messy.
  And if I didn't guess the move right, I have to stop and start thinking again.
So, when I go back to ParseCommand() I need a way to know if I should call
Think() again, or start pondering the next move.
  Sure this could be made in a much more simple/smarter way. The above is just
my brain-damage when I tried to figure out how to implement pondering. :)

  José C.



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.