diff options
| author | Scott Gasch <[email protected]> | 2026-08-30 17:17:44 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2026-08-30 17:17:44 -0700 |
| commit | fd1460b2c135f6cef502fd167d1df0edf223e312 (patch) | |
| tree | ee20bae148e436a88abfb9e709fcf96634f04d45 /src/search.c | |
| parent | 3eac7f469add78edb9dd7dced36bde5427346321 (diff) | |
Improving for nullmove, eval speedup, remove old cruft, bugfix in split / MP.
Diffstat (limited to 'src/search.c')
| -rwxr-xr-x | src/search.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/search.c b/src/search.c index ab7d122..3879d9f 100755 --- a/src/search.c +++ b/src/search.c @@ -337,7 +337,12 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx, } // Maybe do nullmove pruning - iRoughEval = GetRoughEvalScore(ctx, iAlpha, iBeta, FALSE); + pi->iEval = iRoughEval = GetRoughEvalScore(ctx, iAlpha, iBeta, FALSE); + SCORE iImprovement = 0; + if (ctx->uPly > 1) + { + iImprovement = (iRoughEval - ctx->sPlyInfo[ctx->uPly - 2].iEval); + } GENERATE_NO_MOVES; if (!fSkipNull && !fThreat && @@ -345,6 +350,7 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx, iAlpha, iBeta, iRoughEval, + iImprovement, uNextDepth)) { if (TryNullmovePruning(ctx, @@ -466,6 +472,7 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx, ctx->sSearchFlags.fAvoidNullmove = TRUE; RescoreMovesViaSearch(ctx, uDepth, iAlpha, iBeta); ctx->sSearchFlags.fAvoidNullmove = FALSE; + ASSERT(TRUE == pi->fMovesRescoredByIID); } } #endif @@ -625,12 +632,13 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx, // underflow (ULONG) in that case, which is exactly why the // uDepth >= ONE_PLY check below short-circuits before the // g_fCanSplit[] indexing ever evaluates it. - if (((uLegalMoves >= 2)) && + if (((uLegalMoves >= 3)) && (0 != g_uNumHelpersAvailable) && + (FALSE == pi->fMovesRescoredByIID) && (0 == uFutilityMargin) && (uDepth >= ONE_PLY) && (TRUE == g_fCanSplit[uDepth / ONE_PLY - 1]) && - (MOVE_COUNT(ctx, ctx->uPly) > 3)) + (MOVE_COUNT(ctx, ctx->uPly) > 4)) { ASSERT(pf->fAvoidNullmove == FALSE); ASSERT(uStage == TRY_GENERATED_MOVES); |
