re-init SEE values and LMR table on tuning | bench 1398874

This commit is contained in:
rektdie committed 2026-04-01 19:22:10 +02:00
1 parent 13cb768c67
commit cfcd24318b
4 files changed
+31 -6

No files matched your search

+10 -6
View File
@@ -44,12 +44,16 @@ int main(int argc, char* argv[]) {
MOVEGEN::initLeaperAttacks();
MOVEGEN::initSliderAttacks();
UTILS::InitZobrist();
SEARCH::InitLMRTable();
Board board;
MOVEGEN::initLeaperAttacks();
MOVEGEN::initSliderAttacks();
UTILS::InitZobrist();
#ifdef TUNING
SEARCH::RefreshTunableCaches();
#else
SEARCH::InitLMRTable();
#endif
Board board;
if (argc > 1) {
if (std::string(argv[1]) == "bench") {
+13
View File
@@ -50,6 +50,19 @@ void InitLMRTable() {
}
}
#ifdef TUNING
void InitSEEPieceValues() {
SEEPieceValues = {
seePawnValue, seeKnightValue, seeBishopValue, seeRookValue, seeQueenValue, 0
};
}
void RefreshTunableCaches() {
InitLMRTable();
InitSEEPieceValues();
}
#endif
int16_t ContHistory::GetNPly(Board& board, Move& move, SearchContext* ctx, int ply, int n) {
int prevType = ctx->ss[ply-n].pieceType;
int prevTo = ctx->ss[ply-n].moveTo;
+6
View File
@@ -48,6 +48,12 @@ constexpr std::array<int, 6> SEEPieceValues = {
#endif
void InitLMRTable();
#ifdef TUNING
void InitSEEPieceValues();
void RefreshTunableCaches();
#endif
class SearchContext;
class CaptHistory {
+2
View File
@@ -206,6 +206,7 @@ static void SetOption(std::string& command, SEARCH::SearchContext* ctx) {
if (v < min_val) v = min_val; \
if (v > max_val) v = max_val; \
paramName = v; \
SEARCH::RefreshTunableCaches(); \
return; \
}
@@ -215,6 +216,7 @@ static void SetOption(std::string& command, SEARCH::SearchContext* ctx) {
if (v < min_val) v = min_val; \
if (v > max_val) v = max_val; \
paramName = v; \
SEARCH::RefreshTunableCaches(); \
return; \
}