diff --git a/src/history.h b/src/history.h index 259d6eefb..46914789e 100644 --- a/src/history.h +++ b/src/history.h @@ -36,7 +36,7 @@ namespace Stockfish { constexpr int PAWN_HISTORY_SIZE = 512; // has to be a power of 2 constexpr int CORRECTION_HISTORY_SIZE = 32768; // has to be a power of 2 constexpr int CORRECTION_HISTORY_LIMIT = 1024; -constexpr int LOW_PLY_HISTORY_SIZE = 4; +constexpr int LOW_PLY_HISTORY_SIZE = 5; static_assert((PAWN_HISTORY_SIZE & (PAWN_HISTORY_SIZE - 1)) == 0, "PAWN_HISTORY_SIZE has to be a power of 2"); diff --git a/src/movepick.cpp b/src/movepick.cpp index 1df0b0ccf..45bb8afe8 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -186,8 +186,12 @@ void MovePicker::score() { if (pos.capture_stage(m)) m.value = PieceValue[pos.piece_on(m.to_sq())] + (1 << 28); else + { m.value = (*mainHistory)[pos.side_to_move()][m.from_to()] + (*continuationHistory[0])[pos.moved_piece(m)][m.to_sq()]; + if (ply < LOW_PLY_HISTORY_SIZE) + m.value += 2 * (*lowPlyHistory)[ply][m.from_to()] / (1 + ply); + } } }