X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=5205126aeba202ac2fb4663bcf9b9e5c4561cac5;hp=a739b0491c7a9eae9219ba7e404c83483d04c692;hb=86347100a5c1113e9306d63a16cde2866839373b;hpb=8e9d4081ee9def12f50dbd3169b765839fcb4c86 diff --git a/src/search.cpp b/src/search.cpp index a739b049..5205126a 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -569,6 +569,7 @@ namespace { TT.refresh(tte); ss->currentMove = ttMove; // Can be MOVE_NONE + // Update killers, history, and counter move on TT hit if ( ttValue >= beta && ttMove && !pos.capture_or_promotion(ttMove) @@ -576,6 +577,15 @@ namespace { { ss->killers[1] = ss->killers[0]; ss->killers[0] = ttMove; + + Value bonus = Value(int(depth) * int(depth)); + History.update(pos.moved_piece(ttMove), to_sq(ttMove), bonus); + + if (is_ok((ss-1)->currentMove)) + { + Square prevMoveSq = to_sq((ss-1)->currentMove); + Countermoves.update(pos.piece_on(prevMoveSq), prevMoveSq, ttMove); + } } return ttValue; }