without endgame table

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

without endgame table

Post by xr_a_y »

In this position

[d] 3k4/4r3/2R4P/4K1P1/8/3bB3/8/8 w - - 9 62

Weini playing white, without endgame table, at short TC, choose to defend with rook e6, black of course choose to exchange rooks after that.

There is a simple heuristic in Weini that says "you'd better exchange pieces if you have more pawn" ; and this is the case here ! But it failed badly ! as the resulting position is a draw.

Should I remove this heuristic or add something to detect this kind of "likely draw" position ?

Are they some engines, not using endgame table, that still have some draw detection code (that include positions with still some pieces on the board) I can have a look at ? Or should I go directly to syzygy implementation ?
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: without endgame table

Post by xr_a_y »

Ok Vajolet endgame.cpp is a good answer ...
ernest
Posts: 2041
Joined: Wed Mar 08, 2006 8:30 pm

Re: without endgame table

Post by ernest »

xr_a_y wrote: Wed Aug 08, 2018 3:39 pm In this position

[d] 3k4/4r3/2R4P/4K1P1/8/3bB3/8/8 w - - 9 62

...as the resulting position is a draw.
??? :roll:
Stupid example, after the exchange White wins !!!

Of course, after Re6 ...Kd7! draw
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: without endgame table

Post by xr_a_y »

my bad, black king moves before the actual exchange (kd7)

https://lichess.org/OWsI66r0#122
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: without endgame table

Post by xr_a_y »

xr_a_y wrote: Wed Aug 08, 2018 3:54 pm Ok Vajolet endgame.cpp is a good answer ...
and eval_draw.cpp in Rodent_III has some nice code.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: without endgame table

Post by xr_a_y »

and of course endgame.cpp in stockfish ... ok I have some code to read ...
User avatar
hgm
Posts: 27772
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: without endgame table

Post by hgm »

The heuristic is in general good. When you have KRRPPKRR it would certainly be good strategy to simplify to KRPPKR. But in addition you should have code to recognize drawish end-games. Unlike Bishops is a special case of those, and the score of such end-games with an imbalance of 2 or fewer Pawns should be discounted by a factor ~2. So effectively the trade reduces the advantage from 2 Pawns to 1 Pawn, because in KBPPKB with unlike B it only counts half. This should be enough to outweigh the bonus for simplification.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: without endgame table

Post by xr_a_y »

I will try this tomorrow, thanks a lot.