X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=72711b6909f7d4b2715dfe0440edfe5574e2b8c3;hp=7392fada40a80b7c0c09c73bd2a12040b8f92006;hb=c13052f344e1de69bd824256427fd7e723a79e14;hpb=8de29390f2d2bd31585b93ff46eae3051126f666 diff --git a/src/search.cpp b/src/search.cpp index 7392fada..72711b69 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1011,16 +1011,16 @@ moves_loop: // When in check search starts from here && !captureOrPromotion) { Depth r = reduction(improving, depth, moveCount); + Value hValue = thisThread->history[pos.piece_on(to_sq(move))][to_sq(move)]; + Value cmhValue = cmh[pos.piece_on(to_sq(move))][to_sq(move)]; // Increase reduction for cut nodes and moves with a bad history if ( (!PvNode && cutNode) - || ( 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)) + || (hValue < VALUE_ZERO && cmhValue <= VALUE_ZERO)) r += ONE_PLY; // Decrease/increase reduction for moves with a good/bad history - int rHist = ( thisThread->history[pos.piece_on(to_sq(move))][to_sq(move)] - + cmh[pos.piece_on(to_sq(move))][to_sq(move)]) / 14980; + int rHist = (hValue + cmhValue) / 14980; r = std::max(DEPTH_ZERO, r - rHist * ONE_PLY); // Decrease reduction for moves that escape a capture. Filter out