diff --git a/src/history.h b/src/history.h index f2ef7661..259d6eef 100644 --- a/src/history.h +++ b/src/history.h @@ -166,7 +166,7 @@ struct CorrHistTypedef { template using CorrectionHistory = typename Detail::CorrHistTypedef::type; -using TTMoveHistory = Stats; +using TTMoveHistory = StatsEntry; } // namespace Stockfish diff --git a/src/search.cpp b/src/search.cpp index 3f24f86c..0fecbce6 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -579,7 +579,7 @@ void Search::Worker::clear() { minorPieceCorrectionHistory.fill(0); nonPawnCorrectionHistory.fill(0); - ttMoveHistory.fill(0); + ttMoveHistory = 0; for (auto& to : continuationCorrectionHistory) for (auto& h : to) @@ -1151,10 +1151,10 @@ moves_loop: // When in check, search starts here if (value < singularBeta) { - int corrValAdj1 = std::abs(correctionValue) / 248873; - int corrValAdj2 = std::abs(correctionValue) / 255331; - int doubleMargin = 262 * PvNode - 188 * !ttCapture - corrValAdj1 - - ttMoveHistory[pawn_structure_index(pos)][us] / 128; + int corrValAdj1 = std::abs(correctionValue) / 248873; + int corrValAdj2 = std::abs(correctionValue) / 255331; + int doubleMargin = + 262 * PvNode - 188 * !ttCapture - corrValAdj1 - ttMoveHistory / 128; int tripleMargin = 88 + 265 * PvNode - 256 * !ttCapture + 93 * ss->ttPv - corrValAdj2; @@ -1450,8 +1450,8 @@ moves_loop: // When in check, search starts here bestMove == ttData.move, moveCount); if (!PvNode) { - int bonus = (ttData.move == move) ? 800 : -600 * moveCount; - ttMoveHistory[pawn_structure_index(pos)][us] << bonus; + int bonus = (ttData.move == move) ? 800 : -870; + ttMoveHistory << bonus; } }