&& !ss->skipNullMove
&& depth < 4 * ONE_PLY
&& !inCheck
- && eval - futility_margin(depth, (ss-1)->futMc) >= beta
+ && eval - futility_margin(depth, (ss-1)->futilityMoveCount) >= beta
&& abs(beta) < VALUE_MATE_IN_MAX_PLY
&& pos.non_pawn_material(pos.side_to_move()))
- return eval - futility_margin(depth, (ss-1)->futMc);
+ return eval - futility_margin(depth, (ss-1)->futilityMoveCount);
// Step 8. Null move search with verification search (is omitted in PV nodes)
if ( !PvNode
<< " currmovenumber " << moveCount + PVIdx << sync_endl;
}
+ ss->futilityMoveCount = 0;
ext = DEPTH_ZERO;
captureOrPromotion = pos.is_capture_or_promotion(move);
givesCheck = pos.move_gives_check(move, ci);
// Update current move (this must be done after singular extension search)
newDepth = depth - ONE_PLY + ext;
- ss->futMc = 0;
-
// Step 13. Futility pruning (is omitted in PV nodes)
if ( !PvNode
&& !captureOrPromotion
// Value based pruning
// We illogically ignore reduction condition depth >= 3*ONE_PLY for predicted depth,
// but fixing this made program slightly weaker.
- ss->futMc = moveCount;
-
Depth predictedDepth = newDepth - reduction<PvNode>(depth, moveCount);
futilityValue = ss->staticEval + ss->evalMargin + futility_margin(predictedDepth, moveCount)
+ Gain[pos.piece_moved(move)][to_sq(move)];
continue;
}
+
+ // We have not pruned the move that will be searched, but remember how
+ // far in the move list we are to be more aggressive in the child node.
+ ss->futilityMoveCount = moveCount;
}
// Check for legality only before to do the move