X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=5fd016a6db59500df25c5e2122d9ea8845c08e7a;hp=7875f0345f3d9d9f4c0268b7d613689f7cd85c7e;hb=04407e35d67959b2e9011aa6aff43e2bb632b189;hpb=4d647428d8f6b02a404e6b7fda5dbbf17090f271 diff --git a/src/search.cpp b/src/search.cpp index 7875f034..5fd016a6 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -577,6 +577,17 @@ namespace { beta = std::min(mate_in(ss->ply+1), beta); if (alpha >= beta) return alpha; + + // Check if there exists a move which draws by repetition, or an alternative + // earlier move to this position. + if ( pos.rule50_count() >= 3 + && alpha < VALUE_DRAW + && pos.has_game_cycle(ss->ply)) + { + alpha = VALUE_DRAW; + if (alpha >= beta) + return alpha; + } } assert(0 <= ss->ply && ss->ply < MAX_PLY); @@ -734,10 +745,10 @@ namespace { // Step 9. Null move search with verification search (~40 Elo) if ( !PvNode && (ss-1)->currentMove != MOVE_NULL - && (ss-1)->statScore < 30000 + && (ss-1)->statScore < 22500 && eval >= beta && ss->staticEval >= beta - 36 * depth / ONE_PLY + 225 - && !ss->excludedMove + && !excludedMove && pos.non_pawn_material(pos.side_to_move()) && (ss->ply >= thisThread->nmp_ply || ss->ply % 2 != thisThread->nmp_odd)) { @@ -1106,7 +1117,7 @@ moves_loop: // When in check, search starts from here else { assert(value >= beta); // Fail high - ss->statScore = std::max(ss->statScore, 0); + ss->statScore = 0; break; } } @@ -1153,7 +1164,7 @@ moves_loop: // When in check, search starts from here update_continuation_histories(ss-1, pos.piece_on(prevSq), prevSq, -stat_bonus(depth + ONE_PLY)); } // Bonus for prior countermove that caused the fail low - else if ( depth >= 3 * ONE_PLY + else if ( (depth >= 3 * ONE_PLY || PvNode) && !pos.captured_piece() && is_ok((ss-1)->currentMove)) update_continuation_histories(ss-1, pos.piece_on(prevSq), prevSq, stat_bonus(depth));