summaryrefslogtreecommitdiff
path: root/src/split.c
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-08-23 11:28:49 -0700
committerScott Gasch <[email protected]>2026-08-23 11:28:49 -0700
commitdf8facc22815f9eca0897e27ccce30701ba95322 (patch)
treebf90ad7ff19383fbac9b0a163f31bf3a9fb11fbe /src/split.c
parentdc0c9dbf405095a6483705b153f4c85c64499d4e (diff)
Clean X64 build and ported GetAttacks to x64.
Diffstat (limited to 'src/split.c')
-rwxr-xr-xsrc/split.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/split.c b/src/split.c
index 714d77b..ce9a752 100755
--- a/src/split.c
+++ b/src/split.c
@@ -1099,8 +1099,19 @@ Return value:
&iExtend);
//
+ // Cap total extension plies spent on this line, same as the
+ // non-split move loop in search.c does.
+ //
+ if (iExtend > 0)
+ {
+ iExtend = MIN(iExtend,
+ MAX(MAX_EXTEND_PER_LINE -
+ ctx->sSearchFlags.iCumulativeExtend, 0));
+ }
+
+ //
// Decide whether to history prune
- //
+ //
if (TRUE == WeShouldDoHistoryPruning(iRoughEval,
iAlpha,
iBeta,
@@ -1117,13 +1128,14 @@ Return value:
iExtend = -ONE_PLY;
ctx->sPlyInfo[ctx->uPly].iExtensionAmount = -ONE_PLY;
}
-
+
//
// Compute next depth
- //
+ //
uDepth = uDepth - ONE_PLY + iExtend;
if (uDepth >= MAX_DEPTH_PER_SEARCH) uDepth = 0;
-
+ ctx->sSearchFlags.iCumulativeExtend += iExtend;
+
iScore = -Search(ctx, -iAlpha - 1, -iAlpha, uDepth);
if ((iAlpha < iScore) && (iScore < iBeta))
{
@@ -1132,7 +1144,7 @@ Return value:
//
// Decide whether to research reduced branches to full depth.
- //
+ //
if ((iExtend < 0) && (iScore >= iBeta))
{
uDepth += ONE_PLY;
@@ -1140,6 +1152,7 @@ Return value:
iScore = -Search(ctx, -iBeta, -iAlpha, uDepth);
}
UnmakeMove(ctx, mv);
+ ctx->sSearchFlags.iCumulativeExtend -= iExtend;
ASSERT(PositionsAreEquivalent(&ctx->sPosition, &board));
if (TRUE == g_SplitInfo[u].fTerminate) break;
if (iScore > iBestScore)