X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=789492fd95225965194b8262affc992978ea53de;hb=bc6faf633e7f4d2c998f434a41ecfc9b80047607;hp=4ab17fd85ae80d82273841ffc08296763631f019;hpb=a71209868bdd8361d0607acf7725f70e9d1f2019;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 4ab17fd8..789492fd 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -609,8 +609,7 @@ namespace { // Can ttValue be used as a better position evaluation? if (ttValue != VALUE_NONE) - if ( ((tte->bound() & BOUND_LOWER) && ttValue > eval) - || ((tte->bound() & BOUND_UPPER) && ttValue < eval)) + if (tte->bound() & (ttValue > eval ? BOUND_LOWER : BOUND_UPPER)) eval = ttValue; } else @@ -830,13 +829,10 @@ moves_loop: // When in check and at SpNode search starts from here || pos.is_passed_pawn_push(move) || type_of(move) == CASTLE; - // Step 12. Extend checks and, in PV nodes, also dangerous moves - if (PvNode && dangerous) + // Step 12. Extend checks + if (givesCheck && pos.see_sign(move) >= 0) ext = ONE_PLY; - else if (givesCheck && pos.see_sign(move) >= 0) - ext = inCheck || ss->staticEval <= alpha ? ONE_PLY : ONE_PLY / 2; - // Singular extension search. If all moves but one fail low on a search of // (alpha-s, beta-s), and just one fails high on (alpha, beta), then that move // is singular and should be extended. To verify this we do a reduced search @@ -949,8 +945,11 @@ moves_loop: // When in check and at SpNode search starts from here if (!PvNode && cutNode) ss->reduction += ONE_PLY; + else if (History[pos.piece_on(to_sq(move))][to_sq(move)] < 0) + ss->reduction += ONE_PLY / 2; + if (move == countermoves[0] || move == countermoves[1]) - ss->reduction = std::max(DEPTH_ZERO, ss->reduction-ONE_PLY); + ss->reduction = std::max(DEPTH_ZERO, ss->reduction - ONE_PLY); Depth d = std::max(newDepth - ss->reduction, ONE_PLY); if (SpNode)