Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend by two if the side to move has only one legal move #4894

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1328,12 +1328,12 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo
// Step 21. Check for mate and stalemate
// All legal moves have been searched and if there are no legal moves, it
// must be a mate or a stalemate. If we are in a singular extension search then
// return a fail low score.
// return a mate score to trigger double extension.

assert(moveCount || !ss->inCheck || excludedMove || !MoveList<LEGAL>(pos).size());

if (!moveCount)
bestValue = excludedMove ? alpha : ss->inCheck ? mated_in(ss->ply) : VALUE_DRAW;
bestValue = excludedMove || ss->inCheck ? mated_in(ss->ply) : VALUE_DRAW;

// If there is a move that produces search value greater than alpha we update the stats of searched moves
else if (bestMove)
Expand Down