]> git.sesse.net Git - stockfish/commitdiff
Introduce a new counter move history penalty
authorVoyagerOne <excelgeek@gmail.com>
Tue, 24 Mar 2015 23:00:31 +0000 (23:00 +0000)
committerJoona Kiiski <joona.kiiski@gmail.com>
Tue, 24 Mar 2015 23:04:08 +0000 (23:04 +0000)
Extra penalty for TT move in previous ply when it gets refuted

STC:

LLR: 2.94 (-2.94,2.94) [-1.50,4.50]
Total: 31303 W: 6216 L: 6025 D: 19062

LTC:

LLR: 2.97 (-2.94,2.94) [0.00,6.00]
Total: 6950 W: 1189 L: 1054 D: 4707

Bench: 8191926

Resolves #309

src/search.cpp

index 4c60359cf9426434ddff9780a201999d79694c01..b0e2c950fe7354c784cd14689ab7c3cbb7bed6b4 100644 (file)
@@ -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)
     {
 
     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 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);
     }
   }
 
     }
   }