1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Fix KBPK bug

With

position fen 7k/8/8/8/8/7P/6K1/7B w - - 0 1
go depth 25

The evaluation at depth 22 is not draw as it should be. The reason is that
when search reaches the position 8/6kP/8/8/8/3B4/6K1/8 w - - 0 1 if white plays
h8R or h8N then we get a position that is a "KNOWN_WIN" and is _not_ a check, so
futility pruning in qsearch kicks in and black may think that it is "futile"
to reply Kxh8 since, according to the logic of the code, it cannot raise the score
back towards a draw.

bench: 4728533
This commit is contained in:
Chris Caino 2013-08-24 10:05:48 +02:00 committed by Marco Costalba
parent b9f5d1c6ff
commit 5e331f9618

View file

@ -1230,6 +1230,7 @@ moves_loop: // When in check and at SpNode search starts from here
&& !givesCheck
&& move != ttMove
&& type_of(move) != PROMOTION
&& futilityBase > -VALUE_KNOWN_WIN
&& !pos.is_passed_pawn_push(move))
{
futilityValue = futilityBase