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 alpha = -inf;
int beta = inf; int beta = inf;
int delta = 50;
for (int depth = 1; depth <= 99; depth++) { for (int depth = 1; depth <= 99; depth++) {
timeToSearch = (fullTime / 20) + (inc / 2); 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 we fell outside the window, try again with full width
if ((currentResults.score <= alpha) if ((currentResults.score <= alpha)
|| (currentResults.score >= beta)) { || (currentResults.score >= beta)) {
alpha = -inf; delta *= 2;
beta = inf;
alpha -= delta;
beta += delta;
depth--; depth--;
if (searchStopped) break; if (searchStopped) break;
continue; continue;
} }
alpha = currentResults.score - aspWinConst; alpha = currentResults.score - delta;
beta = currentResults.score + aspWinConst; beta = currentResults.score + delta;
delta = 50;
if (currentResults.bestMove) { if (currentResults.bestMove) {
safeResults = currentResults; safeResults = currentResults;
-2
View File
@@ -8,8 +8,6 @@ extern bool benchStarted;
constexpr int invalidEntry = 111111; constexpr int invalidEntry = 111111;
constexpr int inf = 100000; constexpr int inf = 100000;
constexpr int aspWinConst = 50;
class SearchResults { class SearchResults {
public: public:
int score = 0; int score = 0;