- if (!captureOrPromotion)
- {
- // Increase reduction if ttMove is a capture (~5 Elo)
- if (ttCapture)
- r++;
-
- // Increase reduction for cut nodes (~10 Elo)
- if (cutNode)
- r += 2;
-
- // Decrease reduction for moves that escape a capture. Filter out
- // castling moves, because they are coded as "king captures rook" and
- // hence break make_move(). (~2 Elo)
- else if ( type_of(move) == NORMAL
- && !pos.see_ge(reverse_move(move)))
- r -= 2 + ttPv;
-
- ss->statScore = thisThread->mainHistory[us][from_to(move)]
- + (*contHist[0])[movedPiece][to_sq(move)]
- + (*contHist[1])[movedPiece][to_sq(move)]
- + (*contHist[3])[movedPiece][to_sq(move)]
- - 4926;
-
- // Reset statScore to zero if negative and most stats shows >= 0
- if ( ss->statScore < 0
- && (*contHist[0])[movedPiece][to_sq(move)] >= 0
- && (*contHist[1])[movedPiece][to_sq(move)] >= 0
- && thisThread->mainHistory[us][from_to(move)] >= 0)
- ss->statScore = 0;
-
- // Decrease/increase reduction by comparing opponent's stat score (~10 Elo)
- if (ss->statScore >= -102 && (ss-1)->statScore < -114)
- r--;
-
- else if ((ss-1)->statScore >= -116 && ss->statScore < -154)
- r++;
-
- // Decrease/increase reduction for moves with a good/bad history (~30 Elo)
- r -= ss->statScore / 16384;
- }