From ca6ce6398b1bd21ff2ac29b2dc27d7c25abbb509 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 18 Apr 2019 22:10:43 +0200 Subject: [PATCH 1/1] Revert "Revert "Shuffle detection #2064"" This reverts commit 5928cb2b300baafb040495ce41f9a5f42132d141. --- src/search.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/search.cpp b/src/search.cpp index 15e88ca4..95b14021 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -607,6 +607,15 @@ namespace { : ttHit ? tte->move() : MOVE_NONE; ttPv = (ttHit && tte->is_pv()) || (PvNode && depth > 4 * ONE_PLY); + // if position has been searched at higher depths and we are shuffling, return value_draw + if (pos.rule50_count() > 36 + && ss->ply > 36 + && depth < 3 * ONE_PLY + && ttHit + && tte->depth() > depth + && pos.count() > 0) + return VALUE_DRAW; + // At non-PV nodes we check for an early TT cutoff if ( !PvNode && ttHit @@ -924,6 +933,10 @@ moves_loop: // When in check, search starts from here && (pos.blockers_for_king(~us) & from_sq(move) || pos.see_ge(move))) extension = ONE_PLY; + // Shuffle extension + else if(pos.rule50_count() > 14 && ss->ply > 14 && depth < 3 * ONE_PLY && PvNode) + extension = ONE_PLY; + // Castling extension else if (type_of(move) == CASTLING) extension = ONE_PLY; -- 2.39.2