X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=b538897944ba7d174e17fdded262d8ddb719f0f4;hp=c80a064dfde82ba15f1eb98550d9eda5ebf11107;hb=69de6703539384b546dd38dda4da5dd33e84ec98;hpb=239d7b3fd144d2b493bb47ea97a436cec8ae5990 diff --git a/src/search.cpp b/src/search.cpp index c80a064d..b5388979 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -391,7 +391,8 @@ namespace { // Sort the PV lines searched so far and update the GUI sort(RootMoves.begin(), RootMoves.begin() + PVIdx + 1); - sync_cout << uci_pv(pos, depth, alpha, beta) << sync_endl; + if (PVIdx + 1 == PVSize || Time::now() - SearchTime > 3000) + sync_cout << uci_pv(pos, depth, alpha, beta) << sync_endl; } // Do we need to pick now the sub-optimal best move ? @@ -793,7 +794,7 @@ split_point_start: // At split points actual search starts from here { Signals.firstRootMove = (moveCount == 1); - if (thisThread == Threads.main_thread() && Time::now() - SearchTime > 2000) + if (thisThread == Threads.main_thread() && Time::now() - SearchTime > 3000) sync_cout << "info depth " << depth / ONE_PLY << " currmove " << move_to_uci(move, pos.is_chess960()) << " currmovenumber " << moveCount + PVIdx << sync_endl; @@ -892,7 +893,7 @@ split_point_start: // At split points actual search starts from here } // Check for legality only before to do the move - if (!pos.pl_move_is_legal(move, ci.pinned)) + if (!RootNode && !SpNode && !pos.pl_move_is_legal(move, ci.pinned)) { moveCount--; continue; @@ -1003,8 +1004,10 @@ split_point_start: // At split points actual search starts from here alpha = value; // Update alpha here! Always alpha < beta if (SpNode) sp->alpha = value; } - else // Fail high + else { + assert(value >= beta); // Fail high + if (SpNode) sp->cutoff = true; break; } @@ -1102,7 +1105,7 @@ split_point_start: // At split points actual search starts from here Key posKey; Move ttMove, move, bestMove; Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha; - bool givesCheck, enoughMaterial, evasionPrunable, fromNull; + bool givesCheck, enoughMaterial, evasionPrunable; Depth ttDepth; // To flag BOUND_EXACT a node with eval above alpha and no available moves @@ -1111,7 +1114,6 @@ split_point_start: // At split points actual search starts from here ss->currentMove = bestMove = MOVE_NONE; ss->ply = (ss-1)->ply + 1; - fromNull = (ss-1)->currentMove == MOVE_NULL; // Check for an instant draw or maximum ply reached if (pos.is_draw() || ss->ply > MAX_PLY) @@ -1149,12 +1151,7 @@ split_point_start: // At split points actual search starts from here } else { - if (fromNull) - { - ss->staticEval = bestValue = -(ss-1)->staticEval; - ss->evalMargin = VALUE_ZERO; - } - else if (tte) + if (tte) { assert(tte->static_value() != VALUE_NONE || Threads.size() > 1); @@ -1202,7 +1199,6 @@ split_point_start: // At split points actual search starts from here if ( !PvNode && !InCheck && !givesCheck - && !fromNull && move != ttMove && enoughMaterial && type_of(move) != PROMOTION @@ -1214,9 +1210,7 @@ split_point_start: // At split points actual search starts from here if (futilityValue < beta) { - if (futilityValue > bestValue) - bestValue = futilityValue; - + bestValue = std::max(bestValue, futilityValue); continue; } @@ -1224,7 +1218,10 @@ split_point_start: // At split points actual search starts from here if ( futilityBase < beta && depth < DEPTH_ZERO && pos.see(move) <= 0) + { + bestValue = std::max(bestValue, futilityBase); continue; + } } // Detect non-capture evasions that are candidate to be pruned