Skip to content

Commit

Permalink
Texel: Fixed syzygy probing bug. See official-stockfish/Stockfish#394.
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/petero/vc/svnrepos/texel/trunk@545 4abc0a36-5a1e-4bec-8e7d-414f7125f69d
  • Loading branch information
peterosterlund2 committed Nov 5, 2017
1 parent 525096a commit f36e5be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion texellib/src/syzygy/rtb-probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ int Syzygy::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
6 changes: 6 additions & 0 deletions texellibtest/src/tbTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ TBTest::rtbTest() {
ASSERT(resDTZ);
ASSERT_EQUAL(0, wdl);
ASSERT_EQUAL(0, dtz);

pos = TextIO::readFEN("6k1/8/5Q2/6K1/6Pp/8/8/7Q b - g3 0 1");
int success;
dtz = Syzygy::probe_dtz(pos, &success);
ASSERT_EQUAL(1, success);
ASSERT_EQUAL(-2, dtz);
}

/** Test TBProbe::tbProbe() function. */
Expand Down

0 comments on commit f36e5be

Please sign in to comment.