Chess programmer's life is hard

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

nionita
Posts: 175
Joined: Fri Oct 22, 2010 9:47 pm
Location: Austria

Chess programmer's life is hard

Post by nionita »

Most of the time you try all kind of ideas and optimisations and 99.9% of them don't work, and you know this only after a few tousand games.

And sometimes you have a simple change (mostly inspired by this forum, by the way) and bang! you got 50 elo points or more!

This is the conclusion after I looked back at the (recent) history of the sources of my engine Barbarossa and at the elo classification of different versions I tried. In November last year I got 72 elo points between a version called cpeg (-83 +/-4) and the next one called cpegm (-11 +/-5) just by addind a small advantage in eval for the side to move (5 cp):

Code: Select all

diff --git a/Eval/Eval.hs b/Eval/Eval.hs
index eaa1787..723d17a 100644
--- a/Eval/Eval.hs
+++ b/Eval/Eval.hs
@@ -196,7 +196,9 @@ itemEval ep p (EvIt a) = evalItem ep p a
 normalEval :: MyPos -> EvalState -> (Int, [Int])
 normalEval p sti = (sc, feat)
     where !feat = concatMap (itemEval (esEParams sti) p) evalItems
-          !sc   = feat <*> esIWeights sti `shiftR` shift2Cp
+          !sc'  = feat <*> esIWeights sti `shiftR` shift2Cp
+          !sc   = sc' + meMoving
+          meMoving = 5 -- advantage for moving
Since then I got further 74 elo points after tens of optimisations and refactoring, and after trying at least 50 new version.

Ok, the real elo differences are probably smaller, as these ones are obtained by playing games between mostly identical engines, which, if I remember correctly, exagerates the differences.
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Chess programmer's life is hard

Post by cdani »

Hi!
I wanted to say more or less the same thing :-) when I publish the new version of Andscacs in some days.

Generalizing, I distinguish two ways of advancing, one changing things and other optimizing things. The second requires a lot of work and is more boring, and I compare it to many of the scientific advances of today, based on analyzing the next logical step without great revolutions. It is the sure way. It's condemned to be discarded when some new advancement questions and overcomes the base of all this hard work.

And the changing things way, also it's condemned to return to second line when someone works hard on the idea and extracts every drop of it and, in our case the engine that once got big advantage, gets relegated. I compare it to the rivalry between Capablanca and the hard worker Alekhine.

I have the feeling that every well writed engine is always a few little changes of code to obtain 100 elo gain. Sure many of you share the same idea.

Obviously if the engine is weaker it's a lot easier, above all having all the incredible amount of information available today.

I think the engines in 10-20 years will be very different, based on new paradigms, because the basical idea of most of the actual engines are the same, and this is intrinsically limited in some way we will discover in the future.

Even if we are able to "end" chess only because of the increase of the computer power, someone will discover new ways to treat these types of algorithms that do not require that power, may be with the benefit of seeing the picture finished. So may be someone can imagine how the picture will be finished, and extract ideas of their conclusions.

The programming is boring if you orientate your work to boring optimizations, but if we want our engine to be stronger, why not work a little hard? Just don't forget to be creator also.
Henk
Posts: 7220
Joined: Mon May 27, 2013 10:31 am

Re: Chess programmer's life is hard

Post by Henk »

What about after weeks of tuning you finally found a set of parameters that gives an improvement. A few hours later you accidentally start the tuner again and when you stop it all your good parameters are overwritten with bad ones.

Or on a good day you find a major bug in your program and when you remove it the program plays 200 ELO worse. Or because of that bug some methods did erroneously not give an improvement but you removed the source code so you have to implement them again.
Exacto
Posts: 15
Joined: Thu Feb 13, 2014 6:51 pm

Re: Chess programmer's life is hard

Post by Exacto »

Henk wrote:... Or on a good day you find a major bug in your program and when you remove it the program plays 200 ELO worse.
I'm so glad that I'm not the only person having these experiences!
"A little pain never hurt anyone."
tralala
Posts: 16
Joined: Fri Jan 10, 2014 11:49 pm

Re: Chess programmer's life is hard

Post by tralala »

nionita wrote:In November last year I got 72 elo points between a version called cpeg (-83 +/-4) and the next one called cpegm (-11 +/-5) just by addind a small advantage in eval for the side to move (5 cp)
I can't quite believe that a side to move bonus can have such a large effect.