X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=cb7b30b8f6f102a832f79c1ae835046f8aa83128;hb=58c9fbacc787cc3b654244c071169057e6895c91;hp=e7fbbcf3dcb3566fc794870fd5b8e05b9fcf5d21;hpb=6950d07bf421b122ccb5a15a2ed4fa3a993d9609;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index e7fbbcf3..cb7b30b8 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -534,7 +534,7 @@ namespace { if (!RootNode) { // Step 2. Check for aborted search and immediate draw - if (Signals.stop || pos.is_draw() || ss->ply > MAX_PLY) + if (Signals.stop || pos.is_draw() || ss->ply > MAX_PLY) return DrawValue[pos.side_to_move()]; // Step 3. Mate distance pruning. Even if we mate at the next move our score @@ -667,12 +667,12 @@ namespace { if (eval - PawnValueMg > beta) R += ONE_PLY; - pos.do_null_move(st); + pos.do_null_move(st); (ss+1)->skipNullMove = true; nullValue = depth-R < ONE_PLY ? -qsearch(pos, ss+1, -beta, -alpha, DEPTH_ZERO) : - search(pos, ss+1, -beta, -alpha, depth-R); (ss+1)->skipNullMove = false; - pos.do_null_move(st); + pos.undo_null_move(); if (nullValue >= beta) { @@ -835,7 +835,7 @@ split_point_start: // At split points actual search starts from here ss->excludedMove = MOVE_NONE; if (value < rBeta) - ext = rBeta >= beta ? ONE_PLY + ONE_PLY / 2 : ONE_PLY; + ext = ONE_PLY; } // Update current move (this must be done after singular extension search) @@ -1109,7 +1109,7 @@ split_point_start: // At split points actual search starts from here ss->ply = (ss-1)->ply + 1; // Check for an instant draw or maximum ply reached - if (pos.is_draw() || ss->ply > MAX_PLY) + if (pos.is_draw() || ss->ply > MAX_PLY) return DrawValue[pos.side_to_move()]; // Transposition table lookup. At PV nodes, we don't use the TT for @@ -1343,7 +1343,6 @@ split_point_start: // At split points actual search starts from here Bitboard b = (enemies ^ ksq) & newAtt & ~oldAtt; while (b) { - // Note that here we generate illegal "double move"! if (futilityBase + PieceValue[EG][pos.piece_on(pop_lsb(&b))] >= beta) return true; } @@ -1517,7 +1516,7 @@ void RootMove::extract_pv_from_tt(Position& pos) { && pos.is_pseudo_legal(m = tte->move()) // Local copy, TT could change && pos.pl_move_is_legal(m, pos.pinned_pieces()) && ply < MAX_PLY - && (!pos.is_draw() || ply < 2)); + && (!pos.is_draw() || ply < 2)); pv.push_back(MOVE_NONE); // Must be zero-terminating