Skip to content

Commit

Permalink
tune search
Browse files Browse the repository at this point in the history
  • Loading branch information
tryingsomestuff committed Nov 11, 2024
1 parent 4afa14a commit d0ea5ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Source/searcherDraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions Source/searcherPVS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d0ea5ac

Please sign in to comment.