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
{
Square prevPrevSq = to_sq((ss-2)->currentMove);
Followupmoves.update(pos.piece_on(prevPrevSq), prevPrevSq, move);
+
+ // 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);
}
}