From fd1460b2c135f6cef502fd167d1df0edf223e312 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Sun, 30 Aug 2026 17:17:44 -0700 Subject: Improving for nullmove, eval speedup, remove old cruft, bugfix in split / MP. --- src/searchsup.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/searchsup.c') diff --git a/src/searchsup.c b/src/searchsup.c index 72667c8..d2cbbbd 100644 --- a/src/searchsup.c +++ b/src/searchsup.c @@ -1089,14 +1089,14 @@ SelectNullmoveRFactor(SEARCHER_THREAD_CONTEXT *ctx, } -FLAG -WeShouldTryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx, - SCORE iAlpha, - SCORE iBeta, - SCORE iRoughEval, - ULONG uNullDepth) +FLAG WeShouldTryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx, + SCORE iAlpha, + SCORE iBeta, + SCORE iRoughEval, + SCORE iImprovement, + ULONG uNullDepth) { - static SCORE _iDistAlphaSkipNull[] = { + static SCORE iSkipNullMargins[] = { 700, 950, 1110, 1150, 1190, 1230, 1270, 0 }; POSITION *pos = &ctx->sPosition; @@ -1119,8 +1119,14 @@ WeShouldTryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx, { u = uNullDepth / ONE_PLY; ASSERT(u <= 6); - if ((iRoughEval + _iDistAlphaSkipNull[u] <= iAlpha) || - ((iRoughEval + _iDistAlphaSkipNull[u] / 2 <= iAlpha) && + SCORE iMargin = iSkipNullMargins[u]; + if (iImprovement > 0) + { + iMargin -= iImprovement; + iMargin = MAX(0, iMargin); + } + if ((iRoughEval + iMargin <= iAlpha) || + ((iRoughEval + iMargin / 2 <= iAlpha) && (ValueOfMaterialInTroubleAfterNull(ctx, pos->uToMove)))) { return FALSE; -- cgit v1.3