diff --git a/AUTHORS b/AUTHORS index bacc096c..2d75f7cf 100644 --- a/AUTHORS +++ b/AUTHORS @@ -59,7 +59,7 @@ Jerry Donald Watson (jerrydonaldwatson) Jonathan Calovski (Mysseno) Joost VandeVondele (vondele) Jörg Oster (joergoster) -Joseph Hellis (jhellis3) +Joseph Ellis (jhellis3) Joseph R. Prostko jundery Justin Blanchard diff --git a/src/search.cpp b/src/search.cpp index 8a50c3b1..f7c13bbf 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -346,11 +346,13 @@ void Thread::search() { alpha = std::max(rootMoves[PVIdx].previousScore - delta,-VALUE_INFINITE); beta = std::min(rootMoves[PVIdx].previousScore + delta, VALUE_INFINITE); - // Adjust contempt based on current bestValue - ct = Options["Contempt"] * PawnValueEg / 100 // From centipawns - + (bestValue > 500 ? 50: // Dynamic contempt - bestValue < -500 ? -50: - bestValue / 10); + ct = Options["Contempt"] * PawnValueEg / 100; // From centipawns + + // Adjust contempt based on current bestValue (dynamic contempt) + int sign = (bestValue > 0) - (bestValue < 0); + ct += bestValue > 500 ? 70 : + bestValue < -500 ? -70 : + bestValue / 10 + sign * int(std::round(3.22 * log(1 + abs(bestValue)))); Eval::Contempt = (us == WHITE ? make_score(ct, ct / 2) : -make_score(ct, ct / 2)); diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 4d925d68..f648c017 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -59,7 +59,7 @@ void init(OptionsMap& o) { const int MaxHashMB = Is64Bit ? 131072 : 2048; o["Debug Log File"] << Option("", on_logger); - o["Contempt"] << Option(18, -100, 100); + o["Contempt"] << Option(12, -100, 100); o["Threads"] << Option(1, 1, 512, on_threads); o["Hash"] << Option(16, 1, MaxHashMB, on_hash_size); o["Clear Hash"] << Option(on_clear_hash);