Merge pull request #159 from rektdie/rfp-return

changed rfp return value | bench 1833557
This commit was merged in pull request #159.
This commit is contained in:
rektdie authored and GitHub committed 2026-03-20 12:01:59 +01:00
commit 83c9a2c51c
2 files changed
+8 -1

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;