X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=61475a2f3f3be641fc19b2222d5665cc85d1f214;hp=15757c3a9ae7c025cc02f5c616380cc00976fc29;hb=cd4604b05c2d61928b26ab50c5864c36ef1d3785;hpb=2fff532f4e80c8e2e61d8b3955447f13124d40f0 diff --git a/src/search.cpp b/src/search.cpp index 15757c3a..61475a2f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -894,7 +894,7 @@ namespace { // Decide search depth for this move bool moveIsCapture = pos.move_is_capture(move); bool dangerous; - ext = extension(pos, move, true, pos.move_is_capture(move), pos.move_is_check(move), false, false, &dangerous); + ext = extension(pos, move, true, moveIsCapture, pos.move_is_check(move), false, false, &dangerous); newDepth = (Iteration - 2) * OnePly + ext + InitialDepth; // Make the move, and search it @@ -918,8 +918,8 @@ namespace { } else { - if (newDepth >= 3*OnePly - && i + MultiPV >= LMRPVMoves + if ( newDepth >= 3*OnePly + && i >= MultiPV + LMRPVMoves - 2 // Remove -2 and decrease LMRPVMoves instead ? && !dangerous && !moveIsCapture && !move_is_promotion(move) @@ -927,10 +927,10 @@ namespace { { ss[0].reduction = OnePly; value = -search(pos, ss, -alpha, newDepth-OnePly, 1, true, 0); - } - else + } else value = alpha + 1; // Just to trigger next condition - if(value > alpha) + + if (value > alpha) { value = -search(pos, ss, -alpha, newDepth, 1, true, 0); if (value > alpha) @@ -989,6 +989,8 @@ namespace { // Print search information to the standard output std::cout << "info depth " << Iteration << " score " << value_to_string(value) + << ((value >= beta)? + " lowerbound" : ((value <= alpha)? " upperbound" : "")) << " time " << current_search_time() << " nodes " << nodes_searched() << " nps " << nps() @@ -1124,6 +1126,7 @@ namespace { // Make and search the move StateInfo st; pos.do_move(move, st, dcCandidates); + TT.prefetch(pos.get_key()); if (moveCount == 1) // The first move in list is the PV value = -search_pv(pos, ss, -beta, -alpha, newDepth, ply+1, threadID); @@ -1294,6 +1297,8 @@ namespace { StateInfo st; pos.do_null_move(st); + TT.prefetch(pos.get_key()); + int R = (depth >= 5 * OnePly ? 4 : 3); // Null move dynamic reduction Value nullValue = -search(pos, ss, -(beta-1), depth-R*OnePly, ply+1, false, threadID); @@ -1408,6 +1413,7 @@ namespace { // Make and search the move StateInfo st; pos.do_move(move, st, dcCandidates); + TT.prefetch(pos.get_key()); // Try to reduce non-pv search depth by one ply if move seems not problematic, // if the move fails high will be re-searched at full depth. @@ -1617,6 +1623,7 @@ namespace { // Make and search the move. StateInfo st; pos.do_move(move, st, dcCandidates); + TT.prefetch(pos.get_key()); Value value = -qsearch(pos, ss, -beta, -alpha, depth-OnePly, ply+1, threadID); pos.undo_move(move);