Thread* bestThread = this;
if ( !this->easyMovePlayed
&& Options["MultiPV"] == 1
Thread* bestThread = this;
if ( !this->easyMovePlayed
&& Options["MultiPV"] == 1
multiPV = std::min(multiPV, rootMoves.size());
// Iterative deepening loop until requested to stop or the target depth is reached.
multiPV = std::min(multiPV, rootMoves.size());
// Iterative deepening loop until requested to stop or the target depth is reached.
{
// Set up the new depths for the helper threads skipping on average every
// 2nd ply (using a half-density matrix).
{
// Set up the new depths for the helper threads skipping on average every
// 2nd ply (using a half-density matrix).
Depth r = reduction<PvNode>(improving, depth, moveCount);
Value hValue = thisThread->history[pos.piece_on(to_sq(move))][to_sq(move)];
Value cmhValue = cmh[pos.piece_on(to_sq(move))][to_sq(move)];
Depth r = reduction<PvNode>(improving, depth, moveCount);
Value hValue = thisThread->history[pos.piece_on(to_sq(move))][to_sq(move)];
Value cmhValue = cmh[pos.piece_on(to_sq(move))][to_sq(move)];
const CounterMoveStats* fm = (ss - 2)->counterMoves;
const CounterMoveStats* fm2 = (ss - 4)->counterMoves;
Value fmValue = (fm ? (*fm)[pos.piece_on(to_sq(move))][to_sq(move)] : VALUE_ZERO);
Value fm2Value = (fm2 ? (*fm2)[pos.piece_on(to_sq(move))][to_sq(move)] : VALUE_ZERO);
const CounterMoveStats* fm = (ss - 2)->counterMoves;
const CounterMoveStats* fm2 = (ss - 4)->counterMoves;
Value fmValue = (fm ? (*fm)[pos.piece_on(to_sq(move))][to_sq(move)] : VALUE_ZERO);
Value fm2Value = (fm2 ? (*fm2)[pos.piece_on(to_sq(move))][to_sq(move)] : VALUE_ZERO);
- // Increase reduction for cut nodes and moves with a bad history
- if ( (!PvNode && cutNode)
- || (hValue < VALUE_ZERO && cmhValue <= VALUE_ZERO))
+ // Increase reduction for cut nodes
+ if (!PvNode && cutNode)
r = std::max(DEPTH_ZERO, r - rHist * ONE_PLY);
// Decrease reduction for moves that escape a capture. Filter out
r = std::max(DEPTH_ZERO, r - rHist * ONE_PLY);
// Decrease reduction for moves that escape a capture. Filter out