Use moveCount to decide when to prune for evasion pruning
STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 24476 W: 4518 L: 4289 D: 15669
LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 18362 W: 2476 L: 2298 D: 13588
Bench:
6469989
Closes #1120
Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
bool ttHit, givesCheck, evasionPrunable;
Depth ttDepth;
Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
bool ttHit, givesCheck, evasionPrunable;
Depth ttDepth;
ss->currentMove = bestMove = MOVE_NONE;
ss->ply = (ss-1)->ply + 1;
ss->currentMove = bestMove = MOVE_NONE;
ss->ply = (ss-1)->ply + 1;
// Check for an instant draw or if the maximum ply has been reached
if (pos.is_draw(ss->ply) || ss->ply >= MAX_PLY)
// Check for an instant draw or if the maximum ply has been reached
if (pos.is_draw(ss->ply) || ss->ply >= MAX_PLY)
? pos.check_squares(type_of(pos.piece_on(from_sq(move)))) & to_sq(move)
: pos.gives_check(move);
? pos.check_squares(type_of(pos.piece_on(from_sq(move)))) & to_sq(move)
: pos.gives_check(move);
// Futility pruning
if ( !InCheck
&& !givesCheck
// Futility pruning
if ( !InCheck
&& !givesCheck
// Detect non-capture evasions that are candidates to be pruned
evasionPrunable = InCheck
// Detect non-capture evasions that are candidates to be pruned
evasionPrunable = InCheck
+ && (depth != DEPTH_ZERO || moveCount > 2)
&& bestValue > VALUE_MATED_IN_MAX_PLY
&& !pos.capture(move);
&& bestValue > VALUE_MATED_IN_MAX_PLY
&& !pos.capture(move);
// Check for legality just before making the move
if (!pos.legal(move))
// Check for legality just before making the move
if (!pos.legal(move))