X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=6215b083dd22dc3bc2e408d8fbe09c3a076e0bd0;hp=50f5939d3497d70a5e90c3517331250b39fbe983;hb=7ed15af371be19a4d261df87fa33df0a94fdc930;hpb=95b24083fb0476b6fa332db923c175e654cd0f0b diff --git a/src/search.cpp b/src/search.cpp index 50f5939d..6215b083 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -187,7 +187,7 @@ void Search::think() { TimeMgr.init(Limits, RootPos.game_ply(), RootPos.side_to_move()); - int cf = Options["Contempt Factor"] * PawnValueEg / 100; // From centipawns + int cf = Options["Contempt"] * PawnValueEg / 100; // From centipawns DrawValue[ RootPos.side_to_move()] = VALUE_DRAW - Value(cf); DrawValue[~RootPos.side_to_move()] = VALUE_DRAW + Value(cf); @@ -567,8 +567,7 @@ namespace { // Null move dynamic reduction based on depth and value Depth R = 3 * ONE_PLY + depth / 4 - + (abs(beta) < VALUE_KNOWN_WIN ? int(eval - beta) / PawnValueMg * ONE_PLY - : DEPTH_ZERO); + + std::min(int(eval - beta) / PawnValueMg, 3) * ONE_PLY; pos.do_null_move(st); (ss+1)->skipNullMove = true; @@ -823,12 +822,10 @@ moves_loop: // When in check and at SpNode search starts from here { ss->reduction = reduction(improving, depth, moveCount); - if (!PvNode && cutNode) + if ( (!PvNode && cutNode) + || History[pos.piece_on(to_sq(move))][to_sq(move)] < 0) ss->reduction += ONE_PLY; - else if (History[pos.piece_on(to_sq(move))][to_sq(move)] < 0) - ss->reduction += ONE_PLY / 2; - if (move == countermoves[0] || move == countermoves[1]) ss->reduction = std::max(DEPTH_ZERO, ss->reduction - ONE_PLY); @@ -1425,7 +1422,7 @@ void Thread::idle_loop() { while (!exit) { // If this thread has been assigned work, launch a search - if (searching) + while (searching) { Threads.mutex.lock();