summaryrefslogtreecommitdiff
path: root/src/searchsup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/searchsup.c')
-rw-r--r--src/searchsup.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/searchsup.c b/src/searchsup.c
index 72667c8..d2cbbbd 100644
--- a/src/searchsup.c
+++ b/src/searchsup.c
@@ -1089,14 +1089,14 @@ SelectNullmoveRFactor(SEARCHER_THREAD_CONTEXT *ctx,
}
-FLAG
-WeShouldTryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx,
- SCORE iAlpha,
- SCORE iBeta,
- SCORE iRoughEval,
- ULONG uNullDepth)
+FLAG WeShouldTryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx,
+ SCORE iAlpha,
+ SCORE iBeta,
+ SCORE iRoughEval,
+ SCORE iImprovement,
+ ULONG uNullDepth)
{
- static SCORE _iDistAlphaSkipNull[] = {
+ static SCORE iSkipNullMargins[] = {
700, 950, 1110, 1150, 1190, 1230, 1270, 0
};
POSITION *pos = &ctx->sPosition;
@@ -1119,8 +1119,14 @@ WeShouldTryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx,
{
u = uNullDepth / ONE_PLY;
ASSERT(u <= 6);
- if ((iRoughEval + _iDistAlphaSkipNull[u] <= iAlpha) ||
- ((iRoughEval + _iDistAlphaSkipNull[u] / 2 <= iAlpha) &&
+ SCORE iMargin = iSkipNullMargins[u];
+ if (iImprovement > 0)
+ {
+ iMargin -= iImprovement;
+ iMargin = MAX(0, iMargin);
+ }
+ if ((iRoughEval + iMargin <= iAlpha) ||
+ ((iRoughEval + iMargin / 2 <= iAlpha) &&
(ValueOfMaterialInTroubleAfterNull(ctx, pos->uToMove))))
{
return FALSE;