From: protonspring Date: Wed, 31 Oct 2018 15:05:44 +0000 (-0600) Subject: Replace the PassedDanger array by an equation X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=3cbb05b1b814ef9c79cc97de3598ba0c24735a97;ds=sidebyside Replace the PassedDanger array by an equation This equation seems to do as well as the current PassedDanger array. Master values were: 3, 7, 11, 20 The new values given by the equation are: 3, 6, 11, 18 STC: LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 84301 W: 18155 L: 18156 D: 47990 http://tests.stockfishchess.org/tests/view/5bda03180ebc595e0ae2518e LTC: LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 7940 W: 1358 L: 1217 D: 5365 http://tests.stockfishchess.org/tests/view/5bdc69880ebc595e0ae27d28 We stopped a LTC run after 70000 games: LLR: 0.74 (-2.94,2.94) [0.00,4.00] Total: 70257 W: 11319 L: 11064 D: 47874 http://tests.stockfishchess.org/tests/view/5bdca8420ebc595e0ae281a9 Bench: 3913185 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 6128b45f..0f89a05a 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -151,9 +151,6 @@ namespace { S(-30,-14), S(-9, -8), S( 0, 9), S( -1, 7) }; - // PassedDanger[Rank] contains a term to weight the passed score - constexpr int PassedDanger[RANK_NB] = { 0, 0, 0, 3, 7, 11, 20 }; - // Assorted bonuses and penalties constexpr Score BishopPawns = S( 3, 7); constexpr Score CloseEnemies = S( 6, 0); @@ -629,12 +626,12 @@ namespace { assert(!(pos.pieces(Them, PAWN) & forward_file_bb(Us, s + Up))); int r = relative_rank(Us, s); - int w = PassedDanger[r]; Score bonus = PassedRank[r]; - if (w) + if (r > RANK_3) { + int w = (r-2) * (r-2) + 2; Square blockSq = s + Up; // Adjust bonus based on the king's proximity @@ -675,7 +672,7 @@ namespace { bonus += make_score(k * w, k * w); } - } // w != 0 + } // rank > RANK_3 // Scale down bonus for candidate passers which need more than one // pawn push to become passed, or have a pawn in front of them.