diff --git a/src/search.c b/src/search.c index 7135c931..cf3a4e98 100644 --- a/src/search.c +++ b/src/search.c @@ -475,8 +475,6 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth continue; } - MakeMove(pos, move); - moveCount++; // Extension @@ -494,9 +492,6 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth && ttBound != BOUND_UPPER && !isTerminal(ttScore)) { - // ttMove has been made to check legality - TakeMove(pos); - // Search to reduced depth with a zero window a bit lower than ttScore int singularBeta = ttScore - depth * (2 - pvNode); ss->excluded = move; @@ -514,9 +509,6 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth // Negative extension - not singular but likely still good enough to beat beta else if (ttScore >= beta) extension = -1; - - // Replay ttMove - MakeMove(pos, move); } // Extend when in check @@ -525,6 +517,8 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth skip_extensions: + MakeMove(pos, move); + ss->move = move; ss->doubleExtensions = (ss-1)->doubleExtensions + (extension == 2); ss->continuation = &thread->continuation[inCheck][moveIsCapture(move)][piece(move)][toSq(move)];