]> git.sesse.net Git - stockfish/commitdiff
Fix syzygy en passant issue
authormstembera <MissingEmail@email>
Wed, 2 Sep 2015 00:36:03 +0000 (17:36 -0700)
committerJoona Kiiski <joona.kiiski@gmail.com>
Sun, 6 Sep 2015 21:19:33 +0000 (22:19 +0100)
v = value without ep capture being considered
v1 = value of the ep capture

The correct logic is:
if without e.p. capture we are losing, and the value of e.p is either draw, or win or "loss, but 50 move rule saves us", then we should use the value of ep capture.

Credit and thanks to syzygy1 and lantonov !

No functional change (except with syzygy bases)

Resolves #415
Resolves #394

src/syzygy/tbprobe.cpp

index 646176a9e7a6468eb76e03d35c2465d6041904cf..7bce67eabea8d1cb5e9d1632ae31de46b688bd5b 100644 (file)
@@ -624,7 +624,7 @@ int Tablebases::probe_dtz(Position& pos, int *success)
       if (v1 >= 0)
         v = v1;
     } else if (v < 0) {
-      if (v1 >= 0 || v1 < 100)
+      if (v1 >= 0 || v1 < -100)
         v = v1;
     } else if (v > 100) {
       if (v1 > 0)