Figuring out the R factor

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

Figuring out the R factor

Post by Michael Sherwin »

Of course R stands for the extra Null Move Reduction.

R = 3 is better than R = 2 because at R = 3 an extra ply of depth is searched enough times during the course of a game to make it worthwhile.

R = 4 is not better than R = 3 because an extra ply is not reached often enough.

R = 5 may be better than R = 3 if an extra ply is reached often enough. I am testing that now. It is searching an extra ply most of the time.
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
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Figuring out the R factor

Post by Don »

Michael Sherwin wrote:Of course R stands for the extra Null Move Reduction.

R = 3 is better than R = 2 because at R = 3 an extra ply of depth is searched enough times during the course of a game to make it worthwhile.

R = 4 is not better than R = 3 because an extra ply is not reached often enough.

R = 5 may be better than R = 3 if an extra ply is reached often enough. I am testing that now. It is searching an extra ply most of the time.
I don't think it really works that way. If you get a 5% speedup in your program you can measure the strength increase. And the strength increase is quite smooth as you increase the time.

You seem to be saying that unless you can search an extra ply most of the time you won't get much strength boost but that's not true.

Back in the old days of computer chess I received some insight into why a small speedup, say 10%, is quite measurable. In a tournament my program was playing in there were 3 times the program nearly blundered one particular game away and each time it changed it's move just seconds before the timeout. I remember thinking each time that if my program was 5 or 10 percent slower it would have lost.

That was probably a very unusual situation, being 10 percent slower would not make every win a loss of course. But it happens so often that I know that even a small speedup would impact at least 1 game every few.
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Figuring out the R factor

Post by mcostalba »

Don wrote: That was probably a very unusual situation, being 10 percent slower would not make every win a loss of course. But it happens so often that I know that even a small speedup would impact at least 1 game every few.
10 percent slower is about 10 ELO points less, at least that's what I've been told.

All the other consequences, if any, belongs to that.
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Figuring out the R factor

Post by Michael Sherwin »

Don wrote:
Michael Sherwin wrote:Of course R stands for the extra Null Move Reduction.

R = 3 is better than R = 2 because at R = 3 an extra ply of depth is searched enough times during the course of a game to make it worthwhile.

R = 4 is not better than R = 3 because an extra ply is not reached often enough.

R = 5 may be better than R = 3 if an extra ply is reached often enough. I am testing that now. It is searching an extra ply most of the time.
I don't think it really works that way. If you get a 5% speedup in your program you can measure the strength increase. And the strength increase is quite smooth as you increase the time.

You seem to be saying that unless you can search an extra ply most of the time you won't get much strength boost but that's not true.

Back in the old days of computer chess I received some insight into why a small speedup, say 10%, is quite measurable. In a tournament my program was playing in there were 3 times the program nearly blundered one particular game away and each time it changed it's move just seconds before the timeout. I remember thinking each time that if my program was 5 or 10 percent slower it would have lost.

That was probably a very unusual situation, being 10 percent slower would not make every win a loss of course. But it happens so often that I know that even a small speedup would impact at least 1 game every few.
That R = 4 is worse than R = 3 is a given. That R = 4 misses more tactics than R = 3 is obvious. If R = 4 searched a ply deeper every time than R = 3 then the program would probably be stronger. My observation is that R = 4 does not search deeper (at least not enough to be effective). R = 5 gets an extra ply deep over R = 3 most of the time. Therefore R = 5 has something to recommend it despite that it would miss more tactics than R = 4.

I am just trying to find the 'gold' in Dann's R mine. As depth increases in Dann's formula maybe some R values should be skipped in the progression.
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
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Figuring out the R factor

Post by Don »

Michael Sherwin wrote:
Don wrote:
Michael Sherwin wrote:Of course R stands for the extra Null Move Reduction.

R = 3 is better than R = 2 because at R = 3 an extra ply of depth is searched enough times during the course of a game to make it worthwhile.

R = 4 is not better than R = 3 because an extra ply is not reached often enough.

R = 5 may be better than R = 3 if an extra ply is reached often enough. I am testing that now. It is searching an extra ply most of the time.
I don't think it really works that way. If you get a 5% speedup in your program you can measure the strength increase. And the strength increase is quite smooth as you increase the time.

You seem to be saying that unless you can search an extra ply most of the time you won't get much strength boost but that's not true.

Back in the old days of computer chess I received some insight into why a small speedup, say 10%, is quite measurable. In a tournament my program was playing in there were 3 times the program nearly blundered one particular game away and each time it changed it's move just seconds before the timeout. I remember thinking each time that if my program was 5 or 10 percent slower it would have lost.

That was probably a very unusual situation, being 10 percent slower would not make every win a loss of course. But it happens so often that I know that even a small speedup would impact at least 1 game every few.
If the jump in speed is especially significant and the quality loss is relatively small, then of course you have a point.

That R = 4 is worse than R = 3 is a given. That R = 4 misses more tactics than R = 3 is obvious. If R = 4 searched a ply deeper every time than R = 3 then the program would probably be stronger. My observation is that R = 4 does not search deeper (at least not enough to be effective). R = 5 gets an extra ply deep over R = 3 most of the time. Therefore R = 5 has something to recommend it despite that it would miss more tactics than R = 4.

I am just trying to find the 'gold' in Dann's R mine. As depth increases in Dann's formula maybe some R values should be skipped in the progression.
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Figuring out the R factor

Post by Michael Sherwin »

Don wrote:
Michael Sherwin wrote:
Don wrote:
Michael Sherwin wrote:Of course R stands for the extra Null Move Reduction.

R = 3 is better than R = 2 because at R = 3 an extra ply of depth is searched enough times during the course of a game to make it worthwhile.

R = 4 is not better than R = 3 because an extra ply is not reached often enough.

R = 5 may be better than R = 3 if an extra ply is reached often enough. I am testing that now. It is searching an extra ply most of the time.
I don't think it really works that way. If you get a 5% speedup in your program you can measure the strength increase. And the strength increase is quite smooth as you increase the time.

You seem to be saying that unless you can search an extra ply most of the time you won't get much strength boost but that's not true.

Back in the old days of computer chess I received some insight into why a small speedup, say 10%, is quite measurable. In a tournament my program was playing in there were 3 times the program nearly blundered one particular game away and each time it changed it's move just seconds before the timeout. I remember thinking each time that if my program was 5 or 10 percent slower it would have lost.

That was probably a very unusual situation, being 10 percent slower would not make every win a loss of course. But it happens so often that I know that even a small speedup would impact at least 1 game every few.
If the jump in speed is especially significant and the quality loss is relatively small, then of course you have a point.

That R = 4 is worse than R = 3 is a given. That R = 4 misses more tactics than R = 3 is obvious. If R = 4 searched a ply deeper every time than R = 3 then the program would probably be stronger. My observation is that R = 4 does not search deeper (at least not enough to be effective). R = 5 gets an extra ply deep over R = 3 most of the time. Therefore R = 5 has something to recommend it despite that it would miss more tactics than R = 4.

I am just trying to find the 'gold' in Dann's R mine. As depth increases in Dann's formula maybe some R values should be skipped in the progression.
And it may even be a valid one! :D

The best r for RomiChess using Dann's formula resulting in a best performance.

r = 2.5 + .25 * ddepth + log(delta) / 5;

Resulted in:

RomiChess96 - Olithinkwin32 : 71.5/100 61-18-21 (101=111111111=110101=111111==1=1=1010===1=111110100111 01=1=011=1=0111111111=111010111=101110001====0) 72% +164

r = 4 + (2 * (depth > 8)); a first try.

Is dead even with the record after 54 games.

RomiChess96 - Olithinkwin32 : 40.5/54 33-6-15 (111=111111==101111=11=110==1=1=1110=1===10=11110=10111) 75% +191

The main difference is that Romi has two less loses which is in this versions advantage because Romi looses half points due to not understanding insufficient material draws.

A caveat: I know that this is not enough games, however, it is merely a data point suggesting further study.
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
User avatar
Daniel Mehrmann
Posts: 858
Joined: Wed Mar 08, 2006 9:24 pm
Location: Germany
Full name: Daniel Mehrmann

Re: Figuring out the R factor

Post by Daniel Mehrmann »

Hi Michael :-)

I think it's based on your search what might be work you. There are no gerneral rules. It depends on how much you'll prune on other ways.

This works for me, but it's not yet well tuned:

Code: Select all

if (&#40;sgdPtr->ply <= p_depth /2 || &#40;StandPat > beta || (!hashMiss && HashScore > beta&#41;)) && (!&#40;flags & PvNode&#41; || !&#40;flags & PruneCandidate&#41;)) &#123;
				NullDepth = depth - 1 - 3 - &#40;depth > 11&#41; - &#40;depth > 15&#41; - &#40;depth > 19&#41; - &#40;depth > 23&#41;;
			&#125; else &#123;
				NullDepth = depth - 1 - 2;
			&#125; 
Best,
Daniel
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Figuring out the R factor

Post by Michael Sherwin »

Daniel Mehrmann wrote:Hi Michael :-)

I think it's based on your search what might be work you. There are no gerneral rules. It depends on how much you'll prune on other ways.

This works for me, but it's not yet well tuned:

Code: Select all

if (&#40;sgdPtr->ply <= p_depth /2 || &#40;StandPat > beta || (!hashMiss && HashScore > beta&#41;)) && (!&#40;flags & PvNode&#41; || !&#40;flags & PruneCandidate&#41;)) &#123;
				NullDepth = depth - 1 - 3 - &#40;depth > 11&#41; - &#40;depth > 15&#41; - &#40;depth > 19&#41; - &#40;depth > 23&#41;;
			&#125; else &#123;
				NullDepth = depth - 1 - 2;
			&#125; 
Best,
Daniel
Hi Daniel,

Yes, and what works one day does not work the next day nor against the next program. You wait till depth 12 before starting your progression. That is interesting! :)
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