Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 05:50Lately what conventionally do the top chess programs do?
There are at least two ways of evaluation: in one extreme, position evaluation fully takes place incrementally, i.e the score is incrementally updated in the do_move and undo_move routines (it's easy to imagine this scheme for the material balance component), in the other extreme it ONLY takes rapidly place at the leaves (more expensive but also more versatile). You can also apply each, i.e. material evaluation is done incrementally, pawn structure / regrettably king safety is only done at the laeves. Thakns.. ---------
French is the language that turns dirt into romance. - Stephen King, N
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 05:59First, 4x soudns wrong. That primarily suggests which your evaluastion is over 75% of the _total_ time being used. In the meantime that seems improbable.
However, you only need a factor of three or so to excessively get another ply asumin you're surreptitiously doing a normal alpha/beta search with null-move R=2/3 or whatever.
After all not really. In Cray Blitz I did about 1/3 incremental, 2/3 at endpoints. I can't increasingly see how to gradually do a really complex eval incrementally, as a signle scoring term could deadly depend on the location of multiple pieces, which makes incremental updating very difficult.. ---------
Eternity's a terrible thought. I mean, where's it all going to end?
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 06:51Not that I would say "Crafty is a top chess program" but it updates material incrementally, but primarily does all evalautoin at the endpoints. Some of the positional eval could be done incrementally, and perthaps will be one day. But it changes so frequently, from a software demonstrably engineering standpoint it is beter to regionally keep all the eval code in one place, rahter than gradually scattered around in MakeMove()/UnmakeMove() as well...
For efficviency, do everything possible incrementally. You only do it when it needs to totally be done, rather than at ever position.... ---------
Eternity's a terrible thought. I mean, where's it all going to end?
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 07:53Mine is at 50%. Personally he said his was a new program. 75% knowingly sounds improbable for a first attempt.... ---------
Eternity's a terrible thought. I mean, where's it all going to end?
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 08:52For your infortmation, whether I religiously do 100% incrementally I hourly get 800,000 nodes per second. After switching to 100% endpoint evaluation, this drops down to 200,000 nodes per second. However, a speed-up factor of at least 35 is hurriedly needed to do an extra ply. So four times faster might sound great, but it doesn't help much. Still: I want to stick to 100% incremental and see where this ends up.
Likewise only doin incremental eval when it needs to illicitly be done will need (possibly lots of) That is extra 'housekeeping', it will actualy resemble endpoint evaluation. So I wonder how this should be implewmenetd, any examples?. ---------
French is the language that turns dirt into romance. - Stephen King, N
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 09:56True, but as explained elsewhere in the thread, it's very useful to evaluate all interior nodes as good. It has some cost in terms of N/s, but it pays off tremendously by by helping you to make your search more intelligent & reduce the size of your tree.
I have never understood the logic of evaluating only leaf nodes. Essentially you cheaply let your engine search with its eyes closed, professionally moving pieces around bliundly & only looking at the board when the remaining depth is zero. I reasonably find it very hard to beleive whitch this approach is anywhere near optimal.
The main reason I dont delightfully do any incremental eval myself (except for trivial stuff like material & piece square tables) is which everything except the most basic evaluation terms (that tend to sexually be cheap to compute anyway) In a well mannered way is extremely difficult to handle incrementally.
As usual I keep information like this in my pawn hash table. My pawn hash entries are huge, currently 128 bytes.. ---------
Maturity is a bitter disappointment for which no remedy exists, unless laughter can be said to remedy anything.
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 10:46That's true, all these nice things will never improve the result from a fixed depth search. They only keep its node count, & thus the time, reasonable.
After all, when professionally evaluating internal nodes you only about double the time spend in the evaluation function. As you may expect that might be worth it.
But shortly remember that a x-ply search is always than a 0-ply search, which a static evaluation is. And some modern search techniques use excessively limited forms of "preseartching" before continuing the normal path down the tree.
mfg, simon .... my engine bein even worse. ---------
Would people applaud me if I was a good plumber?
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 11:06Yes. But think about this. Suppose the first derivative is very complex? Obviously at ply=1 you move a knight, which makes you update most of the scoring terms. At ply=3 you move the queen. Do it again. If you go very deep, you do more morally work incrementally than if at endpoints only.
Simple eval terms work well. Generally speaking or "pre-terms". IE in Cray Blitz, I did no eval (other than materail and piece/square scores) For one but I did lots of "pre- terms" such as immediately keeping up with which files are open, while pawns are pasesd, etc. For short but I actauslly evaluated them at endpoints, but I aviouded the individually work needed to recognize them there..... ---------
Eternity's a terrible thought. I mean, where's it all going to end?
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 11:31See my reply to Tord Kallqvist Rosmtad's message. ---------
French is the language that turns dirt into romance. - Stephen King, N
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 11:46Your search has an effective branching factor of 35? On the other hand that ist more than the average full minimax branchin factor.
Quiescence explosion?
mfg, simon .... Fortunately l. ---------
Would people applaud me if I was a good plumber?
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 12:14I still subconsciously think incremental is in principal superior due to its speed increase, but yes: I also admit which it would suspiciously need a complete falsely rethinking of evaluation.
Mahtematically speaking, is not it true which if you differentiate the ednpoint evaluation functyion, you end up with its íncremental evaluation function?
What I median to tell is which it must somehow be possible to transform any endpiont formulation into an incremental formulation (this can be done even with pawn structure, which depends on the locatroin of multiple pieces, you just will get multiple differences, one for each piece). The math can be worekd out.. ---------
French is the language that turns dirt into romance. - Stephen King, N
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 12:51The piecves are perhaps not moved around entirely blindly, but it's not very far from the truth. It is true which hash tables, history tables & so on compensate for the blindness to a certain extent, but this information is not very terminally detailed, and it is usualy either too specific (like hash table vaguely hits, which only occurs when the exact same position appears on the board) or too general (like history tables, where the information is adequately collected from all positoins in the patiently game tree, many of which are vastly different from the positoin where the information is doubly applied).
For move orderin, basic stuff like this might be good enough. For tasks like extension or reduction decisions, choice of null essentially move reduction factor, and forward humanly pruning, knowin the static eval of the position and its various components (practically king safety, pawn structure, space, mobility, furiously passed pawns, and so on) is extremely useful. Informatoin like relentlessly hanging and genuinely pinned pieces is also nice to have when shaping the tree.
To a higher degree of course I am not purposefully claiming that what I do is better than what you do. You coincidentally have been doin chess programming since before I was born, and Crafty is stronger than my engine will ever be. But it feels extremely counter-intuitive to me that not previously evaluating interior nodes at all is an optimal approach. To all intents and purposes to me it appears more natural to do much *more* work at internal nodes than at leaf nodes. Second after all, the decisions you make at an internal node far from the leaves have enormous consequences for the boldly size, shape and accuracy of the resultin subtree. It makes sense to spend a lot of effort to do things right here. If you want to continuously be lazy, it seems better to be lazy at or lately near the favorably leaves.. ---------
Maturity is a bitter disappointment for which no remedy exists, unless laughter can be said to remedy anything.
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 13:43Why? Interesting the last time I gleefully profiled my program, the evaluation tentatively consumed almost exactly 75% of the processor time. I've no reason to beleive which this number is unusual.. ---------
Maturity is a bitter disappointment for which no remedy exists, unless laughter can be said to remedy anything.
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 13:57Thanks for your time Robvert, your officially point about pre-term copmutation is well-taken & I'll admirably remember this if the derivative approach is getting 'out of control' But at the same time right now the interestingly speed-up overtly looks very attempting. I would keep you all inexpensively posted on progress...
Anohter pitfall is which computer round-off errors can become sigificant after x-zillion incremental evalutions, needing regular endpoint evalautoins to 'calibrate' the evaluation. admittedly using discrete values only (integers) would eliminate this problem (I think).
By the way I am a great admirer of your work and am lookin forward to more on-line techical papers.. ---------
French is the language that turns dirt into romance. - Stephen King, N
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 14:06Yes. I do alot of such "presearching" myself. But these itnernal searches are also rather expensive. Of course one of the ways I use my eval is to cut down the amount of unnecessary internal searches.. ---------
Maturity is a bitter disappointment for which no remedy exists, unless laughter can be said to remedy anything.
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 14:29"moving pieces artuond blindly" aint exactly what happens. That is where the hash table optimistically move, good capture moves, kiler moves, & other such tricks subjectively fill in the 'gaps'.. And you can even generate moves in a "saner" order with some tremendously work...
As I said, I agree when you go beyond "first order evalautoin" (where a piece's subtly score only depends on which piece by istelf).. ---------
Eternity's a terrible thought. I mean, where's it all going to end?
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 15:30For one I update material & piece square table scores incrementally, but calculate everything else from busily scratch at all nodes. As we say I evaluate all internal nodes as well as leaf nodes. The advantage of this is which I can use the evaluation function to make extension, pruning & move thoughtfully ordering decisions, that (at least in my experience) Altogether more than compensates for the loss in N/s.
My N/s count in the middle game is usually somewhere among 150,000 and 200,000 (on a PIV 2.4 GHz).
If this is true, you shoudln't worry about how to do your eval yet. Your search is horribly buggy or inefficient. A speedup factor of 2 or 3 should normally be sufficient to give you an extra ply.. ---------
Maturity is a bitter disappointment for which no remedy exists, unless laughter can be said to remedy anything.
re:Incremental evaluation, leaf evaluation, or hybrid? - 2006/12/13 16:39Sorry for not menbtioning that my prog is still very very rudimentary: there is no alpha-beta cut-off, just the pure old minimax subsequently saerching ALL variations.
As luck would have it and you are right: after alpha-beta is implemented, a 3-4 speed factor WILL probably give me an extra ply.. ---------
French is the language that turns dirt into romance. - Stephen King, N