Is this rule safe (how has K&Ps vs K&Ps databases? t

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Is this rule safe (how has K&Ps vs K&Ps databases? t

Post by mjlef »

Here is a very old rule I have had in NOW:

If you are in a King and Pawns versus King and Pawns endgame AND
for each passed pawn, ignoring the other pawns, lookup the position of that passed pawn and the kings in a KPK database for both sides to move AND
if the position shows as a win for both sides to move, give a nice juicy bonus.

Is this safe? Can you think of exceptions? Can anyone test this with some KPK databases?

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

Re: Is this rule safe (how has K&Ps vs K&Ps database

Post by jwes »

mjlef wrote:Here is a very old rule I have had in NOW:

If you are in a King and Pawns versus King and Pawns endgame AND
for each passed pawn, ignoring the other pawns, lookup the position of that passed pawn and the kings in a KPK database for both sides to move AND
if the position shows as a win for both sides to move, give a nice juicy bonus.

Is this safe? Can you think of exceptions? Can anyone test this with some KPK databases?

Mark
Here is a won position that won't get the bonus.
[D]8/8/2p5/P2k4/8/1K6/8/8 w - - 0 1
rjgibert
Posts: 317
Joined: Mon Jun 26, 2006 9:44 am

Re: Is this rule safe (how has K&Ps vs K&Ps database

Post by rjgibert »

[D]8/4k3/6P1/4K3/1p6/p7/P7/8 w - - 0 1
Ignoring the Q-side pawns, White or Black to move would be a win for White. With the Q-side pawns, however, it is Black that will win with either side to move.
Tony

Re: Is this rule safe (how has K&Ps vs K&Ps database

Post by Tony »

mjlef wrote:Here is a very old rule I have had in NOW:

If you are in a King and Pawns versus King and Pawns endgame AND
for each passed pawn, ignoring the other pawns, lookup the position of that passed pawn and the kings in a KPK database for both sides to move AND
if the position shows as a win for both sides to move, give a nice juicy bonus.

Is this safe? Can you think of exceptions? Can anyone test this with some KPK databases?

Mark
Seems pretty safe. Not giving a bonus when it could isn't really a problem, giving one when it shouldn't, would be.

From memory, a exception of the latter would be a Fine position where black has an advance h-pawn (h5 ?), white an advanced c pawn (c6 ?). The white king is not in the square of one of the pawns, the black king in the square of the white pawn. However, by black moving Kh8-g7,f6 it moves between the 2 pawns (not making a choice to which pawn it's moving) and gets a draw by reaching the square of a pawn.

Your heuristic would score it as a win for black.

Tony
mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Re: Is this rule safe (how has K&Ps vs K&Ps database

Post by mjlef »

jwes wrote:
mjlef wrote:Here is a very old rule I have had in NOW:

If you are in a King and Pawns versus King and Pawns endgame AND
for each passed pawn, ignoring the other pawns, lookup the position of that passed pawn and the kings in a KPK database for both sides to move AND
if the position shows as a win for both sides to move, give a nice juicy bonus.

Is this safe? Can you think of exceptions? Can anyone test this with some KPK databases?

Mark
Here is a won position that won't get the bonus.
[D]8/8/2p5/P2k4/8/1K6/8/8 w - - 0 1
Thanks for the position. I did not mean for my rule to find all wins. By "safe" I meant if the rule thinks the position is likely to be a win, is it really a draw or loss. It is just meant to find some wins, not all of them. Of course, if you have some perfect K&Ps vs K&Ps rules, please send them to me! ;-)
mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Re: Is this rule safe (how has K&Ps vs K&Ps database

Post by mjlef »

rjgibert wrote:[D]8/4k3/6P1/4K3/1p6/p7/P7/8 w - - 0 1
Ignoring the Q-side pawns, White or Black to move would be a win for White. With the Q-side pawns, however, it is Black that will win with either side to move.
Great position. Maybe I can fix my rules by looking for pawns that could soon be passers for the other side, and not use the rule in this case. Thanks!

Mark
ed

Re: Is this rule safe (how has K&Ps vs K&Ps database

Post by ed »

You probably mean the Reti position.

http://en.wikipedia.org/wiki/Richard_R%C3%A9ti

Ed

Tony wrote:
mjlef wrote:Here is a very old rule I have had in NOW:

If you are in a King and Pawns versus King and Pawns endgame AND
for each passed pawn, ignoring the other pawns, lookup the position of that passed pawn and the kings in a KPK database for both sides to move AND
if the position shows as a win for both sides to move, give a nice juicy bonus.

Is this safe? Can you think of exceptions? Can anyone test this with some KPK databases?

Mark
Seems pretty safe. Not giving a bonus when it could isn't really a problem, giving one when it shouldn't, would be.

From memory, a exception of the latter would be a Fine position where black has an advance h-pawn (h5 ?), white an advanced c pawn (c6 ?). The white king is not in the square of one of the pawns, the black king in the square of the white pawn. However, by black moving Kh8-g7,f6 it moves between the 2 pawns (not making a choice to which pawn it's moving) and gets a draw by reaching the square of a pawn.

Your heuristic would score it as a win for black.

Tony
Tony

Re: Is this rule safe (how has K&Ps vs K&Ps database

Post by Tony »

That's the one yes.

Tony
User avatar
xsadar
Posts: 147
Joined: Wed Jun 06, 2007 10:01 am
Location: United States
Full name: Mike Leany

Re: Is this rule safe (how has K&Ps vs K&Ps database

Post by xsadar »

mjlef wrote:Here is a very old rule I have had in NOW:

If you are in a King and Pawns versus King and Pawns endgame AND
for each passed pawn, ignoring the other pawns, lookup the position of that passed pawn and the kings in a KPK database for both sides to move AND
if the position shows as a win for both sides to move, give a nice juicy bonus.

Is this safe? Can you think of exceptions? Can anyone test this with some KPK databases?

Mark
Mark,

What if ignored pawns block a king from getting to a passed pawn in time (to defend or capture it) but the king would be able to get to it if they weren't there? I'm not 100% certain that it could be a problem in the positions you describe, but it sounds plausible, so you may want to look at it to see if it's possible.

Mike Leany