Accurate eval function

Discussion of chess software programming and technical issues.

Moderators: Harvey Williamson, bob, hgm

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
Kempelen
Posts: 620
Joined: Fri Feb 08, 2008 9:44 am
Location: Madrid - Spain
Contact:

Accurate eval function

Post by Kempelen » Wed Mar 18, 2009 11:46 am

Assuming a "standard" implementation of common search techniques, does an accurate eval function help to reduce the search tree? I mean, as more accurate eval func more the tree is reduced?
Fermin Serrano
Author of 'Rodin' engine
http://sites.google.com/site/clonfsp/

User avatar
Matthias Gemuh
Posts: 3238
Joined: Thu Mar 09, 2006 8:10 am
Contact:

Re: Accurate eval function

Post by Matthias Gemuh » Wed Mar 18, 2009 11:59 am

Kempelen wrote:Assuming a "standard" implementation of common search techniques, does an accurate eval function help to reduce the search tree? I mean, as more accurate eval func more the tree is reduced?
Here we are not programmers.
Please ask your question in the programmers' subforum.

Matthias.
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de

User avatar
Eelco de Groot
Posts: 4268
Joined: Sun Mar 12, 2006 1:40 am
Location: Groningen

Re: Accurate eval function

Post by Eelco de Groot » Wed Mar 18, 2009 12:29 pm

Kempelen wrote:Assuming a "standard" implementation of common search techniques, does an accurate eval function help to reduce the search tree? I mean, as more accurate eval func more the tree is reduced?
I think the answer is yes, there was a thread in the programming subforum, over a year ago where it was described by Alessandro Scotti how Glaurung managed to search much deeper than Hamsters, he thought a main factor was null-move, and François Karr had done a similar experiment from which he concluded that better search depths in Glaurung compared to BugChess2 were for the most part due to a better evaluation!

I found back the original "Going crazy over Glaurung" thread.

There also is a Glaurung version made by Tord with experimental "standard" evaluation function for these kind of experiments, there was a tournament in Polen I believe where programs competed all with the same evaluation function. You would have to ask others for the details about it. But conclusion seems to be that search depth is effectively increased with a better eval function. I suppose this is about the synergy between eval and search.

Regards,

Eelco
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan

BBauer
Posts: 658
Joined: Wed Mar 08, 2006 7:58 pm

Re: Accurate eval function

Post by BBauer » Wed Mar 18, 2009 12:40 pm

Absolutly!
Assume you have a accurate evaluation at depth 1.
Now there is now need to search deeper.
You are done!

kind regards
Bernhard

User avatar
Matthias Gemuh
Posts: 3238
Joined: Thu Mar 09, 2006 8:10 am
Contact:

Re: Accurate eval function

Post by Matthias Gemuh » Wed Mar 18, 2009 1:13 pm

BBauer wrote:Absolutly!
Assume you have a accurate evaluation at depth 1.
Now there is now need to search deeper.
You are done!

kind regards
Bernhard

Terms used in this thread should be defined early, I think.
What does "accurate" mean ?
If I evaluate only material and king position, giving a bonus for hiding the king behind pawns throughout the game, that is not accurate.
I could change this by taking away that bonus in endgames, granting a bonus for centralizing king or letting it accompany passed pawn in endgames. That is what I call "accurate".
Now there is no need to search deeper ?

Matthias.
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de

BBauer
Posts: 658
Joined: Wed Mar 08, 2006 7:58 pm

Re: Accurate eval function

Post by BBauer » Wed Mar 18, 2009 1:32 pm

Accurate means that the difference between true evaluation and program evaluation is zero.
I guess that your program evaluation is usually not accurate.
You know that, therefor you try to get a better evaluation by search.
kind regards
Bernhard

PK
Posts: 861
Joined: Mon Jan 15, 2007 10:23 am
Location: Warsza
Contact:

Re: Accurate eval function

Post by PK » Wed Mar 18, 2009 1:51 pm

I think that the gain in nodes per depth does not necessarily come from accuracy. This is rather about seeing the big difference between various positions. Back when I learned C by modifying TSCP I noticed that adding terms that cause more score jumps (like strongly preferring B over N, penalizing an uncastled King trapping a Rook etc) tended to lead to better nodes per depth ratio, sine more positions were dismissed by search as not good enough. adding evaluation terms that change slowly (like mobility) didn't have quite the same effect.

User avatar
Matthias Gemuh
Posts: 3238
Joined: Thu Mar 09, 2006 8:10 am
Contact:

Re: Accurate eval function

Post by Matthias Gemuh » Wed Mar 18, 2009 1:56 pm

BBauer wrote:Accurate means that the difference between true evaluation and program evaluation is zero.
I guess that your program evaluation is usually not accurate.
You know that, therefor you try to get a better evaluation by search.
kind regards
Bernhard

You seem to mean not just "accurate" but "accurate and complete" , i.e "perfect".
The question is: which of these two is the starter of this thread referring to ?

Matthias.
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de

BBauer
Posts: 658
Joined: Wed Mar 08, 2006 7:58 pm

Re: Accurate eval function

Post by BBauer » Wed Mar 18, 2009 2:13 pm

Here is something from the dictionary in german.

genau
exakt
richtig
akkurat
korrekt
präzise
zielgenau
zutreffend
fehlerfrei
pünktlich
sorgfältig

So accurate and perfect is pretty much the same.
Kind regards
Bernhard

Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 8:19 pm
Location: Oslo, Norway

Re: Accurate eval function

Post by Tord Romstad » Wed Mar 18, 2009 2:24 pm

Eelco de Groot wrote:
Kempelen wrote:Assuming a "standard" implementation of common search techniques, does an accurate eval function help to reduce the search tree? I mean, as more accurate eval func more the tree is reduced?
I think the answer is yes, there was a thread in the programming subforum, over a year ago where it was described by Alessandro Scotti how Glaurung managed to search much deeper than Hamsters, he thought a main factor was null-move, and François Karr had done a similar experiment from which he concluded that better search depths in Glaurung compared to BugChess2 were for the most part due to a better evaluation!

I found back the original "Going crazy over Glaurung" thread.
That discussion was about the speed of search in a single, very special position (the opening position), and the point being made was actually that Glaurung searched this position fast because of its (at the time) very bad evaluation function, which allowed it to "refute" strong first moves like 1. c4 with a null move.

About the question asked in this thread: One of the characteristics of a good evaluation function is that it is "continuous", in the sense that in a quiescent position, the static evaluation should be approximately equal to the static evaluation after the strongest available move in the position. Continuity in this sense does improve the efficiency of the search, because the best move and PV won't change as much from one iteration to the next.

However, continuity is not a sufficient condition for a good evaluation function. It is possible to write an evaluation function which is very bad, but still has good continuity, and therefore makes the search efficient. As a trivial example, consider an evaluation function which always returns 0, regardless of the position. The evaluation function is perfectly continuous and gives a blazingly fast and efficient search, but it certainly wouldn't be good. :)

Tord

Post Reply