X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=70052bbc195df4e3b89c4da3a19f33ebdf99befb;hp=0cee3aa93d382b49d4d5c4566d5fb6980f359514;hb=74e2fa97b7ce49722b908f35988f3c75dee9bf36;hpb=dcd8ce70941e9b8d5180eb43865bb9819e424c19;ds=inline diff --git a/src/search.cpp b/src/search.cpp index 0cee3aa9..70052bbc 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1000,10 +1000,11 @@ moves_loop: // When in check search starts from here && cmh[pos.piece_on(to_sq(move))][to_sq(move)] <= VALUE_ZERO)) r += ONE_PLY; - // Decrease reduction for moves with a good history - if ( thisThread->history[pos.piece_on(to_sq(move))][to_sq(move)] > VALUE_ZERO - && cmh[pos.piece_on(to_sq(move))][to_sq(move)] > VALUE_ZERO) - r = std::max(DEPTH_ZERO, r - ONE_PLY); + // Decrease reduction for moves with a good history and + // increase reduction for moves with a bad history + int rDecrease = ( thisThread->history[pos.piece_on(to_sq(move))][to_sq(move)] + + cmh[pos.piece_on(to_sq(move))][to_sq(move)]) / 14980; + r = std::max(DEPTH_ZERO, r - rDecrease * ONE_PLY); // Decrease reduction for moves that escape a capture. Filter out castling // moves because are coded as "king captures rook" and break make_move().