It's a draw. But many of the top engines think that Kf5 wins for white. The engines that seem to have problems are Glaurung 2, Naum 2.2 and Rybka - Shredder and Hiarcs see that it's a draw. It's probably a position where the square of pawns rule breaks down. Anyway I thought it was of interest
Uri replied:
The main problem here is that glaurung does not see that the following is a draw
[D]4Q3/8/8/8/7K/8/1kp5/8 w - - 0 9
Uri
I agree with Uri but when I tested Trace 2 I came up against a fairly common problem... evaluation horizon effect...
T2 understands that Uri's example is drawn - however, she avoids capturing the h pawn so that her KPKQ evaluation doesn't kick in and return a draw. In the original position she scores Kf5 as +6.75 @ 26 ply depth.
Also, mighty Rybka 2.3.2a gets to 25 ply and scores Kf5 as +7.29
Evaluation horizon effect is a pain in the a$$ to solve. If I write a KPPKQ recognizer the same horizon effect will occur when there is KPPPKQ on the board. ... so I have to write a KPPPPKQ ... and so on...
Turn off EGBB and EGTB and see if your engine can solve it.
You don't need to 'solve' this kind of position, because if you are there it is too late, the game is drawn so displaying 0 or +7 is not important.
OTOH you don't want to get there so you can add some heuristics in your eval/recognizer :
if( board[c2] == black pawn )
score /= 2;
Now your engine won't want to go in a position with a black pawn on c2 if there are other good positions.
Also note that white can only do checks here, so if you handle that in your eval you know that the position is drawn.
Harald Johnsen wrote:You don't need to 'solve' this kind of position, because if you are there it is too late, the game is drawn so displaying 0 or +7 is not important.
OTOH you don't want to get there so you can add some heuristics in your eval/recognizer :
if( board[c2] == black pawn )
score /= 2;
Now your engine won't want to go in a position with a black pawn on c2 if there are other good positions.
Also note that white can only do checks here, so if you handle that in your eval you know that the position is drawn.
Ross Boyd wrote:T2 understands that Uri's example is drawn - however, she avoids capturing the h pawn so that her KPKQ evaluation doesn't kick in and return a draw. In the original position she scores Kf5 as +6.75 @ 26 ply depth.
I don't get this. After Kf5 black starts running with the Pawn, and the white King can only just step back into its square. So how are you _not_ going to take the h-Pawn? If you don't, it will be a Queen in 8 ply, so how do you ever get +6.75 at 26 ply? Only a branch that prevents black from promoting (or captures the Queen as soon as he does) could have a positive score.
If you want to put in end-game knowledge, the knowledgy you should have is that an a, c, f or h Pawn on the 7th supported by King without the opponent's King near, can only be stopped by sacrificing a Queen. It doesn't matter much if there are other Pawns on the board. If there are, but they are blaocked, it is just as drawn. Even if they have moves, they might not have enough moves.
So you should score the P on 7th supported by King as nearly a Queen, until the contrary can be shown. But you should search on, to try showing it.
Ross Boyd wrote:T2 understands that Uri's example is drawn - however, she avoids capturing the h pawn so that her KPKQ evaluation doesn't kick in and return a draw. In the original position she scores Kf5 as +6.75 @ 26 ply depth.
I don't get this. After Kf5 black starts running with the Pawn, and the white King can only just step back into its square. So how are you _not_ going to take the h-Pawn? If you don't, it will be a Queen in 8 ply, so how do you ever get +6.75 at 26 ply? Only a branch that prevents black from promoting (or captures the Queen as soon as he does) could have a positive score.
If you want to put in end-game knowledge, the knowledgy you should have is that an a, c, f or h Pawn on the 7th supported by King without the opponent's King near, can only be stopped by sacrificing a Queen. It doesn't matter much if there are other Pawns on the board. If there are, but they are blaocked, it is just as drawn. Even if they have moves, they might not have enough moves.
So you should score the P on 7th supported by King as nearly a Queen, until the contrary can be shown. But you should search on, to try showing it.
scoring a P on the 7th as nearly a queen is dangerous because in that case you may score drawn KRP vs KQ as clear advantage for the rook because RP=R+P=almost R+Q
You also may score lost KPP vs KBP as clear advantage for the pawns.
OK, my 'nearly Queen' scoring was specifically if the opponent only had a Queen. If he has a Rook he can always give the Rook for the Pawn, and so the Pawn obviously cannot be worth more than a Rook. So in general the rule should be "nearly the lowest enemy piece that can cover the promotion square" (so not a wrongly colored Bishop, and not Pawns).
That this still doesn't work for your example #1 doesn't worry me, as the reason here is an independent one, similar to why
[D]4K3/Q7/8/8/8/8/7r/6qk w
is not won, despite the fact that you already have the Queen there. So it doesn't prove that the Pawns isn't worth a Queen. Just that with a Queen you are often able to draw while behind seemingly decisive material.
Last edited by hgm on Sun Feb 03, 2008 10:40 pm, edited 1 time in total.
hgm wrote:OK, my 'nearly Queen' scoring was specifically if the opponent only had a Queen. If he has a Rook he can always give the Rook for the Pawn, and so the Pawn obviously cannot be worth more than a Rook. So in general the rule should be "nearly the lowest enemy piece that can cover the promotion square" (so not a wrongly colored Bishop, and not Pawns).
This solves the second diagram problem but
in my first diagram the opponent has only a queen but rook+pawn in the 7th are not better than the queen.
Ross Boyd wrote:T2 understands that Uri's example is drawn - however, she avoids capturing the h pawn so that her KPKQ evaluation doesn't kick in and return a draw. In the original position she scores Kf5 as +6.75 @ 26 ply depth.
I don't get this. After Kf5 black starts running with the Pawn, and the white King can only just step back into its square. So how are you _not_ going to take the h-Pawn? If you don't, it will be a Queen in 8 ply, so how do you ever get +6.75 at 26 ply? Only a branch that prevents black from promoting (or captures the Queen as soon as he does) could have a positive score.
If you want to put in end-game knowledge, the knowledgy you should have is that an a, c, f or h Pawn on the 7th supported by King without the opponent's King near, can only be stopped by sacrificing a Queen. It doesn't matter much if there are other Pawns on the board. If there are, but they are blaocked, it is just as drawn. Even if they have moves, they might not have enough moves.
So you should score the P on 7th supported by King as nearly a Queen, until the contrary can be shown. But you should search on, to try showing it.
Hi HG,
Regarding the h pawn, my brain must have been seriously tired. Yes, it doesn't make sense to let the h pawn run. Clearly I have some search bugs in T2 - its using some very aggressive reductive pruning so its probably just buggy.
What I'm trying to achieve is to write some heuristic interior node recognisers which can be relied on to return an accurate score and stop searching that branch any deeper. If its done properly it should make T2 stronger in the endgame.
For speed I want to avoid disk based EGTBs and for cache friendliness I want to avoid EGBBs.
But its nice to have the EGTBs to proof-read the accuracy of the heuristics.
Yes, it would be nice if you had recognizers that were so accurate that you could stop search immediately. But it might be a lot easier to make recognizers that only cut the search after being in the end-game a few moves. Like KRKR = draw if you are already in there 3 moves.