out of time in PVS

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: out of time in PVS

Post by Sven »

RubiChess wrote: Sat Dec 15, 2018 7:56 am
Sven wrote: Sat Dec 15, 2018 1:15 am
RubiChess wrote: Fri Dec 14, 2018 7:31 pm I return alpha immediately without storing to TT.
This should just throw away all unfinished searches.
Do you also use a flag indicating that the search is being stopped? If you don't then just returning alpha on detecting a timeout might be wrong since the direct parent node negates the score and performs a beta cutoff but then the parent's parent just continues with the next move after noticing that its current move has been refuted.
Yes, I have a global flag "IMMEDIATESTOP" that lets every parent node just return its alpha.
Even if the parent node is the root node? In Jumbo I only break from the move loop at root when my 'stopSearch' flag is set, so that I do not ignore the results of the current iteration that were obtained so far. Returning alpha also at root would skip the whole iteration.
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: out of time in PVS

Post by jwes »

elcabesa wrote: Thu Dec 13, 2018 7:28 pm One usually stop the PVS search and use the result of the previous finished iterative deepening result.
Remember that after you decide to stop the search you have also to stop saving killers, sving info to transposition tables and so on.
One thing that has not been mentioned is that if the best move of the previous iteration fails low and you have not yet found a satisfactory alternative, doing this may just lose. Adding time and continuing to search is a partial solution to this.
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: out of time in PVS

Post by Ras »

jwes wrote: Sat Dec 15, 2018 11:26 pmOne thing that has not been mentioned is that if the best move of the previous iteration fails low and you have not yet found a satisfactory alternative, doing this may just lose. Adding time and continuing to search is a partial solution to this.
Usually, when you fail seriously low, trying to recover is a case of "too little, too late".
Rasmus Althoff
https://www.ct800.net
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: out of time in PVS

Post by JVMerlino »

Ras wrote: Sun Dec 16, 2018 12:05 am
jwes wrote: Sat Dec 15, 2018 11:26 pmOne thing that has not been mentioned is that if the best move of the previous iteration fails low and you have not yet found a satisfactory alternative, doing this may just lose. Adding time and continuing to search is a partial solution to this.
Usually, when you fail seriously low, trying to recover is a case of "too little, too late".
Probably, but you have to at least try. :)

I'm not sure that only breaking out of the search at the root is the best idea, although it would make things A LOT cleaner to code. But it also sounds like a really good way to get into time pressure. Myrddin's time management was created somewhat arbitrarily, but the only concession I made to root moves was to ensure that I had at least completed searching the first move in an iteration. After that, it's possible to break out at any time.
RubiChess
Posts: 584
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: out of time in PVS

Post by RubiChess »

Sven wrote: Sat Dec 15, 2018 8:48 pm
RubiChess wrote: Sat Dec 15, 2018 7:56 am Yes, I have a global flag "IMMEDIATESTOP" that lets every parent node just return its alpha.
Even if the parent node is the root node? In Jumbo I only break from the move loop at root when my 'stopSearch' flag is set, so that I do not ignore the results of the current iteration that were obtained so far. Returning alpha also at root would skip the whole iteration.
You are right, root search is different and keeps the best move and score found so far.

Andreas