Page 1 of 1

Rethinking r in null move

Posted: Fri Aug 18, 2017 11:42 pm
by Michael Sherwin
When engines were searching only 9 moves deep r = 2 (depth - 1 -r) was best. Then engines started searching deeper and smooth scaling r was invented. When r was only 2, null move searches at depth < 4 were basically qSearch only and it worked just fine. Somehow we got it in our heads that we should not exceed that for some reason. I've been testing with a static r value of 4 and greater. I have new best results for my program. I am now looking into setting r based on the iteration depth and not changing it during the iteration.

Re: Rethinking r in null move

Posted: Sat Aug 19, 2017 12:54 am
by Dann Corbit
Michael Sherwin wrote:When engines were searching only 9 moves deep r = 2 (depth - 1 -r) was best. Then engines started searching deeper and smooth scaling r was invented. When r was only 2, null move searches at depth < 4 were basically qSearch only and it worked just fine. Somehow we got it in our heads that we should not exceed that for some reason. I've been testing with a static r value of 4 and greater. I have new best results for my program. I am now looking into setting r based on the iteration depth and not changing it during the iteration.
Look at how Stockfish does it. It is possible in some cases to get a very large reduction.

It is part of why Stockfish has such a great branching factor.

The old tests were simple. New factors have been added such as current depth (mentioned by you above) and also the score of the current considered move compared to the pv node.

Re: Rethinking r in null move

Posted: Sat Aug 19, 2017 11:12 am
by pedrox
In 2005 or earlier, I remember that Sjeng (?) used a higher value for r with the following formula:

R = 2 + (depth> 6) + (depth> 11)

With greater depths r can be increased, for example:

R = 2 + (depth> 6) + (depth> 11) + (depth> 16) + (depth> 21) ...

At least if we are not at the end we can increase r by at least 1.

So in this case r could have a value of 7 for depths greater than 21. With this formula I have the impression of gaining about 30 Elo points compared to the traditional 2 or 3, although I have not tested well and gain some ply of depth, 1 or maybe 2 and also seems to solve better tactical positions.

I think that today there are people who use something like r = 3 + depth / 4. I think that with that formula I get slightly worse results.

I tried something extreme liket r = 3 + depth / 2. Tactically works great, but I lose 30-40 Elo.

Re: Rethinking r in null move

Posted: Sat Aug 19, 2017 12:39 pm
by AlvaroBegue
pedrox wrote:In 2005 or earlier, I remember that Sjeng (?) used a higher value for r with the following formula:

R = 2 + (depth> 6) + (depth> 11)

With greater depths r can be increased, for example:

R = 2 + (depth> 6) + (depth> 11) + (depth> 16) + (depth> 21) ...

At least if we are not at the end we can increase r by at least 1.

So in this case r could have a value of 7 for depths greater than 21. With this formula I have the impression of gaining about 30 Elo points compared to the traditional 2 or 3, although I have not tested well and gain some ply of depth, 1 or maybe 2 and also seems to solve better tactical positions.

I think that today there are people who use something like r = 3 + depth / 4. I think that with that formula I get slightly worse results.

I tried something extreme liket r = 3 + depth / 2. Tactically works great, but I lose 30-40 Elo.
I am using r = 3 + depth / 8, after quite a bit of testing.

Re: Rethinking r in null move

Posted: Sun Aug 20, 2017 1:03 am
by flok
Can this be applied for IID as well?

Re: Rethinking r in null move

Posted: Mon Aug 21, 2017 5:51 am
by pedrox
flok wrote:Can this be applied for IID as well?
I have not had much success with the IID, but I have seen that in pv_nodes it is normally searched with depth-2 and if it is not a pv_node it can be searched with a greater reduction like depth/4 or depth/2.

Re: Rethinking r in null move

Posted: Tue Aug 22, 2017 1:57 pm
by Michael Sherwin
pedrox wrote:In 2005 or earlier, I remember that Sjeng (?) used a higher value for r with the following formula:

R = 2 + (depth> 6) + (depth> 11)

With greater depths r can be increased, for example:

R = 2 + (depth> 6) + (depth> 11) + (depth> 16) + (depth> 21) ...

At least if we are not at the end we can increase r by at least 1.

So in this case r could have a value of 7 for depths greater than 21. With this formula I have the impression of gaining about 30 Elo points compared to the traditional 2 or 3, although I have not tested well and gain some ply of depth, 1 or maybe 2 and also seems to solve better tactical positions.

I think that today there are people who use something like r = 3 + depth / 4. I think that with that formula I get slightly worse results.

I tried something extreme liket r = 3 + depth / 2. Tactically works great, but I lose 30-40 Elo.
After lots of testing RomiChess P3m (that has just been released) just uses a straight depth - 5 for null move searches. My premise that I was trying to substantiate is that -3 and -4 are not needed intermediaries. Depth - 3 was best for 8 and 9 ply searchers and depth - 5 seems to be best for RomiChess that is now roughly a 20 ply searcher at 40/40. Stockfish may can use just a straight depth - 6 or depth - 7. I don't really know. It just made sense to me so I tried it and it was better than all the depth/n variations.