I've noticed that Lozza often finds herself left with a A|H pawn and a bishop of the opposite colour to the promotion square, against a bare King. And thinks she is up when in fact it's a draw and can be evaluated as such.
I'm about to code this in eval, but just wondering if it's a specific case of something more generic; any buzz words/phrases I can search for in the wiki/forums etc...?
A|H pawn && wrong bishop v K
Moderator: Ras
-
- Posts: 550
- Joined: Tue Feb 04, 2014 12:25 pm
- Location: Gower, Wales
- Full name: Colin Jenkins
-
- Posts: 28361
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: A|H pawn && wrong bishop v K
It is one of the infamous cases where the naive evaluation does not work, and which is encountered reasonably often. (Especially against opponents that know about it!) Just like KNNK or KBK. But the latter can be recognized by material composition only, while this one requires you to look where the pieces are.
There is a somewhat similar case in KNPK, when a rook-Pawn is already on 7th rank and the defending King before it. The attacking King can then never protect the Pawn without stalemating you, so the Knight can never move without losing the Pawn to drive you away. But because it requires the Knight and Pawn to be in a very specific place, it is very rare compared to KBPK. One funny thing about this: engines that do not know about under-promotion can lose this, because they sooner or later leave the promotion square unprotected, counting on being stalemated when the opponent promotes to Q.
Other often encountered end-games where the engine 'reckons itself rich' are the drawn positions in KQKP and KPK. So it also pays to have recognizers for those.
There is a somewhat similar case in KNPK, when a rook-Pawn is already on 7th rank and the defending King before it. The attacking King can then never protect the Pawn without stalemating you, so the Knight can never move without losing the Pawn to drive you away. But because it requires the Knight and Pawn to be in a very specific place, it is very rare compared to KBPK. One funny thing about this: engines that do not know about under-promotion can lose this, because they sooner or later leave the promotion square unprotected, counting on being stalemated when the opponent promotes to Q.

Other often encountered end-games where the engine 'reckons itself rich' are the drawn positions in KQKP and KPK. So it also pays to have recognizers for those.
-
- Posts: 550
- Joined: Tue Feb 04, 2014 12:25 pm
- Location: Gower, Wales
- Full name: Colin Jenkins
Re: A|H pawn && wrong bishop v K
OK thx HG I'll hardwire it with some twiddly bits for king distance etc. And then look the others you mention.
-
- Posts: 28361
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: A|H pawn && wrong bishop v K
I found that it is pretty tricky to recognize any drawn cases other than where the defending King is in front of the Pawn on the rook- or knight file. In particular
[d]8/8/P1k5/B7/8/8/8/7K b
forces you to leave the Pawn's 'square' by zugzwang. And
[d]2k5/8/P7/4B3/8/8/8/7K b
likewise. So you can lose even when you are within the square, and much closer to the promotion square than the attacking King.
[d]8/8/P1k5/B7/8/8/8/7K b
forces you to leave the Pawn's 'square' by zugzwang. And
[d]2k5/8/P7/4B3/8/8/8/7K b
likewise. So you can lose even when you are within the square, and much closer to the promotion square than the attacking King.
-
- Posts: 550
- Joined: Tue Feb 04, 2014 12:25 pm
- Location: Gower, Wales
- Full name: Colin Jenkins
Re: A|H pawn && wrong bishop v K
Ah - yes, thanks, not as simple as I thought..
-
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
Re: A|H pawn && wrong bishop v K
The buzz phrase would be "blind bishop". I don't think it's a specific case of something more generic.op12no2 wrote:I've noticed that Lozza often finds herself left with a A|H pawn and a bishop of the opposite colour to the promotion square, against a bare King. And thinks she is up when in fact it's a draw and can be evaluated as such.
I'm about to code this in eval, but just wondering if it's a specific case of something more generic; any buzz words/phrases I can search for in the wiki/forums etc...?
-
- Posts: 1494
- Joined: Thu Mar 30, 2006 2:08 pm
Re: A|H pawn && wrong bishop v K
This is true no matter how many pawns are on the rook file. So you might want to make your conditions general enough to cover that.op12no2 wrote:I've noticed that Lozza often finds herself left with a A|H pawn and a bishop of the opposite colour to the promotion square, against a bare King. And thinks she is up when in fact it's a draw and can be evaluated as such.
I'm about to code this in eval, but just wondering if it's a specific case of something more generic; any buzz words/phrases I can search for in the wiki/forums etc...?
-
- Posts: 286
- Joined: Mon Jun 03, 2013 7:05 pm
- Location: Italy
Re: A|H pawn && wrong bishop v K
When I wanted to code some endgame knowledge in my engine, I remember someone gave me a list of known endgames. There were positions drawn and won, and some were pretty crazy.... I remember this one [d]8/8/8/n7/R5K1/8/8/k7 b - -
and the others were along this wave length.... Well, even before trying to write any single line of code I resigned, because there were too much variations on the theme, and I thought it would not worth the effort... Since it's very hard to evaluate correctly all these positions, I preferred the easier route of recognizing the known draw positions (eg KBPk with bishop wrong corner color and king already in the corner) and let the search do the rest by scaling down the (winning) score down to around 50cp... If the engine can promote the pawn, well, it will see the score jump and will win the game. However, landing in such positions in qsearch at hight depths will lead to errors, because the engine will not have the time to figure out (with search) the real game outcome.... but at least your engine will keep on trying to win... Or at least this is how I think it is when the engine has advantage.... On the other hand, it will lead to a disaster if the position of the engine is lost (eg the bare king) because it will see a score jump from -4.00 up to -0.50 and will of course take that route.........
and the others were along this wave length.... Well, even before trying to write any single line of code I resigned, because there were too much variations on the theme, and I thought it would not worth the effort... Since it's very hard to evaluate correctly all these positions, I preferred the easier route of recognizing the known draw positions (eg KBPk with bishop wrong corner color and king already in the corner) and let the search do the rest by scaling down the (winning) score down to around 50cp... If the engine can promote the pawn, well, it will see the score jump and will win the game. However, landing in such positions in qsearch at hight depths will lead to errors, because the engine will not have the time to figure out (with search) the real game outcome.... but at least your engine will keep on trying to win... Or at least this is how I think it is when the engine has advantage.... On the other hand, it will lead to a disaster if the position of the engine is lost (eg the bare king) because it will see a score jump from -4.00 up to -0.50 and will of course take that route.........
-
- Posts: 550
- Joined: Tue Feb 04, 2014 12:25 pm
- Location: Gower, Wales
- Full name: Colin Jenkins
Re: A|H pawn && wrong bishop v K
Thanks for the replies. I did a quick experiment by adding an else clause to unstoppable passers:-
Code: Select all
else if (numPieces == 4 && wNumBishops && wNumPawns && bKingRank > rank) {
if (file == 1 && wBBishop && (bKingFile == 1 || bKingFile == 2))
return CONTEMPT;
if (file == 8 && wWBishop && (bKingFile == 7 || bKingFile == 8))
return CONTEMPT;
}
-
- Posts: 28361
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: A|H pawn && wrong bishop v K
When the white King can keep you away from the promotion square it is also lost:
[d]8/K7/8/8/kB6/P7/8/8 w - -- 0 1
[d]6K1/8/5k2/8/1B6/P7/8/8 w - -- 0 1
[d]8/K7/8/8/kB6/P7/8/8 w - -- 0 1
[d]6K1/8/5k2/8/1B6/P7/8/8 w - -- 0 1
Last edited by hgm on Tue Sep 22, 2015 11:45 am, edited 2 times in total.