Update Best Score and Best Move

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: Update Best Score and Best Move

Post by AlvaroBegue »

Sven Schüle wrote:Updating the best move should only happen if the new score is inside the window, i.e. alpha < Score < beta. When failing low or high there is no best move.
That doesn't seem right. If a move produces a beta cut, I would say it's a good move, and I think it would be reasonable to try it first next time we look at this position.

Do you only store a hash move in PV nodes?
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Update Best Score and Best Move

Post by hgm »

Indeed, any move scoring above alpha should become bestMove / hash move.

This might just be an issue of naming things, though: 'bestMove' is not really the best move of the position, it is just the best move so far. It would only be the best move after all moves are searched, which would never happen during a beta cutoff. But a cut move is a cut move, and even if you cannot guarantee it is the best move, you would want to try it first next time, as it is likely to cut again. So you would store it as hash move, and you would sort it to front of the move list for a next IID pass.

BTW, there is an interesting issue here, which is usually ignored: if we get a hash move from a hash hit on a position with a lower bound that is grossly inadequate for the current value of beta, it is in fact not so likely that this move will be able to cut again. It could be better to find a new hash move that can at low depth first (i.e. start IID) rather than searching that hash move at full depth (likely wasting the time, and being committed to find an alternative at high depth as well).
tomitank
Posts: 276
Joined: Sat Mar 04, 2017 12:24 pm
Location: Hungary

Re: Update Best Score and Best Move

Post by tomitank »

Also at root node "for UCI best move" the hash is good or better from alpha < Score < beta?

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

Re: Update Best Score and Best Move

Post by Sven »

I was not talking about storing a hash move. My point was more about updating the local PV or not.