summaryrefslogtreecommitdiff
path: root/src/split.c
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-08-25 14:03:46 -0700
committerScott Gasch <[email protected]>2026-08-25 14:03:46 -0700
commitba803fe406ee2470aa461578f530d292380ec241 (patch)
treec083e1f88e1e8c978084b34b9b315c3eec682e32 /src/split.c
parent29d73f4dd59554a349aa8e86e5ea65f28c912ec9 (diff)
Add LMR with PV-adjacency guard (v7), verified against saved binary
Late Move Reductions using a depth x movecount table (Ethereal-style formula), gated off PV nodes and the ply directly below a PV node (PLY_INFO.fIsPVNode), with magnitude-aware re-search on fail-high. Verified node-for-node identical to the previously tested-good v7 binary on a canary position (sd 10) after reconstructing from a ZFS snapshot of search.c/root.c/split.c taken just before that binary was built. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Diffstat (limited to 'src/split.c')
-rwxr-xr-xsrc/split.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/split.c b/src/split.c
index ce9a752..b30cdb6 100755
--- a/src/split.c
+++ b/src/split.c
@@ -1125,8 +1125,12 @@ Return value:
iExtend))
{
ASSERT(iExtend == 0);
- iExtend = -ONE_PLY;
- ctx->sPlyInfo[ctx->uPly].iExtensionAmount = -ONE_PLY;
+ iExtend = -(ONE_PLY + ExtraReduction(uDepth,
+ (g_SplitInfo[u].uAlreadyDone +
+ uMoveNum + 1),
+ GetMoveFailHighPercentage(mv)));
+ ctx->sPlyInfo[ctx->uPly].iExtensionAmount = iExtend;
+ INC(ctx->sCounters.tree.u64HistoryPrunes);
}
//
@@ -1147,8 +1151,9 @@ 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;
+ INC(ctx->sCounters.tree.u64HistoryPruneReSearches);
iScore = -Search(ctx, -iBeta, -iAlpha, uDepth);
}
UnmakeMove(ctx, mv);