diff options
Diffstat (limited to 'src/split.c')
| -rwxr-xr-x | src/split.c | 23 |
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) |
