]> git.sesse.net Git - stockfish/blobdiff - src/movepick.h
Enhance some comments
[stockfish] / src / movepick.h
index f210f5387fcb222bb8a0728e4a9e413a2a7b583b..f058ff0ee888fe8899ea0dcc70bd128dfe02ef8c 100644 (file)
 
 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); }
 
@@ -116,7 +119,7 @@ using PieceToHistory = Stats<int16_t, 29952, PIECE_NB, SQUARE_NB>;
 // (~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