Seeing a promotion, but not playing it...

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Seeing a promotion, but not playing it...

Post by hgm »

jwes wrote:I have seen this effect, but it means that the evaluation is flawed, particularly in the position above which is totally won. Those regrouping moves that appear to cause the evaluation to drop, are actually improving the position, at least is the sense of bringing checkmate closer (which is really what is important), and so should have higher scores. Putting in a delayed loss bonus is hiding the problem rather than fixing it.
Again, you are absolutely right: the evaluation is not perfect. But with a perfect evaluation, a one-ply search is enough to play a perfect game. And in tablebase play we indeed have that.

But when there are more than 7 pieces on the board, even the top engines usually search deeper than 1 ply. In fact, the very reason they are top engines is jusually that they do search deeper than the others. Becaus when you search 20 ply, you whack an opponent that searches only 17 ply.

That search served no purpose at all, other than to 'hide' the problems in the evaluation. And the search that can hide such problems best is the superior search, and a search that cannot hide the problems at all is a crappy search.

This is why a good search needs a delayed-loss bonus. And let us know when you have 'fixed' your evaluation so that you can beat Rybka (or NEG, for that matter) with a one-ply search... :lol:
jesper_nielsen

Re: Seeing a promotion, but not playing it...

Post by jesper_nielsen »

hgm wrote:
jwes wrote:I have seen this effect, but it means that the evaluation is flawed, particularly in the position above which is totally won. Those regrouping moves that appear to cause the evaluation to drop, are actually improving the position, at least is the sense of bringing checkmate closer (which is really what is important), and so should have higher scores. Putting in a delayed loss bonus is hiding the problem rather than fixing it.
Again, you are absolutely right: the evaluation is not perfect. But with a perfect evaluation, a one-ply search is enough to play a perfect game. And in tablebase play we indeed have that.

But when there are more than 7 pieces on the board, even the top engines usually search deeper than 1 ply. In fact, the very reason they are top engines is jusually that they do search deeper than the others. Becaus when you search 20 ply, you whack an opponent that searches only 17 ply.

That search served no purpose at all, other than to 'hide' the problems in the evaluation. And the search that can hide such problems best is the superior search, and a search that cannot hide the problems at all is a crappy search.

This is why a good search needs a delayed-loss bonus. And let us know when you have 'fixed' your evaluation so that you can beat Rybka (or NEG, for that matter) with a one-ply search... :lol:
This is a really interesting discussion! :D

It made me kinda think about the correlation between search and evaluation.

The search tries to spot the errors in the evaluation, but at the same time the evaluation drives or guides the search. By using the hashtable best moves for move ordering, the evaluation is guiding the search to "Look in this direction first. This looks promising!"

Now in situations where the evalution function is really good, then the number of surprises discovered by the search are very small.

I guess that is why engines with a very good evaluation function, like Rybka and others, have a relatively stable PV output. Where as my own engine for example i many situations have an extremely fluctuating PV, causing a lot of PVS researches and a lot of wasted effort!

So if your evaluation continously pushes the search in the wrong direction, then why not try to fix it? :shock:

Then "fixing" the search afterwards is double good! Icing on the cake! :D

But maybe there is a third issue at work here: Move ordering (at the root?).

If the engine can see a forced promotion at depth 9, then the move leading to this should be the current best.
If the engine then finds a forced promotion for a different move, at depth 10, leading to the same evalution, then the move ordering becomes important. If the move ordeting at the root is kept, then the forcing move at depth 9 is still kept as the current best move, to be played when time is up. If the forcing move at depth 10 is instead chosen as the current best, then I think it opens up for situations like this, where the goal is continously pushed further ahead.

Am I making any sense?

One scenario where this issue becomes very important, is when returning mate scores. You need to be careful not to return a mate score, just because you see one! Make sure it is a faster mate than at the previous move, before breaking the search early.

By the way, Pupsi does not have "delayed-loss" in the search, and I have never had problems of pushing the win continously ahead. Well... not that I have ever seen, anyway! :D

Kind regards,
Jesper
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Seeing a promotion, but not playing it...

Post by metax »

hgm wrote:That search served no purpose at all, other than to 'hide' the problems in the evaluation. And the search that can hide such problems best is the superior search, and a search that cannot hide the problems at all is a crappy search.
You could see it the other way round: If we had the perfect search searching the whole game tree of chess, we would need no evaluation at all other than checking for mate, stalemate, threefold repetition and such. :D
Richard Allbert
Posts: 792
Joined: Wed Jul 19, 2006 9:58 am

Re: Seeing a promotion, but not playing it...

Post by Richard Allbert »

The eval in Jabba is pretty bare... that is one of the problems, because the winning promotion lines have the same score, irrespective of where the bishop is.

I could try to force it to play the winning line by making a psqt to guide the pieces correctly, but this seems a little fake :)

It's an interesting problem... try looking at similar positions with normal chess and playing through them with your engine in analysis mode. Especially KP vs KP with N/B.

I haven't solved it, yet, anyway. I was really worried about a buggy hash at first!

Richard
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: Seeing a promotion, but not playing it...

Post by jwes »

Richard Allbert wrote:The eval in Jabba is pretty bare... that is one of the problems, because the winning promotion lines have the same score, irrespective of where the bishop is.

I could try to force it to play the winning line by making a psqt to guide the pieces correctly, but this seems a little fake :)

It's an interesting problem... try looking at similar positions with normal chess and playing through them with your engine in analysis mode. Especially KP vs KP with N/B.

I haven't solved it, yet, anyway. I was really worried about a buggy hash at first!

Richard
I think a pst is a reasonable solution or a special evaluation for positions where forcing mate is the only problem or both.
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Seeing a promotion, but not playing it...

Post by hgm »

But that is exactly what causes the problem here. The 'special' PSTs for mating estimate a good score for the bare King if it is close to the center, and a poor score when it is in the corner. This is why the search likes to have the promotion as late as possible, to catch the opponent in the act as close to the corner as possible. Without actually seeing the mate, or having a tablebase for the mate, or having an eval that is essentially equivalent to the tablebase, this is very hard to prevent.

I guess the fact that this is Knightmate exacerbates the effect, because the 'king' can run to the center so fast.
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: Seeing a promotion, but not playing it...

Post by jwes »

hgm wrote:But that is exactly what causes the problem here. The 'special' PSTs for mating estimate a good score for the bare King if it is close to the center, and a poor score when it is in the corner. This is why the search likes to have the promotion as late as possible, to catch the opponent in the act as close to the corner as possible. Without actually seeing the mate, or having a tablebase for the mate, or having an eval that is essentially equivalent to the tablebase, this is very hard to prevent.

I guess the fact that this is Knightmate exacerbates the effect, because the 'king' can run to the center so fast.
Perhaps what is needed is a K+K table, e.g. a K on c3 for the winning side has a high value if the other K is on a1, but a relatively low value if the other K is on g6. A king distance term where minimizing the distance between the kings is rewarded also might be enough along with the PSTs.