useNNUE = Options["Use NNUE"]
&& ( eval_file.find(string(Options["UCI_Variant"])) != string::npos
- || (Options["UCI_Variant"] == "chess" && eval_file.rfind("nn-", 0) != string::npos)) // restrict NNUE usage to corresponding variant
- && RANK_MAX == RANK_8; // TODO: fix for large boards
+ || (Options["UCI_Variant"] == "chess" && eval_file.rfind("nn-", 0) != string::npos)); // restrict NNUE usage to corresponding variant
if (!useNNUE)
return;
0x5D69D5B9u ^ (AssociatedKing == Side::kFriend);
// Number of feature dimensions
static constexpr IndexType kDimensions =
- static_cast<IndexType>(SQUARE_NB) * static_cast<IndexType>(PS_END);
+ static_cast<IndexType>(SQUARE_NB_CHESS) * static_cast<IndexType>(PS_END);
// Maximum number of simultaneously active features
static constexpr IndexType kMaxActiveDimensions = 30; // Kings don't count
// Trigger for full calculation instead of difference calculation
enum {
PS_NONE = 0,
PS_W_PAWN = 1,
- PS_B_PAWN = 1 * SQUARE_NB + 1,
- PS_W_KNIGHT = 2 * SQUARE_NB + 1,
- PS_B_KNIGHT = 3 * SQUARE_NB + 1,
- PS_W_BISHOP = 4 * SQUARE_NB + 1,
- PS_B_BISHOP = 5 * SQUARE_NB + 1,
- PS_W_ROOK = 6 * SQUARE_NB + 1,
- PS_B_ROOK = 7 * SQUARE_NB + 1,
- PS_W_QUEEN = 8 * SQUARE_NB + 1,
- PS_B_QUEEN = 9 * SQUARE_NB + 1,
- PS_W_KING = 10 * SQUARE_NB + 1,
+ PS_B_PAWN = 1 * SQUARE_NB_CHESS + 1,
+ PS_W_KNIGHT = 2 * SQUARE_NB_CHESS + 1,
+ PS_B_KNIGHT = 3 * SQUARE_NB_CHESS + 1,
+ PS_W_BISHOP = 4 * SQUARE_NB_CHESS + 1,
+ PS_B_BISHOP = 5 * SQUARE_NB_CHESS + 1,
+ PS_W_ROOK = 6 * SQUARE_NB_CHESS + 1,
+ PS_B_ROOK = 7 * SQUARE_NB_CHESS + 1,
+ PS_W_QUEEN = 8 * SQUARE_NB_CHESS + 1,
+ PS_B_QUEEN = 9 * SQUARE_NB_CHESS + 1,
+ PS_W_KING = 10 * SQUARE_NB_CHESS + 1,
PS_END = PS_W_KING, // pieces without kings (pawns included)
- PS_B_KING = 11 * SQUARE_NB + 1,
- PS_END2 = 12 * SQUARE_NB + 1
+ PS_B_KING = 11 * SQUARE_NB_CHESS + 1,
+ PS_END2 = 12 * SQUARE_NB_CHESS + 1
};
extern const uint32_t kpp_board_index[PIECE_NB][COLOR_NB];