summaryrefslogtreecommitdiff
path: root/src/split.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/split.c')
-rwxr-xr-xsrc/split.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/split.c b/src/split.c
index bbaa518..2672c0c 100755
--- a/src/split.c
+++ b/src/split.c
@@ -1122,23 +1122,26 @@ Return value:
}
//
- // Decide whether to history prune
+ // Decide how much (if any) to reduce this move's depth.
//
- if (TRUE == WeShouldDoHistoryPruning(iRoughEval,
- iAlpha,
- iBeta,
- ctx,
- uDepth,
- (g_SplitInfo[u].uAlreadyDone +
- uMoveNum + 1),
- mv,
- (g_SplitInfo[u].uAlreadyDone +
- uMoveNum + 1),
- iExtend))
{
- ASSERT(iExtend == 0);
- iExtend = -ONE_PLY;
- ctx->sPlyInfo[ctx->uPly].iExtensionAmount = -ONE_PLY;
+ INT iLMR = GetLMRReduction(iRoughEval,
+ iAlpha,
+ iBeta,
+ ctx,
+ uDepth,
+ (g_SplitInfo[u].uAlreadyDone +
+ uMoveNum + 1),
+ mv,
+ (g_SplitInfo[u].uAlreadyDone +
+ uMoveNum + 1),
+ iExtend);
+ if (iLMR < 0)
+ {
+ ASSERT(iExtend == 0);
+ iExtend = iLMR;
+ ctx->sPlyInfo[ctx->uPly].iExtensionAmount = iLMR;
+ }
}
//
@@ -1159,7 +1162,7 @@ Return value:
//
if ((iExtend < 0) && (iScore >= iBeta))
{
- uDepth += ONE_PLY;
+ uDepth -= iExtend; // undo the full reduction, whatever its magnitude
ctx->sPlyInfo[ctx->uPly].iExtensionAmount = 0;
iScore = -Search(ctx, -iBeta, -iAlpha, uDepth);
}