changed rfp return value | bench 1735187 #159

Merged
rektdie merged 1 commits from rfp-return into main 2026-03-20 12:01:59 +01:00
2 changed files with 8 additions and 1 deletions

No files matched your search

+7 -1
View File
@@ -226,6 +226,10 @@ static bool ShouldStop(SearchContext* ctx) {
return false;
}
static bool IsDecisive(int score) {
return std::abs(score) > WIN_SCORE;
}
template <bool isPV, searchMode mode>
static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, SearchContext* ctx) {
if (ShouldStop<mode>(ctx)) return 0;
@@ -409,7 +413,9 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
// Reverse Futility Pruning
int margin = rfpBase + rfpMargin * (depth - improving);
if (!ttpv && ttAdjustedEval - margin >= beta && depth < 7) {
return (beta + (ttAdjustedEval - beta) / 3);
return !IsDecisive(ttAdjustedEval) && !IsDecisive(beta)
? ((ttAdjustedEval + beta) / 2)
: ttAdjustedEval;
}
// Razoring
+1
View File
@@ -23,6 +23,7 @@ enum searchMode {
constexpr int MATE_SCORE = 32767;
constexpr int MAX_DEPTH = 256;
constexpr int MAX_HISTORY = 16384;
constexpr int WIN_SCORE = 30000;
constexpr int CORRHIST_WEIGHT_SCALE = 256;
constexpr int CORRHIST_GRAIN = 256;