Skip to content

Commit

Permalink
Assume no search instability and do NegaScout.
Browse files Browse the repository at this point in the history
Did not have any search instability in the benchmark tests,
so I'll assume this either does not occur or is so rare its not an
issue.
  • Loading branch information
bsamseth committed Nov 19, 2018
1 parent 4278553 commit 206ea1b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ void Search::search_root(Depth depth, int alpha, int beta) {

if (value > alpha and value < beta) {
// PV search failed high, need to do a research.
int value2 = -search(depth - 1, -beta, -value, ply + 1);
value = std::max(value, value2);
// Assuming no instability, and using the new limit.
value = -search(depth - 1, -beta, -value, ply + 1);
}
}
// First move - search fully.
Expand Down Expand Up @@ -550,8 +550,8 @@ int Search::search(Depth depth, int alpha, int beta, int ply) {

if (value > alpha and value < beta) {
// PV search failed high, need to do a research.
int value2 = -search(depth - 1, -beta, -value, ply + 1);
value = std::max(value, value2);
// Assuming no instability, and using the new limit.
value = -search(depth - 1, -beta, -value, ply + 1);
}
} else {
// First move - do full search.
Expand Down

0 comments on commit 206ea1b

Please sign in to comment.