X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsearch.cpp;h=c5da0d4f7473d512ef582b89f438296317faa54c;hb=ac8e6ff000d3d990ae07297ec60e33a9cfb513b1;hp=b0e2c950fe7354c784cd14689ab7c3cbb7bed6b4;hpb=e51965aa57ddc50d04016e3622da49cf9f8e6238;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index b0e2c950..c5da0d4f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -964,7 +964,9 @@ moves_loop: // When in check and at SpNode search starts from here ss->reduction = reduction(improving, depth, moveCount); if ( (!PvNode && cutNode) - || History[pos.piece_on(to_sq(move))][to_sq(move)] < VALUE_ZERO) + || 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)] + + History[pos.piece_on(to_sq(move))][to_sq(move)] < VALUE_ZERO) ss->reduction += ONE_PLY; if (move == countermoves[0] || move == countermoves[1]) @@ -1437,16 +1439,12 @@ moves_loop: // When in check and at SpNode search starts from here if (is_ok((ss-2)->currentMove) && (ss-1)->currentMove == (ss-1)->ttMove) { - Value bonus2 = Value(((depth+1) / ONE_PLY) * ((depth+1) / ONE_PLY)); - Square prevPrevSq = to_sq((ss-2)->currentMove); Followupmoves.update(pos.piece_on(prevPrevSq), prevPrevSq, move); - Square prevMoveSq = to_sq((ss-1)->currentMove); - Piece prevMovePiece = pos.piece_on(prevMoveSq); - - HistoryStats& cmh2 = CounterMovesHistory[pos.piece_on(prevPrevSq)][prevPrevSq]; - cmh2.update(prevMovePiece, prevMoveSq, -bonus2); + // Extra penalty for TT move in previous ply when it gets refuted + HistoryStats& ttMoveCmh = CounterMovesHistory[pos.piece_on(prevPrevSq)][prevPrevSq]; + ttMoveCmh.update(pos.piece_on(prevSq), prevSq, -bonus - 2 * depth / ONE_PLY - 1); } }