X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=3d26d430387e85faffa25d275d33b485978ee3b0;hp=2ab983970dcceb8f8466db7398b875ef9962709c;hb=cfb52fcd5d307fc0daf6045fc7e299b61fed1017;hpb=3a2cd370802db61dc3060b81d613444363cf0371 diff --git a/src/search.cpp b/src/search.cpp index 2ab98397..3d26d430 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -199,7 +199,7 @@ namespace { Depth PassedPawnExtension[2], PawnEndgameExtension[2], MateThreatExtension[2]; // Minimum depth for use of singular extension - const Depth SingularExtensionDepth[2] = { 7 * OnePly /* non-PV */, 6 * OnePly /* PV */}; + const Depth SingularExtensionDepth[2] = { 8 * OnePly /* non-PV */, 6 * OnePly /* PV */}; // If the TT move is at least SingularExtensionMargin better then the // remaining ones we will extend it. @@ -715,6 +715,7 @@ namespace { alpha = *alphaPtr; beta = *betaPtr; isCheck = pos.is_check(); + depth = (Iteration - 2) * OnePly + InitialDepth; // Step 1. Initialize node (polling is omitted at root) ss->currentMove = ss->bestMove = MOVE_NONE; @@ -764,7 +765,6 @@ namespace { captureOrPromotion = pos.move_is_capture_or_promotion(move); // Step 11. Decide the new search depth - depth = (Iteration - 2) * OnePly + InitialDepth; ext = extension(pos, move, captureOrPromotion, moveIsCheck, false, false, &dangerous); newDepth = depth + ext; @@ -970,7 +970,7 @@ namespace { Move movesSearched[256]; EvalInfo ei; StateInfo st; - const TTEntry *tte, *ttx; + const TTEntry *tte; Key posKey; Move ttMove, move, excludedMove, threatMove; Depth ext, newDepth; @@ -1168,7 +1168,7 @@ namespace { // Expensive mate threat detection (only for PV nodes) if (PvNode) - mateThreat = pos.has_mate_threat(opposite_color(pos.side_to_move())); + mateThreat = pos.has_mate_threat(); // Initialize a MovePicker object for the current position MovePicker mp = MovePicker(pos, ttMove, depth, H, ss, (PvNode ? -VALUE_INFINITE : beta)); @@ -1207,22 +1207,9 @@ namespace { && move == tte->move() && ext < OnePly) { - // Avoid to do an expensive singular extension search on nodes where - // such search have already been done in the past, so assume the last - // singular extension search result is still valid. - if ( !PvNode - && depth < SingularExtensionDepth[PvNode] + 5 * OnePly - && (ttx = TT.retrieve(pos.get_exclusion_key())) != NULL) - { - if (is_upper_bound(ttx->type())) - ext = OnePly; - - singularExtensionNode = false; - } - Value ttValue = value_from_tt(tte->value(), ply); - if (singularExtensionNode && abs(ttValue) < VALUE_KNOWN_WIN) + if (abs(ttValue) < VALUE_KNOWN_WIN) { Value b = ttValue - SingularExtensionMargin; ss->excludedMove = move; @@ -1910,7 +1897,7 @@ namespace { && pos.type_of_piece_on(move_to(m)) != PAWN && pos.see_sign(m) >= 0) { - result += OnePly/2; + result += OnePly / 2; *dangerous = true; } @@ -2035,7 +2022,7 @@ namespace { if ( m != MOVE_NULL && before != VALUE_NONE && after != VALUE_NONE - && pos.captured_piece() == NO_PIECE_TYPE + && pos.captured_piece_type() == PIECE_TYPE_NONE && !move_is_special(m)) H.set_gain(pos.piece_on(move_to(m)), move_to(m), -(before + after)); }