- givesCheck = gives_check(pos, move);
-
- moveCountPruning = depth < 16 * ONE_PLY
- && moveCount >= FutilityMoveCounts[improving][depth / ONE_PLY];
-
- // Step 13. Extensions (~70 Elo)
-
- // Singular extension search (~60 Elo). If all moves but one fail low on a
- // search of (alpha-s, beta-s), and just one fails high on (alpha, beta),
- // then that move is singular and should be extended. To verify this we do
- // a reduced search on all the other moves but the ttMove and if the
- // result is lower than ttValue minus a margin then we will extend the ttMove.
- if ( depth >= 8 * ONE_PLY
- && move == ttMove
- && !rootNode
- && !excludedMove // Recursive singular search is not allowed
- && ttValue != VALUE_NONE
- && (tte->bound() & BOUND_LOWER)
- && tte->depth() >= depth - 3 * ONE_PLY
- && pos.legal(move))
- {
- Value rBeta = std::max(ttValue - 2 * depth / ONE_PLY, -VALUE_MATE);
- ss->excludedMove = move;
- value = search<NonPV>(pos, ss, rBeta - 1, rBeta, depth / 2, cutNode);
- ss->excludedMove = MOVE_NONE;
-
- if (value < rBeta)
- extension = ONE_PLY;
- }
- else if ( givesCheck // Check extension (~2 Elo)
- && pos.see_ge(move))
- extension = ONE_PLY;
-
- // Extension for king moves that change castling rights
- if ( pos.can_castle(us)
- && type_of(movedPiece) == KING
- && depth < 12 * ONE_PLY)
- extension = ONE_PLY;