X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=aa63fcb4392d2fbe839b91b2c3bdfc1e764dd69d;hp=dfe690b4d6498ec65c016c200696acb39175ca15;hb=5ec63eb6b6f43cbd4e25b8f8b97bc8980dbbabef;hpb=9f843adf8972f3b561fc75d5d874ff21063a9f9d diff --git a/src/search.cpp b/src/search.cpp index dfe690b4..aa63fcb4 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -582,6 +582,10 @@ namespace { && abs(beta) < VALUE_MATE_IN_MAX_PLY && !pos.pawn_on_7th(pos.side_to_move())) { + if ( depth <= ONE_PLY + && eval + razor_margin(3 * ONE_PLY) <= alpha) + return qsearch(pos, ss, alpha, beta, DEPTH_ZERO); + Value ralpha = alpha - razor_margin(depth); Value v = qsearch(pos, ss, ralpha, ralpha+1, DEPTH_ZERO); if (v <= ralpha) @@ -1017,18 +1021,18 @@ moves_loop: // When in check and at SpNode search starts from here // must be mate or stalemate. If we are in a singular extension search then // return a fail low score. if (!moveCount) - return excludedMove ? alpha - : inCheck ? mated_in(ss->ply) : DrawValue[pos.side_to_move()]; + bestValue = excludedMove ? alpha + : inCheck ? mated_in(ss->ply) : DrawValue[pos.side_to_move()]; + + // Quiet best move: update killers, history, countermoves and followupmoves + else if (bestValue >= beta && !pos.capture_or_promotion(bestMove) && !inCheck) + update_stats(pos, ss, bestMove, depth, quietsSearched, quietCount - 1); TT.store(posKey, value_to_tt(bestValue, ss->ply), bestValue >= beta ? BOUND_LOWER : PvNode && bestMove ? BOUND_EXACT : BOUND_UPPER, depth, bestMove, ss->staticEval); - // Quiet best move: update killers, history, countermoves and followupmoves - if (bestValue >= beta && !pos.capture_or_promotion(bestMove) && !inCheck) - update_stats(pos, ss, bestMove, depth, quietsSearched, quietCount - 1); - assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE); return bestValue;