From 5eeb96d0e7d54686376305029c477c42478aa1d5 Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Wed, 31 Aug 2022 14:45:39 +0300 Subject: [PATCH] VLTC tuning Tuning some parameters that scale well with longer time control: Failed STC: https://tests.stockfishchess.org/tests/view/6313424d8202a039920e130a LLR: -2.94 (-2.94,2.94) <-1.75,0.25> Total: 42680 W: 11231 L: 11540 D: 19909 Ptnml(0-2): 191, 5008, 11232, 4737, 172 Passed LTC: https://tests.stockfishchess.org/tests/view/6311e2cd874169ca52ae7933 LLR: 2.94 (-2.94,2.94) <0.50,2.50> Total: 53448 W: 14782 L: 14437 D: 24229 Ptnml(0-2): 101, 5214, 15740, 5577, 92 Passed VLTC: https://tests.stockfishchess.org/tests/view/6312530cfa99a92e3002c927 LLR: 2.95 (-2.94,2.94) <0.50,2.50> Total: 123336 W: 33465 L: 33007 D: 56864 Ptnml(0-2): 38, 11466, 38204, 11920, 40 closes https://github.com/official-stockfish/Stockfish/pull/4154 Bench: 5609606 --- src/search.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 6d78403f..cd7369c8 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -63,7 +63,7 @@ namespace { // Futility margin Value futility_margin(Depth d, bool improving) { - return Value(168 * (d - improving)); + return Value(174 * (d - improving)); } // Reductions lookup table, initialized at startup @@ -362,7 +362,7 @@ void Thread::search() { trend = (us == WHITE ? make_score(tr, tr / 2) : -make_score(tr, tr / 2)); - int opt = sigmoid(prev, 8, 17, 144, 13966, 183); + int opt = sigmoid(prev, 8, 17, 144, 15012, 183); optimism[ us] = Value(opt); optimism[~us] = -optimism[us]; } @@ -778,7 +778,7 @@ namespace { // return a fail low. if ( !PvNode && depth <= 7 - && eval < alpha - 348 - 258 * depth * depth) + && eval < alpha - 341 - 267 * depth * depth) { value = qsearch(pos, ss, alpha - 1, alpha); if (value < alpha) @@ -797,7 +797,7 @@ namespace { // Step 9. Null move search with verification search (~22 Elo) if ( !PvNode && (ss-1)->currentMove != MOVE_NULL - && (ss-1)->statScore < 14695 + && (ss-1)->statScore < 15344 && eval >= beta && eval >= ss->staticEval && ss->staticEval >= beta - 15 * depth - improvement / 15 + 201 + complexity / 24 @@ -808,7 +808,7 @@ namespace { assert(eval - beta >= 0); // Null move dynamic reduction based on depth, eval and complexity of position - Depth R = std::min(int(eval - beta) / 147, 5) + depth / 3 + 4 - (complexity > 650); + Depth R = std::min(int(eval - beta) / 152, 5) + depth / 3 + 4 - (complexity > 650); ss->currentMove = MOVE_NULL; ss->continuationHistory = &thisThread->continuationHistory[0][0][NO_PIECE][0]; @@ -844,7 +844,7 @@ namespace { } } - probCutBeta = beta + 179 - 46 * improving; + probCutBeta = beta + 173 - 46 * improving; // Step 10. ProbCut (~4 Elo) // If we have a good enough capture and a reduced search returns a value @@ -906,9 +906,9 @@ namespace { return qsearch(pos, ss, alpha, beta); if ( cutNode - && depth >= 8 + && depth >= 9 && !ttMove) - depth--; + depth -= 2; moves_loop: // When in check, search starts here @@ -1009,7 +1009,7 @@ moves_loop: // When in check, search starts here && !PvNode && lmrDepth < 6 && !ss->inCheck - && ss->staticEval + 281 + 179 * lmrDepth + PieceValue[EG][pos.piece_on(to_sq(move))] + && ss->staticEval + 277 + 187 * lmrDepth + PieceValue[EG][pos.piece_on(to_sq(move))] + captureHistory[movedPiece][to_sq(move)][type_of(pos.piece_on(to_sq(move)))] / 6 < alpha) continue; @@ -1173,7 +1173,7 @@ moves_loop: // When in check, search starts here + (*contHist[0])[movedPiece][to_sq(move)] + (*contHist[1])[movedPiece][to_sq(move)] + (*contHist[3])[movedPiece][to_sq(move)] - - 4334; + - 4560; // Decrease/increase reduction for moves with a good/bad history (~30 Elo) r -= ss->statScore / 15914; @@ -1188,7 +1188,7 @@ moves_loop: // When in check, search starts here // Do full depth search when reduced LMR search fails high if (value > alpha && d < newDepth) { - const bool doDeeperSearch = value > (alpha + 78 + 11 * (newDepth - d)); + const bool doDeeperSearch = value > (alpha + 73 + 12 * (newDepth - d)); value = -search(pos, ss+1, -(alpha+1), -alpha, newDepth + doDeeperSearch, !cutNode); int bonus = value > alpha ? stat_bonus(newDepth) @@ -1337,14 +1337,14 @@ moves_loop: // When in check, search starts here quietsSearched, quietCount, capturesSearched, captureCount, depth); // Bonus for prior countermove that caused the fail low - else if ( (depth >= 4 || PvNode) + else if ( (depth >= 5 || PvNode) && !priorCapture) { //Assign extra bonus if current node is PvNode or cutNode //or fail low was really bad bool extraBonus = PvNode || cutNode - || bestValue < alpha - 70 * depth; + || bestValue < alpha - 66 * depth; update_continuation_histories(ss-1, pos.piece_on(prevSq), prevSq, stat_bonus(depth) * (1 + extraBonus)); }