X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=cb7b30b8f6f102a832f79c1ae835046f8aa83128;hb=58c9fbacc787cc3b654244c071169057e6895c91;hp=bb1836e0474d3afe7f7c321ab7b967d2331c8f12;hpb=62b32a47378fa84108bb8aee2192ba66c87c3280;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index bb1836e0..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) @@ -1008,7 +1008,8 @@ split_point_start: // At split points actual search starts from here // Step 19. Check for splitting the search if ( !SpNode && depth >= Threads.minimumSplitDepth - && Threads.slave_available(thisThread)) + && Threads.slave_available(thisThread) + && thisThread->splitPointsSize < MAX_SPLITPOINTS_PER_THREAD) { assert(bestValue < beta); @@ -1108,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 @@ -1342,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; } @@ -1516,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