When to do null move

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
jwes
Posts: 778
Joined: Sat Jul 01, 2006 5:11 am

When to do null move

Post by jwes » Sun Jun 05, 2016 4:58 am

I am trying to determine how to decide whether to try null move in a position. If I have done my math right, the formula is:

if (nF*pNFL/nN + f1 - f2 > 1) try null, where:

nN is the estimated number of node for a null move search.
nF is the estimated number of node for a full search.
pNFL is the estimated probability of the null move search causing a cutoff.
f1 is a fudge factor for the value of a null move search that does not cause a cutoff.
f2 is a fudge factor for the cost of a false positive.

Some plausible situations in which to avoid null move are:
Hash table says position failed low on the last ply.
Hash table says null move did not cause a cutoff on the last ply.
Depth remaining is 1.
Static evaluation or material is < alpha.
Static evaluation or material is < alpha and the last move was a capture (the probability of a cutoff is much lower if the last move was a capture).

One interesting situation is when depth remaining is 2 as the gain from a null move cutoff is much lower.

When null move was the major reduction, there was little point in spending much effort in avoiding null move as the gain was so large even a small probability of a cutoff made it worth trying. With all the other pruning and reduction that are commonly done now I do not know if that is still true.

Have people been looking at this and what has been found?

jdart
Posts: 3813
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

Re: When to do null move

Post by jdart » Sun Jun 05, 2016 2:51 pm

I don't think you can theoretically predict this very well. I think you have to try it and measure.

I do think based on experience that null move at depth == 2 is definitely beneficial.

--Jon

ZirconiumX
Posts: 1327
Joined: Sun Jul 17, 2011 9:14 am

Re: When to do null move

Post by ZirconiumX » Sun Jun 05, 2016 5:46 pm

jwes wrote:I am trying to determine how to decide whether to try null move in a position. If I have done my math right, the formula is:

if (nF*pNFL/nN + f1 - f2 > 1) try null, where:

nN is the estimated number of node for a null move search.
nF is the estimated number of node for a full search.
pNFL is the estimated probability of the null move search causing a cutoff.
f1 is a fudge factor for the value of a null move search that does not cause a cutoff.
f2 is a fudge factor for the cost of a false positive.

Some plausible situations in which to avoid null move are:
Hash table says position failed low on the last ply.
Hash table says null move did not cause a cutoff on the last ply.
Depth remaining is 1.
Static evaluation or material is < alpha.
Static evaluation or material is < alpha and the last move was a capture (the probability of a cutoff is much lower if the last move was a capture).

One interesting situation is when depth remaining is 2 as the gain from a null move cutoff is much lower.

When null move was the major reduction, there was little point in spending much effort in avoiding null move as the gain was so large even a small probability of a cutoff made it worth trying. With all the other pruning and reduction that are commonly done now I do not know if that is still true.

Have people been looking at this and what has been found?
You appear to missing the trivial "don't nullmove in check" case.

Matthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.

User avatar
hgm
Posts: 23604
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: When to do null move

Post by hgm » Sun Jun 05, 2016 8:19 pm

If Fairy-Max I do null move precisely for finding out whether I am in check. :lol:

jwes
Posts: 778
Joined: Sat Jul 01, 2006 5:11 am

Re: When to do null move

Post by jwes » Thu Jun 09, 2016 3:30 pm

jdart wrote:I don't think you can theoretically predict this very well. I think you have to try it and measure.

I do think based on experience that null move at depth == 2 is definitely beneficial.

--Jon
My point was more that there might be more gain in choosing when to do or not do null move at remaining depth 2.

Post Reply