summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/search.c')
-rwxr-xr-xsrc/search.c14
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);