factorized some heuristics | bench 1398874
This commit is contained in:
1 parent
f69da36c7c
commit
04b1187963
2 files changed
+26
-6
No files matched your search
+16
-3
@@ -452,7 +452,13 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
|
||||
if (!board.InCheck() && !ctx->excluded) {
|
||||
if (ply) {
|
||||
// Reverse Futility Pruning
|
||||
int margin = rfpBase + rfpMargin * (depth - improving);
|
||||
|
||||
int margin = (
|
||||
rfpBase
|
||||
+ depth * rfpMargin
|
||||
- improving * rfpImprovingMargin
|
||||
) / 128;
|
||||
|
||||
if (!ttpv && ttAdjustedEval - margin >= beta && depth < 7) {
|
||||
return !IsDecisive(ttAdjustedEval) && !IsDecisive(beta)
|
||||
? ((ttAdjustedEval + beta) / 2)
|
||||
@@ -470,7 +476,12 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
|
||||
Board copy = board;
|
||||
copy.MakeMove(Move());
|
||||
|
||||
const int reduction = 4 + improving + depth / 3 + entry.bestMove.IsCapture();
|
||||
const int reduction = (
|
||||
nmpBaseReduction
|
||||
+ improving * nmpImprovingReduction
|
||||
+ depth * nmpDepthReduction
|
||||
+ entry.bestMove.IsCapture() * nmpCaptureReduction
|
||||
) / 192;
|
||||
|
||||
ctx->TT->PrefetchEntry(copy.hashKey);
|
||||
|
||||
@@ -598,7 +609,9 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
|
||||
historyScore += ctx->conthist.GetNPly(board, currMove, ctx, ply, 2);
|
||||
}
|
||||
|
||||
int margin = fpMargin * (lmrDepth + improving) + historyScore / 32;
|
||||
int margin =
|
||||
(lmrDepth * fpMargin + improving * fpImprovingMargin) / 128
|
||||
+ (historyScore * fpHistoryMargin) / 128;
|
||||
|
||||
if (!isPV && ply && currMove.IsQuiet()
|
||||
&& lmrDepth <= 7 && staticEval + margin < alpha && notMated && !board.GivesDirectCheck(currMove)) {
|
||||
|
||||
Reference in new issue
Block a user