Skip to content

Commit 8c3a5bb

Browse files
Joona Kiiskizamar
authored andcommitted
Do not probe syzygy bases when castling is possible
Almost no functional change. Bench is unchanged. Resolves #230 Resolves #573
1 parent 28933a5 commit 8c3a5bb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/search.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,9 @@ void MainThread::search() {
256256
}
257257
else
258258
{
259-
if (TB::Cardinality >= rootPos.count<ALL_PIECES>(WHITE)
260-
+ rootPos.count<ALL_PIECES>(BLACK))
259+
if ( TB::Cardinality >= rootPos.count<ALL_PIECES>(WHITE)
260+
+ rootPos.count<ALL_PIECES>(BLACK)
261+
&& !rootPos.can_castle(ANY_CASTLING))
261262
{
262263
// If the current root position is in the tablebases, then RootMoves
263264
// contains only moves that preserve the draw or the win.
@@ -691,7 +692,8 @@ namespace {
691692

692693
if ( piecesCnt <= TB::Cardinality
693694
&& (piecesCnt < TB::Cardinality || depth >= TB::ProbeDepth)
694-
&& pos.rule50_count() == 0)
695+
&& pos.rule50_count() == 0
696+
&& !pos.can_castle(ANY_CASTLING))
695697
{
696698
int found, v = Tablebases::probe_wdl(pos, &found);
697699

0 commit comments

Comments
 (0)