X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=516ff100868655264da9f18a7f2b6282eb61a474;hb=45ce92b89c9191f1606d82611620587157956e1b;hp=dcfb7d46aff3177d95fba2c1cfdc7e13f6ea922e;hpb=a2e924039bb96c0b923512dbb6903de9bb6bbd21;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index dcfb7d46..516ff100 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -681,7 +681,7 @@ namespace { ValueType vt; Value bestValue, value, oldAlpha; Value refinedValue, nullValue, futilityBase, futilityValueScaled; // Non-PV specific - bool isPvMove, inCheck, singularExtensionNode, givesCheck, captureOrPromotion, dangerous, isBadCap; + bool isPvMove, inCheck, singularExtensionNode, givesCheck, captureOrPromotion, dangerous; int moveCount = 0, playedMoveCount = 0; int threadID = pos.thread(); SplitPoint* sp = NULL; @@ -1023,16 +1023,6 @@ split_point_start: // At split points actual search starts from here } } - // Bad capture detection. Will be used by prob-cut search - isBadCap = depth >= 3 * ONE_PLY - && depth < 8 * ONE_PLY - && captureOrPromotion - && move != ttMove - && !dangerous - && !move_is_promotion(move) - && abs(alpha) < VALUE_MATE_IN_PLY_MAX - && pos.see_sign(move) < 0; - // Step 13. Make the move pos.do_move(move, st, ci, givesCheck); @@ -1076,7 +1066,13 @@ split_point_start: // At split points actual search starts from here // Probcut search for bad captures. If a reduced search returns a value // very below beta then we can (almost) safely prune the bad capture. - if (isBadCap) + if ( depth >= 3 * ONE_PLY + && depth < 8 * ONE_PLY + && mp.isBadCapture() + && move != ttMove + && !dangerous + && !move_is_promotion(move) + && abs(alpha) < VALUE_MATE_IN_PLY_MAX) { ss->reduction = 3 * ONE_PLY; Value rAlpha = alpha - 300; @@ -1983,13 +1979,16 @@ split_point_start: // At split points actual search starts from here TTEntry* tte; int ply = 1; - assert(pv[0] != MOVE_NONE && pos.move_is_legal(pv[0])); + assert(pv[0] != MOVE_NONE && pos.move_is_pl(pv[0])); pos.do_move(pv[0], *st++); + Bitboard pinned = pos.pinned_pieces(pos.side_to_move()); + while ( (tte = TT.probe(pos.get_key())) != NULL && tte->move() != MOVE_NONE - && pos.move_is_legal(tte->move()) + && pos.move_is_pl(tte->move()) + && pos.pl_move_is_legal(tte->move(), pinned) && ply < PLY_MAX && (!pos.is_draw() || ply < 2)) { @@ -2013,7 +2012,7 @@ split_point_start: // At split points actual search starts from here Value v, m = VALUE_NONE; int ply = 0; - assert(pv[0] != MOVE_NONE && pos.move_is_legal(pv[0])); + assert(pv[0] != MOVE_NONE && pos.move_is_pl(pv[0])); do { k = pos.get_key();