- bool dangerous;
- Depth ext = extension(pos, move, false, moveIsCapture, moveIsCheck, singleReply, mateThreat, &dangerous);
- Depth newDepth = depth - OnePly + ext;
+ ext = extension(pos, move, false, captureOrPromotion, moveIsCheck, singleEvasion, mateThreat, &dangerous);
+
+ // Singular extension search. We extend the TT move if its value is much better than
+ // its siblings. To verify this we do a reduced search on all the other moves but the
+ // ttMove, if result is lower then ttValue minus a margin then we extend ttMove.
+ if ( depth >= 8 * OnePly
+ && tte
+ && move == tte->move()
+ && !excludedMove // Do not allow recursive single-reply search
+ && ext < OnePly
+ && is_lower_bound(tte->type())
+ && tte->depth() >= depth - 3 * OnePly)
+ {
+ Value ttValue = value_from_tt(tte->value(), ply);
+
+ if (abs(ttValue) < VALUE_KNOWN_WIN)
+ {
+ Value excValue = search(pos, ss, ttValue - SingleReplyMargin, depth / 2, ply, false, threadID, move);
+
+ if (excValue < ttValue - SingleReplyMargin)
+ ext = OnePly;
+ }
+ }
+
+ newDepth = depth - OnePly + ext;
+
+ // Update current move
+ movesSearched[moveCount++] = ss[ply].currentMove = move;