Null move in TT

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

lauriet
Posts: 199
Joined: Sun Nov 03, 2013 9:32 am

Null move in TT

Post by lauriet »

Null move causes a beta cut.
Can I save anything to the TT ?
What move could you save ?
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Null move in TT

Post by bob »

"zero" (or whatever you use for the null move. You can't get a best move for fail low positions, so you should already handle this for all fail-low positions. For the others, just stick in the "null move" and results. If you encounter this position again, you'd prefer to get the same result from the TT entry rather than having to a null-move search again...

Remember this golden rule. ANYTIME you get a useful result from any sort of search, store that in the TT. If you reach the same position with sufficient depth again, why would you not want to just use the result rather than expending effort. This applies to ANY type of position you reach and produce a useful result.
AndrewGrant
Posts: 1752
Joined: Tue Apr 19, 2016 6:08 am
Location: U.S.A
Full name: Andrew Grant

Re: Null move in TT

Post by AndrewGrant »

lauriet wrote: Thu May 14, 2020 2:17 am Null move causes a beta cut.
Can I save anything to the TT ?
What move could you save ?
I'm not a big fan of saving the results of pruning methods into the table. I prefer to leave open the possibility that if the position is seen again, that either the search will again confirm the prune, or possibly changes in the TT, or in the history scores, or in killers/counter moves, will cause the prune to fail.
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Null move in TT

Post by Henk »

bob wrote: Thu May 14, 2020 3:59 am "zero" (or whatever you use for the null move. You can't get a best move for fail low positions, so you should already handle this for all fail-low positions. For the others, just stick in the "null move" and results. If you encounter this position again, you'd prefer to get the same result from the TT entry rather than having to a null-move search again...

Remember this golden rule. ANYTIME you get a useful result from any sort of search, store that in the TT. If you reach the same position with sufficient depth again, why would you not want to just use the result rather than expending effort. This applies to ANY type of position you reach and produce a useful result.
best move makes no sense for chess because it uses statistics and an ill defined horizon. So best move is best statistical move or best subjective move.

Don't understand why there would be a 'best move' when failing high. Especially when upperbound of the search window has a low value. In that case best move is only one of possibly many 'refuting moves'.

O wait it is just a way of speeding up the search.
mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Re: Null move in TT

Post by mjlef »

lauriet wrote: Thu May 14, 2020 2:17 am Null move causes a beta cut.
Can I save anything to the TT ?
What move could you save ?
You can store it, but at some risk. It would be stored with a value of beta or maybe they null move search result which could be much higher, and as a lower bound. The risk is that if a new beta comes along due to a change at the root of alpha, assuming it will still fail high. All the strong programs rose a lot of moves and can miss things. So just run a lot of games and tune as needed
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Null move in TT

Post by bob »

How is there a risk? A null move failed at the current position with some depth remaining (draft) value.

You get to the same position later, with either the same (or lower) draft. Why would the current position not do EXACTLY the same thing as the previous identical position? Unless you have a bug.

As far as which move to save, save "no move". The null failed high previously. If it fails high now, you are already done and need no "best move." If it doesn't fail high, then you have no suggested move to try, so move on to your primary search ordering strategy...
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Null move in TT

Post by hgm »

You can just make the move in the TT entry 'invalid'. If the draft of the entry was not enough for a hash cutoff, the search would start with a null-move anyway. So there is no need to tell any prober that he has to start searching a null move first.

In fact you can detect the case by the fact that the score was a lower bound, but you had no hash move. If you have no move because of a fail low you would have had an upper bound.

If you normally would not try null move when eval < beta, you could still force the null move when the TT score lower-bound is above beta.