Clean up previous patch
authorMarco Costalba <mcostalba@gmail.com>
Wed, 25 Mar 2015 05:47:40 +0000 (06:47 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 25 Mar 2015 06:05:27 +0000 (07:05 +0100)
No functional change.

src/search.cpp

index b0e2c95..085bca3 100644 (file)
@@ -1437,16 +1437,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);
     }
   }