From d0ea5acd6357d09572462b00c9216beace25f5ca Mon Sep 17 00:00:00 2001 From: Vivien Clauzon Date: Wed, 6 Nov 2024 20:37:36 +0100 Subject: [PATCH] tune search --- Source/searcherDraw.cpp | 2 +- Source/searcherPVS.hpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/searcherDraw.cpp b/Source/searcherDraw.cpp index 08ccf915..b513acc0 100644 --- a/Source/searcherDraw.cpp +++ b/Source/searcherDraw.cpp @@ -8,7 +8,7 @@ bool Searcher::isRep(const Position& p, bool isPV) const { if (p.fifty < (2 * limit - 1)) return false; int count = 0; const Hash h = computeHash(p); - int k = p.halfmoves - 2; + int k = p.halfmoves - 4; bool irreversible = false; //std::cout << "***************** " << k << " " << h << " " << GetFEN(p) << std::endl; // look in stack first diff --git a/Source/searcherPVS.hpp b/Source/searcherPVS.hpp index 73d94645..1f171c4f 100644 --- a/Source/searcherPVS.hpp +++ b/Source/searcherPVS.hpp @@ -262,6 +262,7 @@ Searcher::depthPolicy( [[maybe_unused]] const Position & p, //reduction -= pvsData.theirTurn; ///@todo use in capture also ? //reduction -= isDangerRed || pvsData.isEmergencyDefence; reduction -= pvsData.isKnownEndGame; + reduction -= pvsData.isAdvancedPawnPush; } else if (Move2Type(m) == T_capture){ stats.incr(Stats::sid_lmrcap); @@ -280,14 +281,14 @@ Searcher::depthPolicy( [[maybe_unused]] const Position & p, const Square to = Move2To(m); // ok this is a std capture (no ep) const int hScore = HISTORY_DIV(SearchConfig::lmrCapHistoryFactor * historyT.historyCap[PieceIdx(p.board_const(Move2From(m)))][to][Abs(p.board_const(to))-1]); reduction -= std::max(-2,std::min(2, hScore)); - // ----------------------- // less reduction // ----------------------- reduction -= pvsData.pvnode; + //reduction -= pvsData.ttMoveIsCapture; //reduction -= pvsData.formerPV || pvsData.ttPV; reduction -= pvsData.improving; - //reduction -= pvsData.ttMoveIsCapture; + reduction -= pvsData.isAdvancedPawnPush; } // never extend more than reduce (to avoid search explosion) @@ -1095,7 +1096,7 @@ ScoreType Searcher::pvs(ScoreType alpha, stats.incr(Stats::sid_singularExtension2); ++extension; /* - if (score < betaC - 8 * depth && !pvsData.ttMoveIsCapture){ + if (score < betaC - 8 * depth && !pvsData.ttMoveIsCapture && extensions <= 6){ stats.incr(Stats::sid_singularExtension6); ++extension; } @@ -1290,7 +1291,7 @@ ScoreType Searcher::pvs(ScoreType alpha, else { // reductions & prunings const bool isPrunable = /*pvsData.isNotPawnEndGame &&*/ !pvsData.isAdvancedPawnPush && !isMateScore(alpha) && !killerT.isKiller(*it, height) && !DynamicConfig::mateFinder; - const bool isReductible = SearchConfig::doLMR && depth >= SearchConfig::lmrMinDepth && /*pvsData.isNotPawnEndGame &&*/ !pvsData.isAdvancedPawnPush && !DynamicConfig::mateFinder; + const bool isReductible = SearchConfig::doLMR && depth >= SearchConfig::lmrMinDepth && /*pvsData.isNotPawnEndGame &&*/ /*!pvsData.isAdvancedPawnPush &&*/ !DynamicConfig::mateFinder; const bool isPrunableStd = isPrunable && pvsData.isQuiet; const bool isPrunableStdNoCheck = isPrunableStd && noCheck; const bool isPrunableCap = isPrunable && Move2Type(*it) == T_capture && noCheck;