X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=a74e3f256833c576c4e11f19462367af32f91119;hp=7f933a466151a6e29bb375d92ff698a8956402c2;hb=a90fc4c877b39769ebdf227b3124008ec394ad3d;hpb=dc4655e1f9b77910afc6521c1b87661389b44e06 diff --git a/src/search.cpp b/src/search.cpp index 7f933a46..a74e3f25 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -113,8 +113,8 @@ namespace { std::copy(newPv.begin(), newPv.begin() + 3, pv); StateInfo st[2]; - pos.do_move(newPv[0], st[0], pos.gives_check(newPv[0])); - pos.do_move(newPv[1], st[1], pos.gives_check(newPv[1])); + pos.do_move(newPv[0], st[0]); + pos.do_move(newPv[1], st[1]); expectedPosKey = pos.key(); pos.undo_move(newPv[1]); pos.undo_move(newPv[0]); @@ -234,7 +234,7 @@ uint64_t Search::perft(Position& pos, Depth depth) { cnt = 1, nodes++; else { - pos.do_move(m, st, pos.gives_check(m)); + pos.do_move(m, st); cnt = leaf ? MoveList(pos).size() : perft(pos, depth - ONE_PLY); nodes += cnt; pos.undo_move(m); @@ -801,7 +801,7 @@ namespace { { ss->currentMove = move; ss->counterMoves = &thisThread->counterMoveHistory[pos.moved_piece(move)][to_sq(move)]; - pos.do_move(move, st, pos.gives_check(move)); + pos.do_move(move, st); value = -search(pos, ss+1, -rbeta, -rbeta+1, rdepth, !cutNode); pos.undo_move(move); if (value >= rbeta) @@ -944,10 +944,15 @@ moves_loop: // When in check search starts from here && !pos.see_ge(move, Value(-35 * lmrDepth * lmrDepth))) continue; } - else if ( depth < 7 * ONE_PLY - && !extension - && !pos.see_ge(move, Value(-35 * depth / ONE_PLY * depth / ONE_PLY))) + else if (depth < 7 * ONE_PLY && !extension) + { + Value v = Value(-35 * depth / ONE_PLY * depth / ONE_PLY); + if (ss->staticEval != VALUE_NONE) + v += ss->staticEval - alpha - 200; + + if (!pos.see_ge(move, v)) continue; + } } // Speculative prefetch as early as possible @@ -1600,7 +1605,7 @@ bool RootMove::extract_ponder_from_tt(Position& pos) { if (!pv[0]) return false; - pos.do_move(pv[0], st, pos.gives_check(pv[0])); + pos.do_move(pv[0], st); TTEntry* tte = TT.probe(pos.key(), ttHit); if (ttHit)