diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 703cf869..2d0df89c 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -1048,6 +1048,8 @@ make_v: Value Eval::evaluate(const Position& pos, int* complexity) { + assert(!pos.checkers()); + Value v; Value psq = pos.psq_eg_stm(); diff --git a/src/search.cpp b/src/search.cpp index fba9685b..5d54a15d 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -295,10 +295,12 @@ void Thread::search() { if (mainThread) { - int rootComplexity; - Eval::evaluate(rootPos, &rootComplexity); - - mainThread->complexity = std::min(1.03 + (rootComplexity - 241) / 1552.0, 1.45); + if (!rootPos.checkers()) + { + int rootComplexity; + Eval::evaluate(rootPos, &rootComplexity); + mainThread->complexity = std::min(1.03 + (rootComplexity - 241) / 1552.0, 1.45); + } if (mainThread->bestPreviousScore == VALUE_INFINITE) for (int i = 0; i < 4; ++i) diff --git a/src/thread.cpp b/src/thread.cpp index c680393e..202768c8 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -160,6 +160,7 @@ void ThreadPool::clear() { main()->bestPreviousScore = VALUE_INFINITE; main()->bestPreviousAverageScore = VALUE_INFINITE; main()->previousTimeReduction = 1.0; + main()->complexity = 1.0; }