X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=ed18936f760eb71cb7450daa8c12279f7d3f1ef0;hp=4408475341ac9deea60df927609c4bfd61e79ae0;hb=63a04134d0841bb362f42d600faf614038fff494;hpb=be9aba2fa0b9c9fa1d55a3c9bc87def967fa5911 diff --git a/src/search.cpp b/src/search.cpp index 44084753..ed18936f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -780,8 +780,18 @@ namespace { : can_return_tt(tte, depth, beta, ss->ply))) { TT.refresh(tte); - ss->bestMove = ttMove; // Can be MOVE_NONE - return value_from_tt(tte->value(), ss->ply); + ss->bestMove = move = ttMove; // Can be MOVE_NONE + value = value_from_tt(tte->value(), ss->ply); + + if ( value >= beta + && move + && !pos.move_is_capture_or_promotion(move) + && move != ss->killers[0]) + { + ss->killers[1] = ss->killers[0]; + ss->killers[0] = move; + } + return value; } // Step 5. Evaluate the position statically and update parent's gain statistics @@ -1539,8 +1549,8 @@ split_point_start: // At split points actual search starts from here Piece p1, p2; Square ksq; - assert(m1 && move_is_ok(m1)); - assert(m2 && move_is_ok(m2)); + assert(move_is_ok(m1)); + assert(move_is_ok(m2)); // Case 1: The moving piece is the same in both moves f2 = move_from(m2); @@ -1616,7 +1626,7 @@ split_point_start: // At split points actual search starts from here bool connected_threat(const Position& pos, Move m, Move threat) { assert(move_is_ok(m)); - assert(threat && move_is_ok(threat)); + assert(move_is_ok(threat)); assert(!pos.move_is_capture_or_promotion(m)); assert(!pos.move_is_passed_pawn_push(m));