changed rfp return value | bench 1735187 #159
No files matched your search
+7
-1
@@ -226,6 +226,10 @@ static bool ShouldStop(SearchContext* ctx) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool IsDecisive(int score) {
|
||||||
|
return std::abs(score) > WIN_SCORE;
|
||||||
|
}
|
||||||
|
|
||||||
template <bool isPV, searchMode mode>
|
template <bool isPV, searchMode mode>
|
||||||
static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, SearchContext* ctx) {
|
static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, SearchContext* ctx) {
|
||||||
if (ShouldStop<mode>(ctx)) return 0;
|
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
|
// Reverse Futility Pruning
|
||||||
int margin = rfpBase + rfpMargin * (depth - improving);
|
int margin = rfpBase + rfpMargin * (depth - improving);
|
||||||
if (!ttpv && ttAdjustedEval - margin >= beta && depth < 7) {
|
if (!ttpv && ttAdjustedEval - margin >= beta && depth < 7) {
|
||||||
return (beta + (ttAdjustedEval - beta) / 3);
|
return !IsDecisive(ttAdjustedEval) && !IsDecisive(beta)
|
||||||
|
? ((ttAdjustedEval + beta) / 2)
|
||||||
|
: ttAdjustedEval;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Razoring
|
// Razoring
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ enum searchMode {
|
|||||||
constexpr int MATE_SCORE = 32767;
|
constexpr int MATE_SCORE = 32767;
|
||||||
constexpr int MAX_DEPTH = 256;
|
constexpr int MAX_DEPTH = 256;
|
||||||
constexpr int MAX_HISTORY = 16384;
|
constexpr int MAX_HISTORY = 16384;
|
||||||
|
constexpr int WIN_SCORE = 30000;
|
||||||
|
|
||||||
constexpr int CORRHIST_WEIGHT_SCALE = 256;
|
constexpr int CORRHIST_WEIGHT_SCALE = 256;
|
||||||
constexpr int CORRHIST_GRAIN = 256;
|
constexpr int CORRHIST_GRAIN = 256;
|
||||||
|
|||||||
Reference in new issue
Block a user