+ // Set of rows with half bits set to 1 and half to 0. It is used to allocate
+ // the search depths across the threads.
+ typedef std::vector<int> Row;
+
+ const Row HalfDensity[] = {
+ {0, 1},
+ {1, 0},
+ {0, 0, 1, 1},
+ {0, 1, 1, 0},
+ {1, 1, 0, 0},
+ {1, 0, 0, 1},
+ {0, 0, 0, 1, 1, 1},
+ {0, 0, 1, 1, 1, 0},
+ {0, 1, 1, 1, 0, 0},
+ {1, 1, 1, 0, 0, 0},
+ {1, 1, 0, 0, 0, 1},
+ {1, 0, 0, 0, 1, 1},
+ {0, 0, 0, 0, 1, 1, 1, 1},
+ {0, 0, 0, 1, 1, 1, 1, 0},
+ {0, 0, 1, 1, 1, 1, 0 ,0},
+ {0, 1, 1, 1, 1, 0, 0 ,0},
+ {1, 1, 1, 1, 0, 0, 0 ,0},
+ {1, 1, 1, 0, 0, 0, 0 ,1},
+ {1, 1, 0, 0, 0, 0, 1 ,1},
+ {1, 0, 0, 0, 0, 1, 1 ,1},
+ };
+
+ const size_t HalfDensitySize = std::extent<decltype(HalfDensity)>::value;
+
+ EasyMoveManager EasyMove;
+ Value DrawValue[COLOR_NB];
+
+ template <NodeType NT>
+ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, bool cutNode, bool skipEarlyPruning);
+
+ template <NodeType NT, bool InCheck>
+ Value qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth = DEPTH_ZERO);
+
+ Value value_to_tt(Value v, int ply);
+ Value value_from_tt(Value v, int ply);
+ void update_pv(Move* pv, Move move, Move* childPv);
+ void update_cm_stats(Stack* ss, Piece pc, Square s, Value bonus);
+ void update_stats(const Position& pos, Stack* ss, Move move, Move* quiets, int quietsCnt, Value bonus);
+ void check_time();
+