Rethinking r in null move
Moderators: hgm, Harvey Williamson, bob
Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.

 Posts: 3041
 Joined: Fri May 26, 2006 1:00 am
 Location: WY, USA
 Full name: Michael Sherwin
Rethinking r in null move
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.
I hate if statements. Pawns demand if statements. Therefore I hate pawns.

 Posts: 9977
 Joined: Wed Mar 08, 2006 7:57 pm
 Location: Redmond, WA USA
 Contact:
Re: Rethinking r in null move
Look at how Stockfish does it. It is possible in some cases to get a very large reduction.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.
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.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Re: Rethinking r in null move
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 3040 Elo.
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 3040 Elo.

 Posts: 919
 Joined: Tue Mar 09, 2010 2:46 pm
 Location: New York
 Full name: Álvaro Begué (RuyDos)
Re: Rethinking r in null move
I am using r = 3 + depth / 8, after quite a bit of testing.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 3040 Elo.
Re: Rethinking r in null move
I have not had much success with the IID, but I have seen that in pv_nodes it is normally searched with depth2 and if it is not a pv_node it can be searched with a greater reduction like depth/4 or depth/2.flok wrote:Can this be applied for IID as well?

 Posts: 3041
 Joined: Fri May 26, 2006 1:00 am
 Location: WY, USA
 Full name: Michael Sherwin
Re: Rethinking r in null move
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.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 3040 Elo.
I hate if statements. Pawns demand if statements. Therefore I hate pawns.