X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsearch.cpp;h=865e477144042c2a99577ac8179e066718016585;hb=aa0dc16b754f65e5f5b84c7500732476ca1f035b;hp=814a96d98cb66abed49d617566001b350d349798;hpb=e14046517ed0a690c0969b3ca8d1b0e25ac9fb9e;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 814a96d9..865e4771 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -902,7 +902,7 @@ moves_loop: // When in check and at SpNode search starts from here // Futility pruning: parent node if (predictedDepth < 7 * ONE_PLY) { - futilityValue = ss->staticEval + futility_margin(predictedDepth) + 256; + futilityValue = ss->staticEval + futility_margin(predictedDepth) + 256; if (futilityValue <= alpha) { @@ -959,7 +959,10 @@ moves_loop: // When in check and at SpNode search starts from here [pos.piece_on(to_sq(move))][to_sq(move)] <= VALUE_ZERO)) ss->reduction += ONE_PLY; - if (move == countermove) + if ( move == countermove + || ( History[pos.piece_on(to_sq(move))][to_sq(move)] > VALUE_ZERO + && CounterMovesHistory[pos.piece_on(prevMoveSq)][prevMoveSq] + [pos.piece_on(to_sq(move))][to_sq(move)] > VALUE_ZERO)) ss->reduction = std::max(DEPTH_ZERO, ss->reduction - ONE_PLY); // Decrease reduction for moves that escape a capture @@ -975,13 +978,6 @@ moves_loop: // When in check and at SpNode search starts from here value = -search(pos, ss+1, -(alpha+1), -alpha, d, true); - // Re-search at intermediate depth if reduction is very high - if (value > alpha && ss->reduction >= 4 * ONE_PLY) - { - Depth d2 = std::max(newDepth - 2 * ONE_PLY, ONE_PLY); - value = -search(pos, ss+1, -(alpha+1), -alpha, d2, true); - } - doFullDepthSearch = (value > alpha && ss->reduction != DEPTH_ZERO); ss->reduction = DEPTH_ZERO; } @@ -1432,7 +1428,7 @@ moves_loop: // When in check and at SpNode search starts from here } // Extra penalty for TT move in previous ply when it gets refuted - if (is_ok((ss-2)->currentMove) && (ss-1)->currentMove == (ss-1)->ttMove) + if (is_ok((ss-2)->currentMove) && (ss-1)->currentMove == (ss-1)->ttMove && !pos.captured_piece_type()) { Square prevPrevSq = to_sq((ss-2)->currentMove); HistoryStats& ttMoveCmh = CounterMovesHistory[pos.piece_on(prevPrevSq)][prevPrevSq];