Rethinking r in null move

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Rethinking r in null move

Post 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.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Rethinking r in null move

Post 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.
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: 1056
Joined: Fri Mar 10, 2006 6:07 am
Location: Basque Country (Spain)

Re: Rethinking r in null move

Post 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.
AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: Rethinking r in null move

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

Re: Rethinking r in null move

Post by flok »

Can this be applied for IID as well?
User avatar
pedrox
Posts: 1056
Joined: Fri Mar 10, 2006 6:07 am
Location: Basque Country (Spain)

Re: Rethinking r in null move

Post 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.
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Rethinking r in null move

Post 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.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through