Skip to content

Commit

Permalink
Fix syzygy en passant issue
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mstembera authored and zamar committed Sep 6, 2015
1 parent 84a641b commit 46b5a5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/syzygy/tbprobe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 46b5a5f

Please sign in to comment.