ss->staticEval = eval = -(ss-1)->staticEval;
// Save static evaluation into transposition table
+ if(!excludedMove)
tte->save(posKey, VALUE_NONE, ss->ttPv, BOUND_NONE, DEPTH_NONE, MOVE_NONE, eval);
}
// Step 7. Futility pruning: child node (~50 Elo)
if ( !PvNode
- && depth < 9
&& eval - futility_margin(depth, improving) >= beta
&& eval < VALUE_KNOWN_WIN) // Do not return unproven wins
return eval;
continue;
// Futility pruning: parent node (~5 Elo)
- if ( lmrDepth < 7
- && !ss->inCheck
+ if ( !ss->inCheck
&& ss->staticEval + 174 + 157 * lmrDepth <= alpha
&& (*contHist[0])[movedPiece][to_sq(move)]
+ (*contHist[1])[movedPiece][to_sq(move)]
r--;
// Increase reduction for cut nodes (~3 Elo)
- if (cutNode)
- r += 1 + !captureOrPromotion;
+ if (cutNode && move != ss->killers[0])
+ r += 2;
if (!captureOrPromotion)
{
{
assert(is_ok(move));
+ // Check for legality
+ if (!pos.legal(move))
+ continue;
+
givesCheck = pos.gives_check(move);
captureOrPromotion = pos.capture_or_promotion(move);
// Speculative prefetch as early as possible
prefetch(TT.first_entry(pos.key_after(move)));
- // Check for legality just before making the move
- if (!pos.legal(move))
- {
- moveCount--;
- continue;
- }
-
ss->currentMove = move;
ss->continuationHistory = &thisThread->continuationHistory[ss->inCheck]
[captureOrPromotion]