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
+26 -1

No files matched your search

+5 -1
View File
@@ -47,7 +47,11 @@ int main(int argc, char* argv[]) {
MOVEGEN::initLeaperAttacks(); MOVEGEN::initLeaperAttacks();
MOVEGEN::initSliderAttacks(); MOVEGEN::initSliderAttacks();
UTILS::InitZobrist(); UTILS::InitZobrist();
SEARCH::InitLMRTable(); #ifdef TUNING
SEARCH::RefreshTunableCaches();
#else
SEARCH::InitLMRTable();
#endif
Board board; Board board;
+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) { int16_t ContHistory::GetNPly(Board& board, Move& move, SearchContext* ctx, int ply, int n) {
int prevType = ctx->ss[ply-n].pieceType; int prevType = ctx->ss[ply-n].pieceType;
int prevTo = ctx->ss[ply-n].moveTo; int prevTo = ctx->ss[ply-n].moveTo;
+6
View File
@@ -48,6 +48,12 @@ constexpr std::array<int, 6> SEEPieceValues = {
#endif #endif
void InitLMRTable(); void InitLMRTable();
#ifdef TUNING
void InitSEEPieceValues();
void RefreshTunableCaches();
#endif
class SearchContext; class SearchContext;
class CaptHistory { 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 < min_val) v = min_val; \
if (v > max_val) v = max_val; \ if (v > max_val) v = max_val; \
paramName = v; \ paramName = v; \
SEARCH::RefreshTunableCaches(); \
return; \ return; \
} }
@@ -215,6 +216,7 @@ static void SetOption(std::string& command, SEARCH::SearchContext* ctx) {
if (v < min_val) v = min_val; \ if (v < min_val) v = min_val; \
if (v > max_val) v = max_val; \ if (v > max_val) v = max_val; \
paramName = v; \ paramName = v; \
SEARCH::RefreshTunableCaches(); \
return; \ return; \
} }