diff --git a/src/search.cpp b/src/search.cpp index d08418813..79bb44c63 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -71,12 +71,20 @@ namespace { // tests at these types of time controls. // Futility margin -Value futility_margin(Depth d, bool noTtCutNode, bool improving, bool oppWorsening) { - Value futilityMult = 110 - 25 * noTtCutNode; +Value futility_margin(Depth d, + bool noTtCutNode, + bool improving, + bool oppWorsening, + int statScore, + int correctionValue) { + Value futilityMult = 98 - 22 * noTtCutNode; Value improvingDeduction = improving * futilityMult * 2; Value worseningDeduction = oppWorsening * futilityMult / 3; + Value statScoreAddition = statScore / 339; + Value correctionAddition = correctionValue / 157363; - return futilityMult * d - improvingDeduction - worseningDeduction; + return futilityMult * d - improvingDeduction - worseningDeduction + statScoreAddition + + correctionAddition; } constexpr int futility_move_count(bool improving, Depth depth) { @@ -866,9 +874,9 @@ Value Search::Worker::search( // Step 8. Futility pruning: child node // The depth condition is important for mate finding. if (!ss->ttPv && depth < 14 - && eval - futility_margin(depth, cutNode && !ss->ttHit, improving, opponentWorsening) - - (ss - 1)->statScore / 301 + 37 + ((eval - beta) / 8) - - std::abs(correctionValue) / 139878 + && eval + - futility_margin(depth, cutNode && !ss->ttHit, improving, opponentWorsening, + (ss - 1)->statScore, std::abs(correctionValue)) >= beta && eval >= beta && (!ttData.move || ttCapture) && !is_loss(beta) && !is_win(eval)) return beta + (eval - beta) / 3;