From e2bac619eb334df13347528afc28cdfd5fc5659a Mon Sep 17 00:00:00 2001 From: PikaCat Date: Sat, 24 Aug 2024 05:53:04 +0800 Subject: [PATCH] Eval tune Book: winrate 65_85 TC: 180+1.8 Total/Win/Draw/Lose: 12388 / 3050 / 6484 / 2854 PTNML: 8 / 1171 / 3645 / 1357 / 13 WinRate: 50.79% ELO: 5.25[2.32, 8.18] LOS: 99.98 LLR: 3.12[-2.94, 2.94] --- src/evaluate.cpp | 12 ++++++------ src/types.h | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index f437e5db0..07bf0f47a 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -46,21 +46,21 @@ Value Eval::evaluate(const Eval::NNUE::Network& network, assert(!pos.checkers()); auto [psqt, positional] = network.evaluate(pos, &caches.cache); - Value nnue = (1020 * psqt + 1092 * positional) / 1194; + Value nnue = (1563 * psqt + 1633 * positional) / 1183; int nnueComplexity = std::abs(psqt - positional); // Blend optimism and eval with nnue complexity - optimism += optimism * nnueComplexity / 434; - nnue -= nnue * nnueComplexity / 11623; + optimism += optimism * nnueComplexity / 550; + nnue -= nnue * nnueComplexity / 10129; - int mm = pos.major_material() / 36; - int v = (nnue * (615 + mm) + optimism * (109 + mm)) / 509; + int mm = pos.major_material() / 39; + int v = (nnue * (430 + mm) + optimism * (101 + mm)) / 575; // Evaluation grain (to get more alpha-beta cuts) with randomization (for robustness) v = (v / 16) * 16 - 1 + (pos.key() & 0x2); // Damp down the evaluation linearly when shuffling - v -= (v * pos.rule60_count()) / 262; + v -= (v * pos.rule60_count()) / 244; // Guarantee evaluation does not hit the mate range v = std::clamp(v, VALUE_MATED_IN_MAX_PLY + 1, VALUE_MATE_IN_MAX_PLY - 1); diff --git a/src/types.h b/src/types.h index 237110cce..66c1e4e40 100644 --- a/src/types.h +++ b/src/types.h @@ -145,12 +145,12 @@ constexpr Value VALUE_MATE = 32000; constexpr Value VALUE_MATE_IN_MAX_PLY = VALUE_MATE - MAX_PLY; constexpr Value VALUE_MATED_IN_MAX_PLY = -VALUE_MATE_IN_MAX_PLY; -constexpr Value RookValue = 1213; -constexpr Value AdvisorValue = 216; -constexpr Value CannonValue = 746; -constexpr Value PawnValue = 140; -constexpr Value KnightValue = 964; -constexpr Value BishopValue = 191; +constexpr Value RookValue = 1357; +constexpr Value AdvisorValue = 213; +constexpr Value CannonValue = 861; +constexpr Value PawnValue = 149; +constexpr Value KnightValue = 980; +constexpr Value BishopValue = 186; // clang-format off enum PieceType {