increased depth immidiately previously on check | bench 3103117
This commit is contained in:
1 parent
386ecd3fd9
commit
c0d196a9f5
1 file changed
+8
-8
+8
-8
@@ -207,9 +207,7 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) {
|
|||||||
|
|
||||||
const int staticEval = HCE::Evaluate(board);
|
const int staticEval = HCE::Evaluate(board);
|
||||||
|
|
||||||
if (board.InCheck()) {
|
if (!board.InCheck()) {
|
||||||
depth++;
|
|
||||||
} else {
|
|
||||||
if (ply) {
|
if (ply) {
|
||||||
// Reverse Futility Pruning
|
// Reverse Futility Pruning
|
||||||
int margin = 100 * depth;
|
int margin = 100 * depth;
|
||||||
@@ -267,26 +265,28 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) {
|
|||||||
|
|
||||||
int reductions = GetReductions(board, currMove, depth, moveSeen, ply);
|
int reductions = GetReductions(board, currMove, depth, moveSeen, ply);
|
||||||
|
|
||||||
|
int newDepth = depth + board.InCheck() - 1;
|
||||||
|
|
||||||
// First move (suspected PV node)
|
// First move (suspected PV node)
|
||||||
if (!i) {
|
if (!i) {
|
||||||
// Full search
|
// Full search
|
||||||
score = -PVS<isPV>(copy, depth - 1, -beta, -alpha, ply + 1).score;
|
score = -PVS<isPV>(copy, newDepth, -beta, -alpha, ply + 1).score;
|
||||||
} else if (reductions) {
|
} else if (reductions) {
|
||||||
// Null-window search with reductions
|
// Null-window search with reductions
|
||||||
score = -PVS<false>(copy, depth - 1 - reductions, -alpha-1, -alpha, ply + 1).score;
|
score = -PVS<false>(copy, newDepth - reductions, -alpha-1, -alpha, ply + 1).score;
|
||||||
|
|
||||||
if (score > alpha) {
|
if (score > alpha) {
|
||||||
// Null-window search now without the reduction
|
// Null-window search now without the reduction
|
||||||
score = -PVS<false>(copy, depth - 1, -alpha-1, -alpha, ply + 1).score;
|
score = -PVS<false>(copy, newDepth, -alpha-1, -alpha, ply + 1).score;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Null-window search
|
// Null-window search
|
||||||
score = -PVS<false>(copy, depth - 1, -alpha-1, -alpha, ply + 1).score;
|
score = -PVS<false>(copy, newDepth, -alpha-1, -alpha, ply + 1).score;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if we need to do full window re-search
|
// Check if we need to do full window re-search
|
||||||
if (i && score > alpha && score < beta) {
|
if (i && score > alpha && score < beta) {
|
||||||
score = -PVS<isPV>(copy, depth - 1, -beta, -alpha, ply + 1).score;
|
score = -PVS<isPV>(copy, newDepth, -beta, -alpha, ply + 1).score;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (searchStopped) return 0;
|
if (searchStopped) return 0;
|
||||||
|
|||||||
Reference in new issue
Block a user