difficult endgame test

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Alessandro Scotti

Re: difficult endgame test

Post by Alessandro Scotti »

It does not help that Hamsters thinks that both c2 and e5 are backward pawns, so white gets no penalty in fact.
Even tuning the passer bonus up does not help much, and I could never find a good formula for outside passers or even pawn races (I think most implementations are approximated anyway, but can lead to blunders sometimes even if they work well in the majority of cases).
So... for now it's one more entry in the list of unsolved positions... :?
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: difficult endgame test

Post by JVMerlino »

CM9_R1 finds the move in 13 seconds on a P4-3.0:

Code: Select all

Time	Depth	Score	Positions	Moves
0:00	1/8	1.92	4392		1...g6 2.hxg6 Kxg6 3.Kg3 Kf6 4.Kf2
					Kg6 5.Ke2 Kg5 6.Kf3
0:00	2/9	1.92	7091		1...g6 2.hxg6 Kxg6 3.Kg3 Kf6 4.Kf2
					Kg6 5.Ke2 Kg5 6.Kf3
0:00	3/10	2.94	20944		1...g6 2.hxg6 Kxg6 3.Kh4 Kf6 4.g5+
					Kf7 5.Kh5 Ke6 6.Kg4 Kd6 7.Kf5
0:00	3/10	2.76	24608		1...Kf6 2.Kh4 g5+ 3.Kg3 Kg7 4.Kf2
					Kh7 5.Ke2 Kh6 6.Kf3 Kg7
0:00	3/10	1.60	42421		1...c4 2.Kg3 cxd3 3.cxd3 Kf6 4.Kh4
					Ke6 5.g5 Kd6 6.Kg4 Ke6 7.Kf3
0:00	4/11	1.60	54739		1...c4 2.Kg3 cxd3 3.cxd3 Kf6 4.Kh4
					Ke6 5.g5 Kf7 6.Kg4 Ke6 7.Kf3
0:00	5/12	0.00	173786		1...c4 2.bxc4 a4 3.c5 a3 4.bxa3
					bxa3 5.c6 a2 6.c7 a1=Q 7.c8=Q Qh1+
					8.Kg3 Qg1+ 9.Kf3 Qf1+ 10.Kg3 Qf4+
					11.Kh3 Qf1+ 12.Kg3
0:01	6/13	0.00	267474		1...c4 2.bxc4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a3
					bxa3 5.c6 a2 6.c7 a1=Q 7.c8=Q Qh1+
					8.Kg3 Qg1+ 9.Kh3 Qf1+ 10.Kg3 Qf4+
					11.Kh3 Qf3+ 12.Kh2 Qf2+ 13.Kh1
					Qh4+ 14.Kg2 Qxg4+ 15.Qxg4+ Kxg4
					16.Kf2 Kxh5
0:43	11/18	-0.37	8224526		1...c4 2.bxc4 a4 3.c5 a3 4.bxa3
					bxa3 5.c6 a2 6.c7 a1=Q 7.c8=Q Qh1+
					8.Kg3 Qg1+ 9.Kh3 Qf1+ 10.Kg3 Qf4+
					11.Kh3 Qf3+ 12.Kh2 Qf2+ 13.Kh1
					Qh4+ 14.Kg2 Qxg4+ 15.Qxg4+ Kxg4
					16.Kf2 Kxh5
1:22	12/19	-0.43	16493243	1...c4 2.bxc4 a4 3.c5 a3 4.bxa3
					bxa3 5.c6 a2 6.c7 a1=Q 7.c8=Q Qh1+
					8.Kg3 Qg1+ 9.Kh3 Qf1+ 10.Kg3 Qf4+
					11.Kh3 Qf3+ 12.Kh2 Qf2+ 13.Kh1
					Qh4+ 14.Kg2 Qxg4+ 15.Qxg4+ Kxg4
					16.Kf2 Kxh5
jm
User avatar
smirobth
Posts: 2307
Joined: Wed Mar 08, 2006 8:41 pm
Location: Brownsville Texas USA

Re: difficult endgame test

Post by smirobth »

bob wrote:
Alessandro Scotti wrote:
bob wrote:I ran this with crafty... it finds this move at depth=11, .1 seconds, on my core2 duo laptop. by depth=18, .5 seconds, the score is in black's favor by 1/2 pawn.... by depth 21, it is 1.5 pawns in blacks favor, taking about 2 seconds...
Hamsters misses but it's all in the evaluation... I followed Crafty's PV up to the last pawn capture and king move:

[D]8/6p1/8/4p2k/3pP3/3P2K1/2P5/8 b - - 1 1

and here Crafty sees an advantage for black while Hamsters thinks this is even slightly better for white! :-(

How do you score the passed pawn g7 in this case?
It is winning. black advances the pawn and white has to take the time to capture it. Black abandons it at the right point and penetrates to eat the white pawn chain.
The method you describe is usually how to win with a passed pawn, and would of course also work here. However in this case an even faster and easier winning method is to advance the g pawn, supported by your king, until White's king would be stalemated (if he didn't have a pawn move). Then White is forced to advance his pawn, Black captures it and advances this second pawn to promote on c1 with mate.
- Robin Smith
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: difficult endgame test

Post by bob »

Alessandro Scotti wrote:
bob wrote:I'm not sure why your program would like white better. Black has a passed pawn. White has a weak pawn that can't move (backward). Black's king is in position to support its passer. Etc...
You are right... evaluation of this part sucks, but I've never been good in scoring passed pawns.

The tables below do not even award a bonus for a passer on its home square, and the max bonus for a pawn in 7th rank is 40 to 65... maybe a bit too conservative eh?

Code: Select all

const int PassedPawnBonus_Opening[8] = {
    0,  0,  5, 10, 15, 25, 40, 65
};

const int PassedPawnBonus_Endgame[8] = {
    0,  0, 10, 15, 25, 40, 65, 125
};
There are two separate issues here.

(1) passed pawn scoring. A passer on its home square is not very strong, but it should get some sort of bonus to avoid overlooking how important it might become.

(2) outside passed pawn. In Crafty, this is a bonus that is independent of the square the pawn stands on. It is a nearly winning advantage in most positions, and that's what is making Crafty find this so quickly...

these two terms are independently calculated and awarded in Crafty. And both are "scaled" upward as material comes off the board as well...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: difficult endgame test

Post by bob »

smirobth wrote:
bob wrote:
Alessandro Scotti wrote:
bob wrote:I ran this with crafty... it finds this move at depth=11, .1 seconds, on my core2 duo laptop. by depth=18, .5 seconds, the score is in black's favor by 1/2 pawn.... by depth 21, it is 1.5 pawns in blacks favor, taking about 2 seconds...
Hamsters misses but it's all in the evaluation... I followed Crafty's PV up to the last pawn capture and king move:

[D]8/6p1/8/4p2k/3pP3/3P2K1/2P5/8 b - - 1 1

and here Crafty sees an advantage for black while Hamsters thinks this is even slightly better for white! :-(

How do you score the passed pawn g7 in this case?
It is winning. black advances the pawn and white has to take the time to capture it. Black abandons it at the right point and penetrates to eat the white pawn chain.
The method you describe is usually how to win with a passed pawn, and would of course also work here. However in this case an even faster and easier winning method is to advance the g pawn, supported by your king, until White's king would be stalemated (if he didn't have a pawn move). Then White is forced to advance his pawn, Black captures it and advances this second pawn to promote on c1 with mate.
That won't quite work as described. If white is stalemated except for the pawn push, he pushes the pawn and now black can't take it or this is a repeat where now white has to push the other pawn, and if that one is taken, the game is drawn...

but here, g5 wins as easily as the king move, just to me the king move follows a known strategy for winning these, where if you remove the other pawns, g5 would turn this into an instant draw.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: difficult endgame test

Post by bob »

an outside passer is far safer to reward than things like a rook on the 7th, yet everyone does the latter, but not the former. :) outside passed pawns are a very common theme in endings. distant majorities are more difficult, but also need to be recognized for the very same reason. It is stupid to find a way to win a pawn but leave your opponent with a distant passer or distant candidate passer, which loses the game once the program searches deep enough to realize what it has done.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: difficult endgame test

Post by bob »

my only quibble is that it doesn't realize it is absolutely winning, and only thinks it has a small positional edge. It is totally winning.
Terry McCracken

Re: difficult endgame test

Post by Terry McCracken »

bob wrote:an outside passer is far safer to reward than things like a rook on the 7th, yet everyone does the latter, but not the former. :) outside passed pawns are a very common theme in endings. distant majorities are more difficult, but also need to be recognized for the very same reason. It is stupid to find a way to win a pawn but leave your opponent with a distant passer or distant candidate passer, which loses the game once the program searches deep enough to realize what it has done.
Are you talking about players or programs?

Somtimes you need a rook on the seventh to get the latter, or a quick mate! :wink:
User avatar
smirobth
Posts: 2307
Joined: Wed Mar 08, 2006 8:41 pm
Location: Brownsville Texas USA

Re: difficult endgame test

Post by smirobth »

bob wrote:
smirobth wrote:
bob wrote:
Alessandro Scotti wrote:
bob wrote:I ran this with crafty... it finds this move at depth=11, .1 seconds, on my core2 duo laptop. by depth=18, .5 seconds, the score is in black's favor by 1/2 pawn.... by depth 21, it is 1.5 pawns in blacks favor, taking about 2 seconds...
Hamsters misses but it's all in the evaluation... I followed Crafty's PV up to the last pawn capture and king move:

[D]8/6p1/8/4p2k/3pP3/3P2K1/2P5/8 b - - 1 1

and here Crafty sees an advantage for black while Hamsters thinks this is even slightly better for white! :-(

How do you score the passed pawn g7 in this case?
It is winning. black advances the pawn and white has to take the time to capture it. Black abandons it at the right point and penetrates to eat the white pawn chain.
The method you describe is usually how to win with a passed pawn, and would of course also work here. However in this case an even faster and easier winning method is to advance the g pawn, supported by your king, until White's king would be stalemated (if he didn't have a pawn move). Then White is forced to advance his pawn, Black captures it and advances this second pawn to promote on c1 with mate.
That won't quite work as described. If white is stalemated except for the pawn push, he pushes the pawn and now black can't take it or this is a repeat where now white has to push the other pawn, and if that one is taken, the game is drawn...

but here, g5 wins as easily as the king move, just to me the king move follows a known strategy for winning these, where if you remove the other pawns, g5 would turn this into an instant draw.
It works exactly as I described. After Black captures the first pawn (c-pawn) now White can push the d-pawn so it is still not stalemate. Black does not capture after White pushes the d-pawn ... he just runs the c-pawn down for mate.
- Robin Smith
Terry McCracken

Re: difficult endgame test

Post by Terry McCracken »

smirobth wrote:
bob wrote:
smirobth wrote:
bob wrote:
Alessandro Scotti wrote:
bob wrote:I ran this with crafty... it finds this move at depth=11, .1 seconds, on my core2 duo laptop. by depth=18, .5 seconds, the score is in black's favor by 1/2 pawn.... by depth 21, it is 1.5 pawns in blacks favor, taking about 2 seconds...
Hamsters misses but it's all in the evaluation... I followed Crafty's PV up to the last pawn capture and king move:

[D]8/6p1/8/4p2k/3pP3/3P2K1/2P5/8 b - - 1 1

and here Crafty sees an advantage for black while Hamsters thinks this is even slightly better for white! :-(

How do you score the passed pawn g7 in this case?
It is winning. black advances the pawn and white has to take the time to capture it. Black abandons it at the right point and penetrates to eat the white pawn chain.
The method you describe is usually how to win with a passed pawn, and would of course also work here. However in this case an even faster and easier winning method is to advance the g pawn, supported by your king, until White's king would be stalemated (if he didn't have a pawn move). Then White is forced to advance his pawn, Black captures it and advances this second pawn to promote on c1 with mate.
That won't quite work as described. If white is stalemated except for the pawn push, he pushes the pawn and now black can't take it or this is a repeat where now white has to push the other pawn, and if that one is taken, the game is drawn...

but here, g5 wins as easily as the king move, just to me the king move follows a known strategy for winning these, where if you remove the other pawns, g5 would turn this into an instant draw.
It works exactly as I described. After Black captures the first pawn (c-pawn) now White can push the d-pawn so it is still not stalemate. Black does not capture after White pushes the d-pawn ... he just runs the c-pawn down for mate.
Oh this is going to be interesting... :lol:

Yes Robin, you're correct.

Kasparov Sends His Regards... :wink: