enum NodeType { Root, PV, NonPV };
// Razoring and futility margin based on depth
enum NodeType { Root, PV, NonPV };
// Razoring and futility margin based on depth
- inline Value razor_margin(Depth d) { return Value(512 + 32 * d); }
- inline Value futility_margin(Depth d) { return Value(200 * d); }
+ Value razor_margin(Depth d) { return Value(512 + 32 * d); }
+ Value futility_margin(Depth d) { return Value(200 * d); }
// Futility and reductions lookup tables, initialized at startup
int FutilityMoveCounts[2][16]; // [improving][depth]
Depth Reductions[2][2][64][64]; // [pv][improving][depth][moveNumber]
// Futility and reductions lookup tables, initialized at startup
int FutilityMoveCounts[2][16]; // [improving][depth]
Depth Reductions[2][2][64][64]; // [pv][improving][depth][moveNumber]
/// Search::perft() is our utility to verify move generation. All the leaf nodes
/// up to the given depth are generated and counted and the sum returned.
template<bool Root>
/// Search::perft() is our utility to verify move generation. All the leaf nodes
/// up to the given depth are generated and counted and the sum returned.
template<bool Root>
captureOrPromotion = pos.capture_or_promotion(move);
givesCheck = type_of(move) == NORMAL && !ci.dcCandidates
captureOrPromotion = pos.capture_or_promotion(move);
givesCheck = type_of(move) == NORMAL && !ci.dcCandidates
ss->reduction = reduction<PvNode>(improving, depth, moveCount);
if ( (!PvNode && cutNode)
ss->reduction = reduction<PvNode>(improving, depth, moveCount);
if ( (!PvNode && cutNode)
- || ( History[pos.piece_on(to_sq(move))][to_sq(move)]
- + CounterMovesHistory[pos.piece_on(prevMoveSq)][prevMoveSq]
- [pos.piece_on(to_sq(move))][to_sq(move)] < VALUE_ZERO))
+ || ( History[pos.piece_on(to_sq(move))][to_sq(move)] < VALUE_ZERO
+ && CounterMovesHistory[pos.piece_on(prevMoveSq)][prevMoveSq]
+ [pos.piece_on(to_sq(move))][to_sq(move)] <= VALUE_ZERO))