From 23dfcc298723ece346d8de3614a5f040baddb8f7 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 11 Apr 2018 09:32:12 +0200 Subject: [PATCH] Suppress pruning of futile interpositions in Kyoto Shogi In horizon nodes check evasions through drops on unprotected squares were pruned, based on the idea that the checking slider would simply capture the piece to renew the check. In games with automatic promotion (such as Kyoto an micro-Shogi) this capture would alter the piece type, so we cannot be sure it woul renew the check. The auto-promotion is recognize from 'promoDrops', as these always seem to go together. --- dropper.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dropper.c b/dropper.c index b4d10fa..5d521cf 100644 --- a/dropper.c +++ b/dropper.c @@ -1269,7 +1269,7 @@ Search (int stm, int alpha, int beta, StackFrame *ff, int depth, int reduction, if(f.checker == CK_UNKNOWN) CheckTest(stm, ff, &f); // test for check if hash did not supply it if(f.checker != CK_NONE) { depth++, maxDepth++, reduction = originalReduction = 0 /*, killers[ply][2] = -1*/; // extend check evasions - if(earlyGen && f.checkDist && maxDepth <= 1) ipMask = SafeIP(&f); + if(earlyGen && f.checkDist && maxDepth <= 1 && !promoDrops) ipMask = SafeIP(&f); } else if(depth > LMR) { if(depth - reduction < LMR) reduction = depth - LMR; // never reduce to below 'LMR' ply depth -= reduction; @@ -1313,7 +1313,7 @@ Search (int stm, int alpha, int beta, StackFrame *ff, int depth, int reduction, if(MoveGen(stm, &m, f.rights)) { // impossible (except for hash collision giving wrong in-check status) if(DEBUG) Dump("King capture"); ff->depth = MAXPLY; ff->lim = -INF; moveSP = oldSP; anaSP = oldAna; return INF; } - if(f.checkDist && maxDepth <= 1) ipMask = SafeIP(&f); + if(f.checkDist && maxDepth <= 1 && !promoDrops) ipMask = SafeIP(&f); } if(hashMove) moveStack[--m.firstMove] = hashMove; // put hash move in front of list (duplicat!) if(f.checker != CK_NONE) moveSP = m.drops = m.castlings; // clip off castlings when in check -- 1.7.0.4