search: remove nmp verification | bench 1884706
This commit is contained in:
1 parent
0f748da56c
commit
3a02ddf41f
2 files changed
+17
-12
No files matched your search
+16
-12
@@ -495,6 +495,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
|
|||||||
ctx->doingNullMove = false;
|
ctx->doingNullMove = false;
|
||||||
|
|
||||||
if (ctx->searchStopped) return 0;
|
if (ctx->searchStopped) return 0;
|
||||||
|
|
||||||
if (score >= beta) return score;
|
if (score >= beta) return score;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -576,17 +577,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
|
|||||||
bool notMated = results.score > (-MATE_SCORE + MAX_DEPTH);
|
bool notMated = results.score > (-MATE_SCORE + MAX_DEPTH);
|
||||||
int lmrDepth = depth - lmrTable[currMove.IsQuiet()][depth][moveSeen];
|
int lmrDepth = depth - lmrTable[currMove.IsQuiet()][depth][moveSeen];
|
||||||
|
|
||||||
// Late move pruning
|
int historyScore = 0;
|
||||||
// If we are near a leaf node we prune moves
|
|
||||||
// that are late in the list
|
|
||||||
if (currMove.IsQuiet() && notMated) {
|
|
||||||
|
|
||||||
int lmpThreshold = 7 + depth * depth * (1 + improving);
|
|
||||||
|
|
||||||
if (moveSeen >= lmpThreshold) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool sourceThreatened = board.IsSquareThreatened(board.sideToMove, currMove.MoveFrom());
|
bool sourceThreatened = board.IsSquareThreatened(board.sideToMove, currMove.MoveFrom());
|
||||||
bool targetThreatened = board.IsSquareThreatened(board.sideToMove, currMove.MoveTo());
|
bool targetThreatened = board.IsSquareThreatened(board.sideToMove, currMove.MoveTo());
|
||||||
@@ -594,7 +585,8 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
|
|||||||
// Futility pruning
|
// Futility pruning
|
||||||
// If our static eval is far below alpha, there is only a small chance
|
// If our static eval is far below alpha, there is only a small chance
|
||||||
// that a quiet move will help us so we skip them
|
// that a quiet move will help us so we skip them
|
||||||
int historyScore = ctx->history[board.sideToMove][currMove.MoveFrom()][currMove.MoveTo()][sourceThreatened][targetThreatened];
|
if (currMove.IsQuiet()) {
|
||||||
|
historyScore = ctx->history[board.sideToMove][currMove.MoveFrom()][currMove.MoveTo()][sourceThreatened][targetThreatened];
|
||||||
|
|
||||||
if (ply > 0) {
|
if (ply > 0) {
|
||||||
historyScore += ctx->conthist.GetNPly(board, currMove, ctx, ply, 1);
|
historyScore += ctx->conthist.GetNPly(board, currMove, ctx, ply, 1);
|
||||||
@@ -603,6 +595,18 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
|
|||||||
historyScore += ctx->conthist.GetNPly(board, currMove, ctx, ply, 2);
|
historyScore += ctx->conthist.GetNPly(board, currMove, ctx, ply, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Late move pruning
|
||||||
|
// If we are near a leaf node we prune quiet moves
|
||||||
|
// that are late in the list, unless history says they're promising
|
||||||
|
if (notMated) {
|
||||||
|
int lmpThreshold = 7 + depth * depth * (1 + improving);
|
||||||
|
|
||||||
|
if (moveSeen >= lmpThreshold && historyScore < lmpHistoryThreshold) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int margin = fpMargin * (lmrDepth + improving) + historyScore / 32;
|
int margin = fpMargin * (lmrDepth + improving) + historyScore / 32;
|
||||||
|
|
||||||
if (!isPV && ply && currMove.IsQuiet()
|
if (!isPV && ply && currMove.IsQuiet()
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
X_INT(lmrCorrplexity, 1024, 6000, 10000) \
|
X_INT(lmrCorrplexity, 1024, 6000, 10000) \
|
||||||
X_INT(rfpBase, 25, 50, 200) \
|
X_INT(rfpBase, 25, 50, 200) \
|
||||||
X_INT(rfpMargin, 100, 50, 200) \
|
X_INT(rfpMargin, 100, 50, 200) \
|
||||||
|
X_INT(lmpHistoryThreshold, -4096, -8192, 2048) \
|
||||||
X_INT(fpMargin, 100, 50, 200) \
|
X_INT(fpMargin, 100, 50, 200) \
|
||||||
X_INT(razoringScalar, 200, 50, 200) \
|
X_INT(razoringScalar, 200, 50, 200) \
|
||||||
X_INT(doubleExtMargin, 30, 10, 60) \
|
X_INT(doubleExtMargin, 30, 10, 60) \
|
||||||
|
|||||||
Reference in new issue
Block a user