diff options
Diffstat (limited to 'src/searchsup.c')
| -rw-r--r-- | src/searchsup.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/src/searchsup.c b/src/searchsup.c index e0d8251..54e1814 100644 --- a/src/searchsup.c +++ b/src/searchsup.c @@ -1167,7 +1167,7 @@ WeShouldTryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx, (FALSE == pi->fInCheck) && (iBeta != +INFINITY) && (FALSE == pi->fPvNode)) // <--- TODO: test this one please... - { + { if (uNullDepth <= 6 * ONE_PLY) { u = uNullDepth / ONE_PLY; @@ -1183,7 +1183,7 @@ WeShouldTryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx, } return FALSE; } - + FLAG TryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx, @@ -1203,10 +1203,10 @@ TryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx, SCORE iVerifyScore; MOVE mv; MOVE mvRef; - + ASSERT(IS_VALID_SCORE(iAlpha) && IS_VALID_SCORE(iBeta)); ASSERT(iAlpha < iBeta); - + // TODO: more experiments with quick null // Ok, do it. @@ -1265,7 +1265,7 @@ TryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx, ASSERT(SanityCheckMove(pos, mv)); ASSERT(GET_COLOR(mv.pMoved) == pos->uToMove); ASSERT(ctx->uPly >= 2); - + // If we make a nullmove that fails because we lose a // piece, remember that the piece in question is in danger. if ((mv.pCaptured) && !IS_PAWN(mv.pCaptured)) @@ -1291,7 +1291,29 @@ TryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx, } ctx->mvNullmoveRefutations[ctx->uPly] = mv; } - + else if (!IS_CAPTURE_OR_PROMOTION(mv)) + { + // A quiet move refuting our nullmove is itself decent + // evidence that the move is strong here -- not enough to + // extend on (that's the capture-only Botvinnik-Markoff + // case above), but worth remembering as a fallback guess + // for _NewKillerMove's empty-slot backfill, which is only + // useful when this is actually a quiet move: a killer + // slot only ever gets matched against generated quiet + // candidates (IS_SAME_MOVE compares the pCaptured/ + // pPromoted bits too), so storing a capture there (the + // old unconditional behavior) could never match anything + // and was silently dead. + // + // Deliberately a *separate* array from mvNullmoveRefutations, + // not a shared slot -- that one is read two plies later + // (ctx->uPly - 2, above) expecting a capture, to detect the + // same-piece-two-different-squares Botvinnik-Markoff pattern. + // Writing a quiet move into that same slot would silently + // clobber the capture history the extension depends on. + ctx->mvNullmoveQuietRefutations[ctx->uPly] = mv; + } + // This is an idea from Tord Romstad on ccc: if we are below a // history reduced node and we try a nullmove and the nullmove // fails low and the move that refuted the nullmove involves |
