Smooth scaling stockfish

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Smooth scaling stockfish

Post by Dann Corbit »

Tord Romstad wrote:
Dann Corbit wrote:This version of Stockfish:
http://cap.connx.com/chess-engines/new- ... x64_ja.rar

Scales null move smoothly. I get about +150 Elo so far in my testing. How about yours?
I hope I'm wrong, but this is extremely hard to believe. I would be pleasantly surprised if this change increased the strength even by 20 Elo points. I haven't done any tests yet, though.

How did you test this?
Someone else got +100:
http://www.talkchess.com/forum/viewtopi ... 90&t=31331

Unfortunately, my initial post had a link to a version that did not correctly incorporate my changes due to a titanic iceberg collision in my tiny little brain.

I suggest that you compile my simple changes and test it yourself. I guess that you will see the same thing that I do. It appears that Stockfish is easily as strong as Rybka now (but -- of course -- further testing may make this statement look very silly).
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: table

Post by Daniel Shawul »

I don't think so. When eval <= beta, he sets delta = 1 so the logarithmic part is 0 (ie the effect of eval is gone). And R will be calculated based on depth and a constant increment.

I wouldn't be surprised if "avoiding null move when eval is less than beta" gives better result. I recall that I got about 95% accuracy of null move fail high predictions when I used [ score > beta + margin where margin = 200 + highest hanging piece.] criteria for deciding if to do null move.
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Smooth scaling stockfish

Post by Michael Sherwin »

BubbaTough wrote:
Dann Corbit wrote:
BubbaTough wrote:
Dann Corbit wrote:This version of Stockfish:
http://cap.connx.com/chess-engines/new- ... x64_ja.rar

Scales null move smoothly. I get about +150 Elo so far in my testing. How about yours?
I am not sure what you mean by smooth scaling, and don't see any attached source code.


-Sam
Here are the changes from version 1.61:
http://cap.connx.com/chess-engines/new-approach/sfc.zip

Note that I do not have the 1.62 sources, which have additional corrections.

I guess that the curve can be greatly improved. It was a first hack eyeball guestimate.
Ahh, gotcha. I did something similar in LearningLemming, and I think I got the idea from something Michael Sherwin was trying in Romi (though I think he scaled it differently) so I imagine Romi also does it. Its nice to see it work for someone else too. It always amazes me that some ideas can work so well for some authors, and not for others.

-Sam
I was working on something to do with modifying the null move search. And I remember that Romi got very good results. But, I got distracted and forgot about it. Given my memory problems, I can not say if this is similar to what I was doing or not. I will go digging through my old post to see if I can find it. Romi could use another 150 elo right about now! However, I will wait until later to make a claim that yet another one of my ideas has made it into Glaurung/Stockfish. :D
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: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Smooth scaling stockfish

Post by Dann Corbit »

Michael Sherwin wrote:
BubbaTough wrote:
Dann Corbit wrote:
BubbaTough wrote:
Dann Corbit wrote:This version of Stockfish:
http://cap.connx.com/chess-engines/new- ... x64_ja.rar

Scales null move smoothly. I get about +150 Elo so far in my testing. How about yours?
I am not sure what you mean by smooth scaling, and don't see any attached source code.


-Sam
Here are the changes from version 1.61:
http://cap.connx.com/chess-engines/new-approach/sfc.zip

Note that I do not have the 1.62 sources, which have additional corrections.

I guess that the curve can be greatly improved. It was a first hack eyeball guestimate.
Ahh, gotcha. I did something similar in LearningLemming, and I think I got the idea from something Michael Sherwin was trying in Romi (though I think he scaled it differently) so I imagine Romi also does it. Its nice to see it work for someone else too. It always amazes me that some ideas can work so well for some authors, and not for others.

-Sam
I was working on something to do with modifying the null move search. And I remember that Romi got very good results. But, I got distracted and forgot about it. Given my memory problems, I can not say if this is similar to what I was doing or not. I will go digging through my old post to see if I can find it. Romi could use another 150 elo right about now! However, I will wait until later to make a claim that yet another one of my ideas has made it into Glaurung/Stockfish. :D
It's really a very simple idea. It may not be simple to get it to work with every program. I added it to a program called Adriano ten years ago with mixed results.
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Smooth scaling stockfish

Post by Dann Corbit »

Gian-Carlo Pascutto wrote:
Dann Corbit wrote: I doubt that 150 Elo will hold, but I guess at least 100 Elo will. Then again, my test was not very extensive.
For me it seems 15 ELO worse than regular nullmove.
I calibrated so that it would approximately go through the existing points in Stockfish (though the curve would also extend through both sides).

When you say you lost 15 Elo, did you mean with Stockfish or with Deep Sjeng?

I guess that with Deep Sjeng you will also have to match your existing curve approximately.

Also, there are many parameters to tweak and my choice of log() may not be best (I simply figured that with exponential complexity, we have to trim very cautiously).
User avatar
George Tsavdaris
Posts: 1627
Joined: Thu Mar 09, 2006 12:35 pm

Re: Smooth scaling stockfish

Post by George Tsavdaris »

Dann Corbit wrote:
Tord Romstad wrote:
Dann Corbit wrote:This version of Stockfish:
http://cap.connx.com/chess-engines/new- ... x64_ja.rar

Scales null move smoothly. I get about +150 Elo so far in my testing. How about yours?
I hope I'm wrong, but this is extremely hard to believe. I would be pleasantly surprised if this change increased the strength even by 20 Elo points. I haven't done any tests yet, though.

How did you test this?
Someone else got +100:
http://www.talkchess.com/forum/viewtopi ... 90&t=31331

Unfortunately, my initial post had a link to a version that did not correctly incorporate my changes due to a titanic iceberg collision in my tiny little brain.
Do you mean the Jim's compile you initially gave or also your compiles of 32 and 64 bit?

BTW your Stockfish(32bit) in my PC does very well and holds on its own against Rybka 3(32bit) with a 5 draws after 5 games so far. Others in Rybkaforum say Rybka 3(64bit) has no problems to win against it(the 64bit version) , so i guess only time will tell what is really going on.
After his son's birth they've asked him:
"Is it a boy or girl?"
YES! He replied.....
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: table

Post by Daniel Shawul »

Oops more like

Code: Select all


double r = 0.36 * &#40;ddepth / OnePly&#41; + 3.1 + log&#40;delta&#41;/5.0; 

Martin Thoresen
Posts: 1833
Joined: Thu Jun 22, 2006 12:07 am

Re: Smooth scaling stockfish

Post by Martin Thoresen »

George Tsavdaris,

I got the same impression after running both 32- and 64-bit versions that the 32-bit seems (much) stronger for some reason.

It was clearly leading the field.
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Smooth scaling stockfish

Post by Dann Corbit »

George Tsavdaris wrote:
Dann Corbit wrote:
Tord Romstad wrote:
Dann Corbit wrote:This version of Stockfish:
http://cap.connx.com/chess-engines/new- ... x64_ja.rar

Scales null move smoothly. I get about +150 Elo so far in my testing. How about yours?
I hope I'm wrong, but this is extremely hard to believe. I would be pleasantly surprised if this change increased the strength even by 20 Elo points. I haven't done any tests yet, though.

How did you test this?
Someone else got +100:
http://www.talkchess.com/forum/viewtopi ... 90&t=31331

Unfortunately, my initial post had a link to a version that did not correctly incorporate my changes due to a titanic iceberg collision in my tiny little brain.
Do you mean the Jim's compile you initially gave or also your compiles of 32 and 64 bit?

BTW your Stockfish(32bit) in my PC does very well and holds on its own against Rybka 3(32bit) with a 5 draws after 5 games so far. Others in Rybkaforum say Rybka 3(64bit) has no problems to win against it(the 64bit version) , so i guess only time will tell what is really going on.
Jim's compile had only a small part of my changes because I forgot to tell him about a macro that I added for conditional compilation.

My 32 and 64 bit versions had the change, but Jim's will be faster. He has redone the compile with the macro in use now.
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Smooth scaling stockfish

Post by Dann Corbit »

I went ahead and made a slightly smoother version (but Daniel Shawul's suggestion of the formula is better -- I did not fix it yet so that it will not break of the definition of OnePly changes.)

Code: Select all

#ifdef SMOOTH_REDUCTION
		double delta = approximateEval - beta;
		delta = max&#40;delta, 1.0&#41;;
		double ddepth = double&#40;depth&#41;;
		double r = 0.18 * ddepth + 3.1 + log&#40;delta&#41;/5.0;
		r = r > ddepth ? ddepth &#58; r;
		int R = int&#40;r * &#40;int&#41;OnePly&#41;;
#else
        // Null move dynamic reduction based on depth
        int R = &#40;depth >= 5 * OnePly ? 4 &#58; 3&#41;;

        // Null move dynamic reduction based on value
        if &#40;approximateEval - beta > PawnValueMidgame&#41;
            R++;
		R *= OnePly;
#endif
		nullValue = -search&#40;pos, ss, -&#40;beta-1&#41;, depth-R, ply+1, false, threadID&#41;;

[/quote]