X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=075aa9b4422d01d490e2a1a25196e8befe7d6002;hp=35160b9665a39d6ed99bae69da65940ebf9f049b;hb=37e9802411fa122eb140ada2edfc9df3be55dbb8;hpb=47f988f05fb86b0cd9187885b1cfa942addbeee6 diff --git a/src/search.cpp b/src/search.cpp index 35160b96..075aa9b4 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -62,10 +62,6 @@ namespace { // Different node types, used as template parameter enum NodeType { Root, PV, NonPV, SplitPointRoot, SplitPointPV, SplitPointNonPV }; - // Lookup table to check if a Piece is a slider and its access function - const bool Slidings[18] = { 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1 }; - inline bool piece_is_slider(Piece p) { return Slidings[p]; } - // Dynamic razoring margin based on depth inline Value razor_margin(Depth d) { return Value(512 + 16 * int(d)); } @@ -1020,8 +1016,12 @@ split_point_start: // At split points actual search starts from here && depth >= Threads.min_split_depth() && bestValue < beta && Threads.available_slave_exists(thisThread)) + { bestValue = Threads.split(pos, ss, alpha, beta, bestValue, &bestMove, depth, threatMove, moveCount, mp, NT); + if (bestValue >= beta) + break; + } } if (SpNode) @@ -1154,6 +1154,11 @@ split_point_start: // At split points actual search starts from here if (ss->staticEval == VALUE_NONE || ss->evalMargin == VALUE_NONE) // Due to a race ss->staticEval = bestValue = evaluate(pos, ss->evalMargin); } + else if ((ss-1)->currentMove == MOVE_NULL) + { + ss->staticEval = bestValue = -(ss-1)->staticEval; + ss->evalMargin = VALUE_ZERO; // Hack, we really don't know the value + } else ss->staticEval = bestValue = evaluate(pos, ss->evalMargin); @@ -1437,10 +1442,8 @@ split_point_start: // At split points actual search starts from here return true; } - // If the threat piece is a slider, don't prune safe moves which block it - if ( piece_is_slider(pos.piece_on(tfrom)) - && (between_bb(tfrom, tto) & mto) - && pos.see_sign(move) >= 0) + // Don't prune safe moves which block the threat path + if ((between_bb(tfrom, tto) & mto) && pos.see_sign(move) >= 0) return true; return false;