summaryrefslogtreecommitdiff
path: root/src/dynamic.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dynamic.c')
-rwxr-xr-xsrc/dynamic.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/dynamic.c b/src/dynamic.c
index 5915721..6a1dae8 100755
--- a/src/dynamic.c
+++ b/src/dynamic.c
@@ -317,8 +317,16 @@ Return value:
{
ctx->mvKiller[uPly][1] = ctx->mvKiller[uPly][0];
ctx->mvKiller[uPly][0] = mv;
- if (ctx->mvKiller[uPly][1].uMove == 0)
+ if ((ctx->mvKiller[uPly][1].uMove == 0) &&
+ (!IS_SAME_MOVE(ctx->mvNullmoveQuietRefutations[uPly], mv)))
{
+ // Guard against backfilling slot[1] with the same move
+ // just placed in slot[0] -- e.g. this ply's recorded
+ // null-move quiet refutation happens to coincide with
+ // the move causing the current fail-high. Without this
+ // check both slots would hold the identical move,
+ // wasting a killer slot (and, in a DEBUG build,
+ // tripping the assert below) for no ordering benefit.
ctx->mvKiller[uPly][1] = ctx->mvNullmoveQuietRefutations[uPly];
}
}