Aspiration windows #11

Merged
rektdie merged 2 commits from aspiration_windows into legalMovegen 2025-03-06 22:12:55 +01:00
2 changed files with 25 additions and 2 deletions

No files matched your search

+25 -1
View File
@@ -252,10 +252,34 @@ static SearchResults ID(Board &board, SearchParams params) {
SearchResults safeResults;
safeResults.score = -inf;
int alpha = -inf;
int beta = inf;
int delta = 50;
for (int depth = 1; depth <= 99; depth++) {
timeToSearch = (fullTime / 20) + (inc / 2);
SearchResults currentResults = PVS(board, depth, -inf, inf);
SearchResults currentResults = PVS(board, depth, alpha, beta);
// If we fell outside the window, try again with full width
if ((currentResults.score <= alpha)
|| (currentResults.score >= beta)) {
delta *= 2;
alpha -= delta;
beta += delta;
depth--;
if (searchStopped) break;
continue;
}
alpha = currentResults.score - delta;
beta = currentResults.score + delta;
delta = 50;
if (currentResults.bestMove) {
safeResults = currentResults;
}
-1
View File
@@ -8,7 +8,6 @@ extern bool benchStarted;
constexpr int invalidEntry = 111111;
constexpr int inf = 100000;
class SearchResults {
public:
int score = 0;