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 10 additions and 6 deletions
Showing only changes of commit 1e548d3bd5 - Show all commits

No files matched your search

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