namespace Stockfish {
-constexpr int PAWN_HISTORY_SIZE = 512;
+constexpr int PAWN_HISTORY_SIZE = 512; // has to be a power of 2
+
+static_assert((PAWN_HISTORY_SIZE & (PAWN_HISTORY_SIZE - 1)) == 0,
+ "PAWN_HISTORY_SIZE has to be a power of 2");
inline int pawn_structure(const Position& pos) { return pos.pawn_key() & (PAWN_HISTORY_SIZE - 1); }
// (~63 elo)
using ContinuationHistory = Stats<PieceToHistory, NOT_USED, PIECE_NB, SQUARE_NB>;
-// PawnStructureHistory is addressed by the pawn structure and a move's [piece][to]
+// PawnHistory is addressed by the pawn structure and a move's [piece][to]
using PawnHistory = Stats<int16_t, 8192, PAWN_HISTORY_SIZE, PIECE_NB, SQUARE_NB>;
// MovePicker class is used to pick one pseudo-legal move at a time from the