X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=0cbe09e007a1fa3e1c49337fc2919fcca8d909b5;hp=b86693289c8b2688070e74382a1b64c286528af2;hb=bd618941ce6586507a641724646b9fe6b211a1b1;hpb=c7a77dd3c01564c5d4bcd8029a1a48e18356df35 diff --git a/src/search.cpp b/src/search.cpp index b8669328..0cbe09e0 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -173,7 +173,7 @@ namespace { // If the TT move is at least SingleReplyMargin better then the // remaining ones we will extend it. - const Value SingleReplyMargin = Value(0x64); + const Value SingleReplyMargin = Value(0x20); // Margins for futility pruning in the quiescence search, and at frontier // and near frontier nodes. @@ -402,13 +402,13 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move, Problem = false; ExactMaxTime = maxTime; + if (button_was_pressed("New Game")) + loseOnTime = false; // reset at the beginning of a new game + // Read UCI option values TT.set_size(get_option_value_int("Hash")); if (button_was_pressed("Clear Hash")) - { TT.clear(); - loseOnTime = false; // reset at the beginning of a new game - } bool PonderingEnabled = get_option_value_bool("Ponder"); MultiPV = get_option_value_int("MultiPV"); @@ -677,6 +677,14 @@ namespace { // searchMoves are verified, copied, scored and sorted RootMoveList rml(p, searchMoves); + if (rml.move_count() == 0) + { + if (PonderSearch) + wait_for_stop_or_ponderhit(); + + return pos.is_check()? -VALUE_MATE : VALUE_DRAW; + } + // Print RootMoveList c'tor startup scoring to the standard output, // so that we print information also for iteration 1. std::cout << "info depth " << 1 << "\ninfo depth " << 1 @@ -1509,19 +1517,16 @@ namespace { continue; // Value based pruning - if (approximateEval < beta) - { - if (futilityValue == VALUE_NONE) - futilityValue = evaluate(pos, ei, threadID) + FutilityValueMargin; + if (futilityValue == VALUE_NONE) + futilityValue = evaluate(pos, ei, threadID) + FutilityValueMargin; - futilityValueScaled = futilityValue - moveCount * IncrementalFutilityMargin; + futilityValueScaled = futilityValue - moveCount * IncrementalFutilityMargin; - if (futilityValueScaled < beta) - { - if (futilityValueScaled > bestValue) - bestValue = futilityValueScaled; - continue; - } + if (futilityValueScaled < beta) + { + if (futilityValueScaled > bestValue) + bestValue = futilityValueScaled; + continue; } }