X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmovepick.h;h=9f18997406fe63c24dcb06eb9a0a136749d7e9a5;hb=d0e87104aa782176735442e1f6668f91014f07eb;hp=f210f5387fcb222bb8a0728e4a9e413a2a7b583b;hpb=b0658f09b93185e2b43d4b2d6f0daa30c36ebcc2;p=stockfish diff --git a/src/movepick.h b/src/movepick.h index f210f538..9f189974 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -32,7 +32,10 @@ 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; // (~63 elo) using ContinuationHistory = Stats; -// 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; // MovePicker class is used to pick one pseudo-legal move at a time from the @@ -141,7 +144,7 @@ class MovePicker { const ButterflyHistory*, const CapturePieceToHistory*, const PieceToHistory**, - const PawnHistory&, + const PawnHistory*, Move, const Move*); MovePicker(const Position&, @@ -150,9 +153,9 @@ class MovePicker { const ButterflyHistory*, const CapturePieceToHistory*, const PieceToHistory**, - const PawnHistory&, + const PawnHistory*, Square); - MovePicker(const Position&, Move, Value, const CapturePieceToHistory*, const PawnHistory&); + MovePicker(const Position&, Move, Value, const CapturePieceToHistory*); Move next_move(bool skipQuiets = false); private: @@ -167,7 +170,7 @@ class MovePicker { const ButterflyHistory* mainHistory; const CapturePieceToHistory* captureHistory; const PieceToHistory** continuationHistory; - const PawnHistory& pawnHistory; + const PawnHistory* pawnHistory; Move ttMove; ExtMove refutations[3], *cur, *endMoves, *endBadCaptures; int stage;