X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=51d3ae8cba3910b48301adab0507316e09acb850;hp=8f3c4552076e69951b1def82695fa7638ed54951;hb=27ba611a3da37423a3502e49beeebe11c9a11d8e;hpb=ebc563059c5fc103ca6d79edb04bb6d5f182eaf5 diff --git a/src/search.cpp b/src/search.cpp index 8f3c4552..51d3ae8c 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -335,7 +335,7 @@ void Thread::search() { MainThread* mainThread = (this == Threads.main() ? Threads.main() : nullptr); std::memset(ss-4, 0, 7 * sizeof(Stack)); - for(int i = 4; i > 0; i--) + for (int i = 4; i > 0; i--) (ss-i)->history = &this->counterMoveHistory[NO_PIECE][0]; // Use as sentinel bestValue = delta = alpha = -VALUE_INFINITE; @@ -784,9 +784,7 @@ namespace { && abs(beta) < VALUE_MATE_IN_MAX_PLY) { Value rbeta = std::min(beta + 200, VALUE_INFINITE); - Depth rdepth = depth - 4 * ONE_PLY; - assert(rdepth >= ONE_PLY); assert(is_ok((ss-1)->currentMove)); MovePicker mp(pos, ttMove, rbeta - ss->staticEval); @@ -797,8 +795,9 @@ namespace { ss->currentMove = move; ss->history = &thisThread->counterMoveHistory[pos.moved_piece(move)][to_sq(move)]; + assert(depth >= 5 * ONE_PLY); pos.do_move(move, st); - value = -search(pos, ss+1, -rbeta, -rbeta+1, rdepth, !cutNode, false); + value = -search(pos, ss+1, -rbeta, -rbeta+1, depth - 4 * ONE_PLY, !cutNode, false); pos.undo_move(move); if (value >= rbeta) return value;