Skip to content

Commit

Permalink
fix static eval init at root
Browse files Browse the repository at this point in the history
test r15
  • Loading branch information
dhbloo committed Jun 13, 2024
1 parent fa863d2 commit af703ba
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Rapfi/search/ab/searchstack.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,13 @@ class StackArray : std::vector<SearchStack>
reserve(maxPly + plyBeforeRoot + plyAfterMax);
for (int i = -plyBeforeRoot; i < maxPly + plyAfterMax; i++)
push_back(SearchStack {nextTriPvIndex(i), i});

// Initialize static evaluation for plies before root
for (int i = 0; i <= plyBeforeRoot; i++)
(*this)[i].staticEval = initStaticEval;
Value staticEval = initStaticEval;
for (int i = plyBeforeRoot; i >= 0; i--) {
(*this)[i].staticEval = staticEval;
staticEval = -staticEval;
}
}
SearchStack *rootStack() { return &(*this)[plyBeforeRoot]; }

Expand Down

0 comments on commit af703ba

Please sign in to comment.