storing score into tt correctly on mate | bench 1632393

This commit is contained in:
rektdie committed 2026-10-03 17:16:16 +02:00
1 parent 134af1abde
commit edfa6ead28
2 files changed
+25 -5

No files matched your search

+16
View File
@@ -34,6 +34,22 @@ constexpr int CORRHIST_MAX = 16384;
constexpr int32_t ScoreNone = -255000;
constexpr int inf = 100000;
inline int ScoreToTT(int score, int ply) {
if (score >= MATE_SCORE - MAX_DEPTH)
return score + ply;
if (score <= -MATE_SCORE + MAX_DEPTH)
return score - ply;
return score;
}
inline int ScoreFromTT(int score, int ply) {
if (score >= MATE_SCORE - MAX_DEPTH)
return score - ply;
if (score <= -MATE_SCORE + MAX_DEPTH)
return score + ply;
return score;
}
inline int lmrTable[2][MAX_DEPTH+1][MAX_MOVES];
#ifdef TUNING