X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=f7ddfa0481f2f32697400015c408b91bdf75abc0;hp=23066d8f5d7186aa5391dca08822787624c53e0d;hb=30075e4abcf0430cef78ae0b7823390013e75618;hpb=0fdc75c0bdf1b273f080724d03fd706ebb8c17cb diff --git a/src/search.cpp b/src/search.cpp index 23066d8f..f7ddfa04 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1103,11 +1103,8 @@ namespace { tte = TT.retrieve(pos.get_key()); ttMove = (tte ? tte->move() : MOVE_NONE); - // Go with internal iterative deepening if we don't have a TT move or - // if search depth is more then 4*OnePly higher then TT move depth. - if ( UseIIDAtPVNodes - && depth >= 5*OnePly - &&(!ttMove || depth > tte->depth() + 4*OnePly)) + // Go with internal iterative deepening if we don't have a TT move + if (UseIIDAtPVNodes && ttMove == MOVE_NONE && depth >= 5*OnePly) { search_pv(pos, ss, alpha, beta, depth-2*OnePly, ply, threadID); ttMove = ss[ply].pv[ply]; @@ -1117,7 +1114,8 @@ namespace { // to search all moves isCheck = pos.is_check(); mateThreat = pos.has_mate_threat(opposite_color(pos.side_to_move())); - dcCandidates = pos.discovered_check_candidates(pos.side_to_move()); + CheckInfo ci(pos); + dcCandidates = ci.dc; MovePicker mp = MovePicker(pos, ttMove, depth, H, &ss[ply]); // Loop through all legal moves until no moves remain or a beta cutoff @@ -1374,7 +1372,8 @@ namespace { // Initialize a MovePicker object for the current position, and prepare // to search all moves. MovePicker mp = MovePicker(pos, ttMove, depth, H, &ss[ply]); - dcCandidates = pos.discovered_check_candidates(pos.side_to_move()); + CheckInfo ci(pos); + dcCandidates = ci.dc; futilityValue = VALUE_NONE; useFutilityPruning = depth < SelectiveDepth && !isCheck; @@ -1595,7 +1594,8 @@ namespace { // to search the moves. Because the depth is <= 0 here, only captures, // queen promotions and checks (only if depth == 0) will be generated. MovePicker mp = MovePicker(pos, ttMove, depth, H); - dcCandidates = pos.discovered_check_candidates(pos.side_to_move()); + CheckInfo ci(pos); + dcCandidates = ci.dc; enoughMaterial = pos.non_pawn_material(pos.side_to_move()) > RookValueMidgame; // Loop through the moves until no moves remain or a beta cutoff