]> git.sesse.net Git - stockfish/commit
Improve endgame KBN vs K (#1877)
authorprotonspring <mike@whiteley.org>
Mon, 17 Dec 2018 17:25:25 +0000 (10:25 -0700)
committerStéphane Nicolet <cassio@free.fr>
Mon, 24 Dec 2018 09:44:38 +0000 (10:44 +0100)
commit96ac85b3196ed7369a91a0852da0adcaf05a04b3
treeffa64c0600a1032fc4217f96f93cb99c92bc4822
parent2089c414dad595430432632cfe606b2cd6d701ab
Improve endgame KBN vs K (#1877)

Even when playing without endgame table bases, this particular endgame should
be a win 100% of the time when Stockfish is given a KRBK position, assuming
there are enough moves remaining in the FEN to finish the game without hitting
the 50 move rule.

PROBLEM: The issue with master here is that the PushClose difference per square
is 20, however, the difference in squares for the PushToCorners array is usually
less. Thus, the engine prefers to move the kings closer together rather than pushing
the weak king to the correct corner.

What happens is if the weak king is in a safe corner, SF still prefers pushing the
kings together. Occasionally, the strong king traps the weak king in the safe corner.
It takes a while for SF to figure it out, but often draws the game by the 50 move rule
(on shorter time controls).

This patch increases the PushToCorners values to correct this problem. We also added
an assert to catch any overflow problem if anybody would want to increase the array
values again in the future.

It was tested in a couple of matches starting with random KRBK positions and showed
increased winning rates, see https://github.com/official-stockfish/Stockfish/pull/1877

No functional change
src/endgame.cpp