Rethinking r in 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
Michael Sherwin
Posts: 3041
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

Rethinking r in null move

Post by Michael Sherwin » Fri Aug 18, 2017 9:42 pm

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.

Dann Corbit
Posts: 9977
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Rethinking r in null move

Post by Dann Corbit » Fri Aug 18, 2017 10:54 pm

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.
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.

User avatar
pedrox
Posts: 991
Joined: Fri Mar 10, 2006 5:07 am
Location: Basque Country (Spain)
Contact:

Re: Rethinking r in null move

Post by pedrox » Sat Aug 19, 2017 9:12 am

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.

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

Re: Rethinking r in null move

Post by AlvaroBegue » Sat Aug 19, 2017 10:39 am

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.

flok

Re: Rethinking r in null move

Post by flok » Sat Aug 19, 2017 11:03 pm

Can this be applied for IID as well?

User avatar
pedrox
Posts: 991
Joined: Fri Mar 10, 2006 5:07 am
Location: Basque Country (Spain)
Contact:

Re: Rethinking r in null move

Post by pedrox » Mon Aug 21, 2017 3:51 am

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.

Michael Sherwin
Posts: 3041
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Rethinking r in null move

Post by Michael Sherwin » Tue Aug 22, 2017 11:57 am

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.
I hate if statements. Pawns demand if statements. Therefore I hate pawns.

Post Reply