X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=b0e2c950fe7354c784cd14689ab7c3cbb7bed6b4;hp=cae89c6a929014ce9364c60a444f188a396341c7;hb=e51965aa57ddc50d04016e3622da49cf9f8e6238;hpb=54889618c20504f6ac636fc89b0db40d3def69cc diff --git a/src/search.cpp b/src/search.cpp index cae89c6a..b0e2c950 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -585,7 +585,7 @@ namespace { ss->ttMove = ttMove = RootNode ? RootMoves[PVIdx].pv[0] : ttHit ? tte->move() : MOVE_NONE; ttValue = ttHit ? value_from_tt(tte->value(), ss->ply) : VALUE_NONE; - // At non-PV nodes we check for a fail high/low. We don't probe at PV nodes + // At non-PV nodes we check for a fail high/low. We don't prune at PV nodes if ( !PvNode && ttHit && tte->depth() >= depth @@ -1437,8 +1437,16 @@ 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); } }