Endgame Evaluation help!

Discussion of chess software programming and technical issues.

Moderator: Ras

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

Re: Endgame Evaluation help!

Post by Tord Romstad »

bob wrote:3. outside/distant passed pawns and the fact that they become more valuable as material is reduced.
Has anyone apart from Bob managed to make this work? I've tried outside passed pawn bonuses many times over the years, and the impact on playing strength has always been zero or negative. Scaling the bonus by remaining material does not seem to help.

I'll give it another try in the autumn, if I get enough time to start working on my chess engine again.

Tord
BubbaTough
Posts: 1154
Joined: Fri Jun 23, 2006 5:18 am

Re: Endgame Evaluation help!

Post by BubbaTough »

LearningLemming does this (I am not sure if I do it the same way Bob does or not). My testing method is a bit informal, so I can't really say if/how much it helps. I think it is a useful heuristic, but not easy to tune such that good pawn/piece sacrifices are chosen, and bad ones avoided.

-Sam
User avatar
Zach Wegner
Posts: 1922
Joined: Thu Mar 09, 2006 12:51 am
Location: Earth

Re: Endgame Evaluation help!

Post by Zach Wegner »

Edsel Apostol wrote:My advice on your eval, try to support simple things for now, maybe material and piece square tables only. Then test your engine and watch its games. Add little by little the knowledge depending on which your engine needs as you seen it play. This way, you are really sure that the knowledge you are putting in your engine really helps.

I have done the mistake before that if I add all of the chess knowledge in my engine that it would be strong. What I didn't realize that most of them conflicts with each other. The secret of strong engine nowadays lies on simple and efficient eval factors that are in harmony with each other.
I've read this many times, and I completely agree in theory.

In practice however, it's very hard to throw out all of the stuff that I've written in the eval. I know some of it is beneficial, but a lot of it is rubbish, and it's hard/boring to test every component of it. It's just such a pain for me to write eval knowledge, that I just want to do it once.

But seeing that ZCT's "weakest link" right now is the eval, I have in my todo list a complete eval rewrite. It will be a long process too, and I'll start from the ground up. I'll have to bite the bullet and add incremental updating of material, piece square, etc. I never wanted to do that before just because my make/unmake is so simple, and it would clutter it up a lot.

Things like this give me a lot of respect for people like Tord who can just scrap everything and start over. That's unthinkable for me to do now...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Endgame Evaluation help!

Post by bob »

I can't imagine anyone scoring distant/outside passers higher with more material on the board. With lots of pieces the pawn generally can't be advanced too far or it will be lost... while in a king and pawns only ending, it is almost a forced win...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Endgame Evaluation help!

Post by bob »

Tord Romstad wrote:
bob wrote:3. outside/distant passed pawns and the fact that they become more valuable as material is reduced.
Has anyone apart from Bob managed to make this work? I've tried outside passed pawn bonuses many times over the years, and the impact on playing strength has always been zero or negative. Scaling the bonus by remaining material does not seem to help.

I'll give it another try in the autumn, if I get enough time to start working on my chess engine again.

Tord
It's always worked for me. For a year it was a critical piece of evaluation that gave Crafty significant superiority over many chess programs. But slowly they all started doing it. I remember when Bruce added it to Ferret, and Dave added it to Wchess, etc...
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Endgame Evaluation help!

Post by Tord Romstad »

BubbaTough wrote:LearningLemming does this (I am not sure if I do it the same way Bob does or not). My testing method is a bit informal, so I can't really say if/how much it helps. I think it is a useful heuristic, but not easy to tune such that good pawn/piece sacrifices are chosen, and bad ones avoided.
It is a useful heuristic, in the sense that it is "obviously correct" to all human players. When I try to implement it, I see a lot of games where my program wins precisely because of this piece of knowledge. But still, when I look at a sufficiently big number of games, it turns out that my program performs worse with this heuristic than without it. It seems that the number of games where this heuristic improves performance is more than outweighed by the number of games where it hurts performance.

In my experience, this is a very frequent phenomenon: Adding a new evaluation rule which is correct 95% of the time can very often hurts the playing strength. I think this is because more than anything else, the strength of a chess player depends on the quality of his/her/its worst moves. For a chess programmer, this means that adding a new piece of heuristic knowledge is always a very dangerous operation. Unless the new piece of knowledge is correct in virtually all positions (which is almost never the case, more or less by definition of the word "heuristic"), there is a very serious risk that the new piece of knowledge is counterproductive.

This problem is even more serious because just looking at the games can easily give a false impression: The games where the program wins because of the new piece of knowledge are usually numerous and easy to spot, but the games where the new knowledge causes losses are even more numerous, but very difficult to spot. Therefore, adding new heuristic knowledge often makes the program play "optically" better, and look more intelligent, but hurts the practical playing strength.

This is all very frustrating, especially for people who are impatient, have very little time for programming and testing, want to implement lots of chess knowledge, and lack the skills to make a simple and fast program. Unfortunately, I'm one of these people. I wish I could simply quit and spend all my spare time on other and more rewarding hobbies.

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

Re: Endgame Evaluation help!

Post by Tord Romstad »

bob wrote:
Tord Romstad wrote:
bob wrote:3. outside/distant passed pawns and the fact that they become more valuable as material is reduced.
Has anyone apart from Bob managed to make this work? I've tried outside passed pawn bonuses many times over the years, and the impact on playing strength has always been zero or negative. Scaling the bonus by remaining material does not seem to help.

I'll give it another try in the autumn, if I get enough time to start working on my chess engine again.

Tord
It's always worked for me. For a year it was a critical piece of evaluation that gave Crafty significant superiority over many chess programs. But slowly they all started doing it. I remember when Bruce added it to Ferret, and Dave added it to Wchess, etc...
That's strange -- I have the source code of all the current top open source programs, and several of the top private and commercial programs, and as far as I can recall, none of them has any bonus for outside passed pawns.

Nevertheless, I'll give it another try later this year, if I find some time. Thanks for reminding me. :)

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

Re: Endgame Evaluation help!

Post by Tord Romstad »

Zach Wegner wrote:Things like this give me a lot of respect for people like Tord who can just scrap everything and start over. That's unthinkable for me to do now...
I don't like it any more than you do. Writing the low-level parts of a chess program from scratch isn't very hard or time-consuming, but it's awfully boring. But to me, tuning, tweaking and testing a reasonably strong chess program in an attempt to make it even stronger is just as boring. Developing a chess program is fun as long as improvements are cheap, and all "obvious" improvements really improve playing strength. When most of the changes I test show little or no improvement in strength, I quickly get bored. The choice is not between continuing to work on my old code or start from scratch, but between continuing to work on my old code or spending my time on some other hobby.

Another point is that I've never learned C/C++ programming, and am learning (very slowly) by doing. As I learn, my coding style constantly changes. This means that the old code gets more and more painful to work with, until I reach the point where I can no longer stand it.

Tord
Edsel Apostol
Posts: 803
Joined: Mon Jul 17, 2006 5:53 am
Full name: Edsel Apostol

Re: Endgame Evaluation help!

Post by Edsel Apostol »

I'm wondering about the definition of this "outside/distant passed pawns".

Is it similar to KingPasser or UnstoppablePasser from Fruit?
Edsel Apostol
Posts: 803
Joined: Mon Jul 17, 2006 5:53 am
Full name: Edsel Apostol

Re: Endgame Evaluation help!

Post by Edsel Apostol »

Hi Tord,

This about the bishop and knight outpost in your evaluation. Is it really helping strength wise? I don't have it yet. I'm planning to add it but like you I don't have enough time to test it so maybe a confirmation from you would be enough for me to implement it.