X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=479710784021fc2e3daee473309d5ca20b897ce9;hp=36bd0869301327d5cba8130e20ff824f4eeb246c;hb=1a1742ac4f8e0cfe8c1509e40e0631e075e9c1ad;hpb=b76c04c0975326d3274d7d7fb6df4edef7a040b5 diff --git a/src/search.cpp b/src/search.cpp index 36bd0869..47971078 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -467,7 +467,7 @@ namespace { if (SkillLevelEnabled && depth == 1 + SkillLevel) skillBest = do_skill_level(); - if (Options["Use Search Log"]) + if (!Signals.stop && Options["Use Search Log"]) pv_info_to_log(pos, depth, bestValue, elapsed_time(), &RootMoves[0].pv[0]); // Filter out startup noise when monitoring best move stability @@ -1363,8 +1363,7 @@ split_point_start: // At split points actual search starts from here return true; // Rule 2. Queen contact check is very dangerous - if ( type_of(pc) == QUEEN - && bit_is_set(kingAtt, to)) + if (type_of(pc) == QUEEN && (kingAtt & to)) return true; // Rule 3. Creating new double threats with checks @@ -1419,23 +1418,21 @@ split_point_start: // At split points actual search starts from here // Case 3: Moving through the vacated square p2 = pos.piece_on(f2); - if ( piece_is_slider(p2) - && bit_is_set(squares_between(f2, t2), f1)) + if (piece_is_slider(p2) && (squares_between(f2, t2) & f1)) return true; // Case 4: The destination square for m2 is defended by the moving piece in m1 p1 = pos.piece_on(t1); - if (bit_is_set(pos.attacks_from(p1, t1), t2)) + if (pos.attacks_from(p1, t1) & t2) return true; // Case 5: Discovered check, checking piece is the piece moved in m1 ksq = pos.king_square(pos.side_to_move()); - if ( piece_is_slider(p1) - && bit_is_set(squares_between(t1, ksq), f2)) + if (piece_is_slider(p1) && (squares_between(t1, ksq) & f2)) { Bitboard occ = pos.occupied_squares(); - clear_bit(&occ, f2); - if (bit_is_set(pos.attacks_from(p1, t1, occ), ksq)) + occ ^= f2; + if (pos.attacks_from(p1, t1, occ) & ksq) return true; } return false; @@ -1505,9 +1502,9 @@ split_point_start: // At split points actual search starts from here // Case 3: If the moving piece in the threatened move is a slider, don't // prune safe moves which block its ray. - if ( piece_is_slider(pos.piece_on(tfrom)) - && bit_is_set(squares_between(tfrom, tto), mto) - && pos.see_sign(m) >= 0) + if ( piece_is_slider(pos.piece_on(tfrom)) + && (squares_between(tfrom, tto) & mto) + && pos.see_sign(m) >= 0) return true; return false;