Engine feature request...

Discussion of chess software programming and technical issues.

Moderator: Ras

gaard
Posts: 463
Joined: Mon Jun 07, 2010 3:13 am
Location: Holland, MI
Full name: Martin W

Engine feature request...

Post by gaard »

...if it does not already exist in a strong engine.

For us amateurs wanting to improve our chess, I was thinking something like taking the difference between the engine's best move and my chosen move, and if worse by some threshold, then output the components of the eval that caused that drop, for example, king safety, mobility, pawn structure, backward pawns, trapped bishop, etc. All within some fixed depth so that the analysis is within the tactical or positional understanding of the player, because it wouldn't do me any good to know that my move leads to a trapped bishop twenty ply deep if I am an amateur and can't look more than three moves ahead.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Engine feature request...

Post by bob »

That's a much harder problem than you imagine. Because the evaluation is not just a static number, it is a very complex combination of static terms, grafted onto a very complex tree search that can go well beyond 30 plies deep in milliseconds. It is not easy to take that PV/backed-up-score and produce some human-readable interpretation such as you might get from a good human chess player when he is trying to help you... To date, a couple of programs have tried this, and the results are totally laughable. Something that sounds like it was run thru babelfish several times until it becomes nonsensical sounding...
gaard
Posts: 463
Joined: Mon Jun 07, 2010 3:13 am
Location: Holland, MI
Full name: Martin W

Re: Engine feature request...

Post by gaard »

bob wrote:That's a much harder problem than you imagine. Because the evaluation is not just a static number, it is a very complex combination of static terms, grafted onto a very complex tree search that can go well beyond 30 plies deep in milliseconds. It is not easy to take that PV/backed-up-score and produce some human-readable interpretation such as you might get from a good human chess player when he is trying to help you... To date, a couple of programs have tried this, and the results are totally laughable. Something that sounds like it was run thru babelfish several times until it becomes nonsensical sounding...
I see. How about the positional aspect... you'd (I'd) think even a 1-ply static eval would offer something useful if averaged over enough positions where the user and engine differ?
User avatar
hgm
Posts: 28436
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Engine feature request...

Post by hgm »

I don't think this is possible in principle. A good engine's score for a move is the result of a deep search, and the position at the end of the PVlies so far from the root that its evaluation has no relation to the root evaluation itself, or of an alter native move. The user's move (when evaluated by the engine) will leed to a completely different position as the enginés move. And in constructing that path the engine has quite arbitrarily exchanged one kindofeval term for another. The PV is just one of thousands of paths that all give nearly the same total score. Some of these paths might end in King Safety +1.9, Material -2, another in King Safety -1.09, Material +1, because the opponent decided to sac a minor to ruin your King Safety in that branch, and not in the other.

The static eval is quite meaningless. You could do a move that wrecks your Pawn structure,but is the obvious move because it forks two pieces. Or move over a very poor edge square with a Knight to reach a winning central Knight outpost 4 ply later.
kbhearn
Posts: 411
Joined: Thu Dec 30, 2010 4:48 am

Re: Engine feature request...

Post by kbhearn »

On the one ply level you get something like the 'chessmaster natural language advice' (which is more or less going to make even a halfway competent amateur go 'duh' - comments like 'this move attacks black's queen with your bishop'). Beyond tactical mistakes, it's really hard to have an engine decide on which variations a human might consider interesting in order to demonstrate why it picked its PV (if 1. a4 is worse by a tenth of a pawn than 1. d4 does this mean 1. a4 is good enough that a human should be interested in detailed variations to show why picking d4 is better than a4? Not really, because to the human it seems strategically uninteresting - but on the other hand in many cases moves up to a full pawn worse or even outright losing a human might consider interesting). And as it tends to search deeper than humans in an average middlegame position, these variations are why it chooses its move moreso than the static evals along the way. And it certainly can't break it down to strategic reasons why it chooses the moves, in many cases it's just searching deep enough that what humans deduce through strategic concepts it's found the tactical validations for.

What you might be looking for is a significantly weaker engine designed specifically for the purpose you have in mind. And that in itself would be a lot of work.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Engine feature request...

Post by bob »

gaard wrote:
bob wrote:That's a much harder problem than you imagine. Because the evaluation is not just a static number, it is a very complex combination of static terms, grafted onto a very complex tree search that can go well beyond 30 plies deep in milliseconds. It is not easy to take that PV/backed-up-score and produce some human-readable interpretation such as you might get from a good human chess player when he is trying to help you... To date, a couple of programs have tried this, and the results are totally laughable. Something that sounds like it was run thru babelfish several times until it becomes nonsensical sounding...
I see. How about the positional aspect... you'd (I'd) think even a 1-ply static eval would offer something useful if averaged over enough positions where the user and engine differ?
If you could accept a 1 ply search, which basically means making a move and getting an eval back, this could be done. I have several DEBUG type options in Crafty that causes the eval to display a lot of stuff to help me debug when I need to understand what went into producing a score for a specific position. It is not particularly "human readable" as it assumes familiarity with the evaluation code inside crafty, but that could be done. But most chess moves are not chosen on raw positional considerations, they are chosen based on a blended combination of static eval + deep tactical verification. Getting all of that information into a very concise human-like explanation is anything but easy...
mike_bike_kite
Posts: 98
Joined: Tue Jul 26, 2011 12:18 am
Location: London

Re: Engine feature request...

Post by mike_bike_kite »

I'm not sure whether this helps or not but in my web based chess program (fun chess) you can click the title word "Fun" and it brings up all the score breakdowns for the current position and the rewards it would give itself for getting pieces to certain positions on the board. The display looks a bit like the "The matrix" when all the numbers change while it's thinking. Not sure whether this would improve your game at all and I'll also point out the program isn't that strong (default level is about 1600 ELO).

PS just keep clicking the word fun to return the display to normal.