Black to play and Draw, which engine can solve this Puzzle ?

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

Moderator: Ras

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

Re: Black to play and Draw, which engine can solve this Puzzle ?

Post by hgm »

You should not forget to also recognize KBPPK with doubled edge Pawn, or it would still not find Bh3. It is a common mistake to recognise drawish positions 9e.g. KRKN or KBK, but not those where the defending side is even stronger, but still behind in material (KRKNP or KBKP). Then the engines just work around the recognizer by refraining from capturing the extra Pawn, and still count themselves rich.
petero2
Posts: 730
Joined: Mon Apr 19, 2010 7:07 pm
Location: Sweden
Full name: Peter Osterlund

Re: How many engine above 3000 failed to select 3....Bh3!

Post by petero2 »

RubiChess wrote: Sun Jun 19, 2022 8:56 am ... and will finally implement correct KBPvK endgame evaluation in Rubi.
If you have a bitboard-based engine you can handle multiple bishops and multiple pawns almost for free, using suitable "bitwise and" operations. This way it should be possible for the evaluation function to know that the following position is at best a draw for white:
[fen]8/3n2k1/8/8/7P/5B1P/4B2P/6K1 w - - 0 1[/fen]


That is mostly of theoretical interest though.
User avatar
hgm
Posts: 28422
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Black to play and Draw, which engine can solve this Puzzle ?

Post by hgm »

Having all Pawns in the same edge files is something that can conveniently be stored in the Pawn hash (one flag for each promotion shade). The material table can then refer all single Bishop plus Pawns versus lesser combination to a recognizer that only has to test these flags, and when one is set, test the Bishop's shade. The common case would find neither flag set, and the overhead would stay limited to that. After which normal evaluation would take place. If the Bishop is of the wrong shade, a more complex test would have to be performed to see if the defending King can stop the Pawn. A simpler version would only catch the case with the defending King is onor next to the promotion square. This would require a few ply extra to see the draw for other positions. (But these can already be given a moderate discount.)

Same-colored Bishops is indeed only of theoretical interest. Some chess variants have multiple color-bound piece types, though. But there it would be important to detect the same-shade case in many other situations as well. But the material hash could record whether the piece combination lacks access to one of the shades. Also with two flags. By choosing the proper bitts for these flags this could limit the KBPK-like test to a single AND.
User avatar
RubiChess
Posts: 649
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: Black to play and Draw, which engine can solve this Puzzle ?

Post by RubiChess »

hgm wrote: Sun Jun 19, 2022 1:49 pm A simpler version would only catch the case with the defending King is onor next to the promotion square. This would require a few ply extra to see the draw for other positions. (But these can already be given a moderate discount.)
This is the way I will go. Berserk has a bitbase for exact evaluation of all KBPvK positions but searching some more plies is probably good enough here.

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

Re: Black to play and Draw, which engine can solve this Puzzle ?

Post by hgm »

This is what I usually do too. In general it is important to prevent a misevaluation can persist for a long time. (And material combinations that can go either way necessarily will be misevaluated in some of the cases.) E.g. in KPK you have to know that with the defending King 1 or 2 squares in front of the Pawn, or in opposition next to the Pawn path 2 or 3 ranks in front of the Pawn (with some exceptions on the promotion rank) is a draw. You can then evaluate all others as a win, as it never takes many moves to reach any of the recognized draw positions from those (if these can be reached at all). You can even prune the branch with a very-drawish score in the recognized positions. (You should not score them as zero, because then the engine would not have an incentive to try when it is the side that is ahead, and likely gives away the Pawn immediately; by applying a multiplier 1/32 or so the engine would still try to hang on to and advance the passer in an attempt to swindle a fallible opponent.)

Similar with KQKP, where 7th-rank a, c, f and h-Pawns with a King protecting the promotion square. Even without that knowledge a more general recognition of 'draws under promotion threat' is possible: you can keep a counter for how many times in a row you have moved the same piece. As soon as that counter reaches a modestly large value (like 6-8) you can score the position as drawish. Then, when you don't manage to drive the King in front of its Pawn with shallow tactics, so that you can approach your King (or another piece) to assist, the position will be recognized as a draw. This would even work in KQNKP.
Chessqueen
Posts: 5685
Joined: Wed Sep 05, 2018 2:16 am
Location: Moving
Full name: Jorge Picado

Not Too Many Engines Without EGTB Pick The Correct Bh3! Sac

Post by Chessqueen »

You can count with your right hand finger the Engines that pass this 6-pieces without EGTB Bh3! Bishop Sac test, there are NOT too many, Besides Komodo Dragon, Stockfish and all its derivatives or clones I have not tested Lela yet probably somebody will. Seer 2.5 did not chose the correct Bh3! in order to Draw.

NOTE: Please help me find other engines above 3400 that can find the Bh3! Sac
[pgn][Event "Computer chess game"]
[Site "DESKTOP-OFQ3C0P"]
[Date "2022.06.23"]
[Round "?"]
[White "Seer_v2.5_x64_avx2_popcnt"]
[Black "Seer_v2.5_x64_avx2_popcnt"]
[Result "*"]
[BlackElo "3440"]
[Time "17:24:25"]
[WhiteElo "3440"]
[TimeControl "900+10"]
[SetUp "1"]
[FEN "8/8/8/5bk1/8/5B2/6PP/6K1 b - - 0 1"]
[Termination "unterminated"]
[PlyCount "1"]
[WhiteType "program"]
[BlackType "program"]

1. ... Bd7 {(Bf5-d7 Kg1-f2 Kg5-h4 Kf2-e3 Kh4-g5 g2-g3 Bd7-h3 Ke3-e4 Bh3-d7
h2-h4+ Kg5-f6 Ke4-e3 Kf6-g7 Bf3-d1 Kg7-h8 Ke3-f4 Kh8-g7 Kf4-g5 Bd7-b5
Bd1-c2 Bb5-e2 Bc2-f5 Be2-d1 Bf5-d3 Bd1-b3 Bd3-b1 Bb3-d1 Bb1-f5 Bd1-e2
Bf5-g4 Be2-f1 Bg4-f3 Bf1-b5 Kg5-f4) -3.86/26 37} *[/pgn]
cc2150dx
Posts: 426
Joined: Sat Nov 30, 2013 9:51 am
Full name: Jason Coombs

Re: Not Too Many Engines Without EGTB Pick The Correct Bh3! Sac

Post by cc2150dx »

Modern Times
Posts: 3780
Joined: Thu Jun 07, 2012 11:02 pm

Re: Not Too Many Engines Without EGTB Pick The Correct Bh3! Sac

Post by Modern Times »

I couldn't care less what they may or may not find without EGTB, because anyone who is serious about chess uses them especially for analysing positions.
Chessqueen
Posts: 5685
Joined: Wed Sep 05, 2018 2:16 am
Location: Moving
Full name: Jorge Picado

Re: Not Too Many Engines Without EGTB Pick The Correct Bh3! Sac

Post by Chessqueen »

Modern Times wrote: Fri Jun 24, 2022 3:59 am I couldn't care less what they may or may not find without EGTB, because anyone who is serious about chess uses them especially for analysing positions.
This simple test only tell testers and us here that positions like this one with 6-pieces with EGTB of 6-pieces tablebase give you the wrong conclusion as what engine is more complete with more chess knowledge which include endgame knowledge, therefore, testing engines with more than 3-4-5 EGTB does not tell us what we really want to find out which engines has the most chess knowledge in general :roll:
Uri Blass
Posts: 11107
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Not Too Many Engines Without EGTB Pick The Correct Bh3! Sac

Post by Uri Blass »

What they find without tablebases may effect what they find with tablebases

I composed the following position when I am not sure if tablebases are going to help to find Re1+ Rf1 Rxf1+ Kxf1 Bh3

[fen]4r3/3p4/3p4/5bkP/8/5B2/5RPP/6K1 b - - 0 1 [/fen]