// Never assume anything on values stored in TT
if ( (ss->staticEval = eval = tte->eval_value()) == VALUE_NONE
||(ss->evalMargin = tte->eval_margin()) == VALUE_NONE)
- eval = ss->staticEval = evaluate(pos, ss->evalMargin);
+ eval = ss->staticEval = evaluate(pos, ss->evalMargin, &ss->ei);
// Can ttValue be used as a better position evaluation?
if (ttValue != VALUE_NONE)
}
else
{
- eval = ss->staticEval = evaluate(pos, ss->evalMargin);
+ eval = ss->staticEval = evaluate(pos, ss->evalMargin, &ss->ei);
TT.store(posKey, VALUE_NONE, BOUND_NONE, DEPTH_NONE, MOVE_NONE,
ss->staticEval, ss->evalMargin);
}
&& !ss->skipNullMove
&& depth < 4 * ONE_PLY
&& !inCheck
- && eval - FutilityMargins[depth][0] >= 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 - FutilityMargins[depth][0];
+ 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);
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
// Never assume anything on values stored in TT
if ( (ss->staticEval = bestValue = tte->eval_value()) == VALUE_NONE
||(ss->evalMargin = tte->eval_margin()) == VALUE_NONE)
- ss->staticEval = bestValue = evaluate(pos, ss->evalMargin);
+ ss->staticEval = bestValue = evaluate(pos, ss->evalMargin, &ss->ei);
}
else
- ss->staticEval = bestValue = evaluate(pos, ss->evalMargin);
+ ss->staticEval = bestValue = evaluate(pos, ss->evalMargin, &ss->ei);
// Stand pat. Return immediately if static value is at least beta
if (bestValue >= beta)