From 8fc5e92005aad8f952817161818ec0082f9642e6 Mon Sep 17 00:00:00 2001 From: Michael Chaly Date: Sun, 16 Mar 2025 01:48:49 +0300 Subject: [PATCH] Use slightly different formula for stat score when position is in check Use formula that is closer to movepicker one. Passed STC: https://tests.stockfishchess.org/tests/view/67cffb337be98c1ad9b021ee LLR: 2.99 (-2.94,2.94) <0.00,2.00> Total: 250432 W: 64978 L: 64343 D: 121111 Ptnml(0-2): 795, 29390, 64159, 30129, 743 Passed LTC: https://tests.stockfishchess.org/tests/view/67d3905d517865b4a2dfce8a LLR: 2.94 (-2.94,2.94) <0.50,2.50> Total: 140004 W: 35742 L: 35215 D: 69047 Ptnml(0-2): 60, 15111, 39151, 15602, 78 closes https://github.com/official-stockfish/Stockfish/pull/5930 Bench: 2147336 --- src/search.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/search.cpp b/src/search.cpp index bb0156c5d..3eab34be4 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1235,6 +1235,9 @@ moves_loop: // When in check, search starts here 846 * int(PieceValue[pos.captured_piece()]) / 128 + thisThread->captureHistory[movedPiece][move.to_sq()][type_of(pos.captured_piece())] - 4822; + else if (ss->inCheck) + ss->statScore = thisThread->mainHistory[us][move.from_to()] + + (*contHist[0])[movedPiece][move.to_sq()] - 2771; else ss->statScore = 2 * thisThread->mainHistory[us][move.from_to()] + (*contHist[0])[movedPiece][move.to_sq()]