X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsearch.cpp;h=4f943b4c561f7394dad2ee8241bbfb60fce37c2f;hb=f907d5b7d93a161bc88aeaec403631de9de092f9;hp=aafbf80f94aef804009883e41bbfc8d28b96c3b6;hpb=ecd3218b6b24bb54509dbe6e9b24517b7df7390d;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index aafbf80f..4f943b4c 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -244,6 +244,7 @@ void MainThread::search() { Color us = rootPos.side_to_move(); Time.init(Limits, us, rootPos.game_ply()); + TT.new_search(); int contempt = Options["Contempt"] * PawnValueEg / 100; // From centipawns DrawValue[ us] = VALUE_DRAW - Value(contempt); @@ -347,7 +348,6 @@ void Thread::search() { EasyMove.clear(); mainThread->easyMovePlayed = mainThread->failedLow = false; mainThread->bestMoveChanges = 0; - TT.new_search(); } size_t multiPV = Options["MultiPV"]; @@ -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;