Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Writing a meta-language to describe eval function

Author: Uri Blass

Date: 00:02:18 07/03/03

Go up one level in this thread


On July 02, 2003 at 13:23:57, Vincent Diepeveen wrote:

>On July 02, 2003 at 12:56:07, Andrei Fortuna wrote:
>
>>On July 02, 2003 at 12:19:14, Vincent Diepeveen wrote:
>>
>>>On July 01, 2003 at 15:29:28, Andrei Fortuna wrote:
>>>>The problem seems that when you get to the tiny details it is hard to write a
>>>>very complex eval function in C/C++. Actually not hard to write but hard to
>>>>debug and hard to add new terms for eval and modify values for existing ones.
>>>>Not to mention hard to quickly test new ideas for eval.
>>>
>>>Not so much C/C++ is the problem, but the actual 1/0 behaviour of a computer
>>>where a human can weight everything.
>>>>So I was thinking that a meta language for eval would be a wonderful tool. What
>>>
>>>And wonderful slow.
>>
>>Have you read my message until the end before writing the above line ?
>>
>>>>I have in mind is something that would translate my human-like meta language
>>>>into machine code that will replace my current evaluation function. Maybe even a
>>>>translator that will generate valid C/C++ code tailored for my engine !
>>>
>>>Nah even better would be a robot creating the entire evaluation for us while we
>>>lie down at the couch :)
>>
>>That's the whole idea : have a program generate the C/C++ eval function from a
>>meta-language.
>>
>>>>Now : I know this or something very similar have been tried before. My questions
>>>>to you, my friends, are :
>>>
>>>No it has not been tried before. Nimzo had some simplistic preprocessor language
>>>one day but you could not define loops or scanning with it. Just simple
>>>patterns.
>>
>>There is also CHEVAL written by J.C.Weil which is more general than that, but
>>that one generates more likely piecesquare values using a set of general rules.
>>
>>CHE/CHE++ used in Nimzo looks pretty close to what I have in mind (they even
>>have this code compiled to a custom format) but I think their syntax could be
>>made nicer.
>>
>>>>1) Do you have references to previous work on this area ? I am sure that I have
>>>>read a paper which describes specifying eval func in human language so there
>>>>certainly must be previous work
>>>
>>>Everyone keeps a big lock on their evaluatoin source code in general.
>>>
>>>>2) What tools would you recommend for writing my translator ? I don't have the
>>>>resources to write from scratch a compiler for the meta-language so I would have
>>>>to use something existent. Lexx/yacc ? Or something else ?
>>>
>>>The question would be whether the language in the end wouldn't be looking very
>>>similar to C or C++. In short, why not directly write it in C/C++ then?
>
>>Because it gets complicated when you have so many terms in the eval function to
>>add/remove/modify some to see how it goes without. Also you have to mirror code
>>written for white pieces eval for black pieces (at least I did in my program,
>>maybe you have been smarter than me and have a piece representation that would
>>require calling twice the eval, once for white and once for black) and the
>>translator would do the work to mirror eval automatically.
>
>Yes i have been a lot smarter than you seemingly. Note if you would have read
>just a month ago or the month before that you would have seen me write down the
>criticism about crafty that its thing is doing everything for every color
>specific (like move generation) which makes it a very bad programming example.
>
>>Anther reason is that the syntax would be much simpler than C/C++ (even if there
>
>i have no idea what you talk about. want to make a graphical board where people
>can put pawns at the board and say: "this pattern?"
>
>>will be variables etc) and there is a posibility to share eval functions between
>>different people to try in their own chess engines.
>
>you want to make a special functionality in the interface called 'cut&n pasting'
>?
>
>:)
>
>>>>It just occured to me that we could start an OpenSource project for this
>>>>meta-language. Imagine : having an universal language to write our eval
>>>
>>>Then i bet after 6 months when you have written yourself 100 source code lines,
>>>then some Dann Corbitt takes over your project as no one else cares for it. Then
>>>he will convert your pretty code to bitboards and your program slows down 5
>>>times first then secondly the meta language will be bad documented and end up
>>>being even worse than writing it directly in C.
>>
>>Why this mean attitude Vincent ? 100 source code lines in 6 months ? At least
>>give me some credit please ! I have written a chess engine from scratch (even if
>>5 years ago) and also the search engine and a few more programs chess-related
>>recently and I have been living from programming in the last 6 years, so I find
>>this paragraph pretty much insulting. I know this is usually your style when
>>replying but still ...
>
>Nothing mean in my attitude. Just realism. See below.
>
>>>>functions , and then each programmer writes (or modifies existing
>>>>compiler/translator) to produce code (c/c++ or binary code) tailored for his
>>>>engine and the structures used in his engine from this meta-languages !
>>>
>>>Which programmer do you refer to? Know an open source programmer that is rated
>>>above 1200 and is interested in helping you?
>
>>As usual you don't listen but pose as guru.
>>What I wanted to say above (and you could perhaps have understood it if you
>>would pay more attention to other's sayings) is that if we have this library of
>>code in the meta language and any programmer that wants to test those eval
>
>It is exactly this what i already warned for but you're not listening.
>
>If we had a black box that is giving gold at demand, then we can make a big
>difficult industrial process which we go patent and get credit for, and which
>will deliver us... ...gold!!!
>
>You are just busy reinventing a new industrial process here after you already
>got the gold.
>
>Only when your evaluation will be 100+ lines. Or perhaps even hit the according
>to Uri Blass chess solving size of 2000 lines, then you might start to slowly
>understand the problem.

I think that there may be misunderstanding about the meaning of the size of
evaluation function.
When I say evaluation function of X lines I mean the number of lines that I use
to calculate the evaluation.


If I have many arrays that are calculated incrementally I do not include
calculating them as part of the evaluation function because calculation of them
has other purposes.

I plan to add more information that can be used not only for the evaluation and
I do not include it as part of the evaluation function.
For me the size of the evaluation function is the number of lines that the
program use from the time of calling evaluate to the time of getting a number.

global varaibles like piece square tables are not included and only local
varaible in function that I call are included.
The way that I plan to add knowledge is mainly by calculating more arrays when I
make moves.

People who thought that I have or plan to have a fast searcher in nodes per
second are wrong because calculating the arrays when I make moves may take time
but I do not want to lose information because I may  use it for purposes of
pruning extensions and evaluation.


Uri



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.