diff --git a/src/Lynx.Cli/appsettings.json b/src/Lynx.Cli/appsettings.json index fdf2bfe46..6add484d2 100644 --- a/src/Lynx.Cli/appsettings.json +++ b/src/Lynx.Cli/appsettings.json @@ -46,44 +46,44 @@ // Evaluation "DoubledPawnPenalty": { - "MG": -7, - "EG": -12 + "MG": -4, + "EG": -15 }, "IsolatedPawnPenalty": { - "MG": -16, + "MG": -18, "EG": -14 }, "OpenFileRookBonus": { - "MG": 61, - "EG": 23 + "MG": 60, + "EG": 31 }, "SemiOpenFileRookBonus": { "MG": 26, - "EG": 22 + "EG": 23 }, "BishopMobilityBonus": { - "MG": 9, - "EG": 11 + "MG": 11, + "EG": 9 }, "QueenMobilityBonus": { "MG": 3, - "EG": 9 + "EG": 10 }, "SemiOpenFileKingPenalty": { - "MG": -32, - "EG": 22 + "MG": -41, + "EG": 27 }, "OpenFileKingPenalty": { - "MG": -96, + "MG": -113, "EG": 4 }, "KingShieldBonus": { - "MG": 16, - "EG": -5 + "MG": 21, + "EG": -7 }, "BishopPairBonus": { - "MG": 29, - "EG": 85 + "MG": 31, + "EG": 91 }, "PassedPawnBonus": { "Rank0": { @@ -91,28 +91,28 @@ "EG": 0 }, "Rank1": { - "MG": 0, - "EG": 5 + "MG": -2, + "EG": 8 }, "Rank2": { - "MG": -16, - "EG": 13 + "MG": -18, + "EG": 14 }, "Rank3": { - "MG": -13, - "EG": 41 + "MG": -16, + "EG": 45 }, "Rank4": { - "MG": 25, - "EG": 78 + "MG": 18, + "EG": 86 }, "Rank5": { - "MG": 77, - "EG": 156 + "MG": 54, + "EG": 185 }, "Rank6": { - "MG": 125, - "EG": 238 + "MG": 74, + "EG": 267 }, "Rank7": { "MG": 0, diff --git a/src/Lynx/EvaluationConstants.cs b/src/Lynx/EvaluationConstants.cs index 4160c9096..885277022 100644 --- a/src/Lynx/EvaluationConstants.cs +++ b/src/Lynx/EvaluationConstants.cs @@ -26,158 +26,158 @@ public static class EvaluationConstants public static readonly int[] MiddleGamePieceValues = [ - +103, +380, +357, +502, +1126, 0, - -103, -380, -357, -502, -1126, 0 + +102, +385, +349, +503, +1105, 0, + -102, -385, -349, -503, -1105, 0 ]; public static readonly int[] EndGamePieceValues = [ - +142, +457, +402, +845, +1432, 0, - -142, -457, -402, -845, -1432, 0 + +152, +499, +454, +916, +1574, 0, + -152, -499, -454, -916, -1574, 0 ]; public static readonly int[] MiddleGamePawnTable = [ 0, 0, 0, 0, 0, 0, 0, 0, - -28, -24, -20, -12, -10, 25, 32, -15, - -24, -23, -7, 5, 13, 27, 25, 7, - -19, -11, 5, 18, 25, 33, 10, -4, - -19, -9, 2, 17, 25, 29, 9, -5, - -22, -21, -6, 1, 12, 22, 18, 4, - -28, -23, -22, -19, -10, 20, 22, -18, + -33, -23, -12, -14, 0, 25, 31, -20, + -30, -26, -3, 14, 22, 29, 25, 6, + -26, -16, 4, 22, 30, 34, 2, -2, + -24, -12, 3, 26, 32, 31, 1, -4, + -29, -18, -2, 7, 17, 21, 17, 1, + -33, -19, -18, -12, 4, 18, 19, -28, 0, 0, 0, 0, 0, 0, 0, 0, ]; public static readonly int[] EndGamePawnTable = [ 0, 0, 0, 0, 0, 0, 0, 0, - 15, 11, 9, -15, 7, 5, -3, -11, - 12, 10, -1, -13, -6, -4, -6, -13, - 27, 18, -1, -20, -15, -12, 4, -3, - 25, 19, -2, -16, -13, -9, 3, -5, - 12, 9, -3, -12, -3, -3, -4, -13, - 17, 12, 10, -11, 11, 9, -1, -9, + 15, 13, 5, -14, 6, 2, -4, -9, + 13, 14, 0, -14, -8, -7, -1, -9, + 29, 21, 2, -22, -19, -13, 10, 0, + 26, 20, -2, -17, -16, -9, 7, -2, + 14, 11, -4, -12, -3, -3, -1, -10, + 18, 13, 10, -17, 9, 7, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, ]; public static readonly int[] MiddleGameKnightTable = [ - -151, -21, -62, -42, -22, -28, -8, -94, - -48, -27, 0, 15, 13, 17, -16, -14, - -15, 4, 19, 58, 57, 39, 34, 1, - -3, 28, 45, 56, 57, 60, 51, 23, - -5, 30, 44, 48, 55, 53, 54, 21, - -22, 7, 17, 48, 56, 35, 30, -4, - -42, -24, 1, 13, 14, 11, -9, -14, - -171, -24, -60, -37, -16, -19, -11, -85, + -155, -38, -58, -43, -22, -26, -27, -99, + -50, -27, -2, 18, 20, 24, -11, -19, + -34, 3, 26, 60, 66, 46, 41, -1, + -8, 31, 47, 67, 66, 67, 49, 22, + -3, 24, 51, 52, 64, 66, 48, 18, + -31, 6, 24, 52, 63, 38, 32, 0, + -46, -12, 6, 16, 17, 17, -8, -20, + -172, -42, -56, -30, -19, -17, -36, -96, ]; public static readonly int[] EndGameKnightTable = [ - -69, -83, -10, -12, -10, -24, -72, -77, - -22, 3, 13, 10, 14, 3, -9, -18, - -22, 16, 40, 41, 38, 20, 13, -18, - -2, 22, 48, 53, 58, 51, 30, -4, - 0, 23, 48, 55, 60, 51, 36, 5, - -21, 19, 30, 43, 36, 21, 11, -10, - -28, 2, 6, 12, 6, 4, -13, -23, - -60, -81, -7, -15, -12, -28, -77, -90, + -79, -57, -14, -12, -9, -30, -48, -97, + -20, -3, 18, 9, 10, 8, -14, -20, + -8, 15, 36, 39, 38, 18, 7, -17, + 8, 21, 52, 52, 55, 48, 23, -5, + 9, 29, 49, 53, 55, 42, 29, -1, + -13, 21, 27, 47, 34, 19, 6, -13, + -33, -1, 5, 13, 6, 4, -17, -22, + -85, -56, -10, -14, -10, -24, -47, -88, ]; public static readonly int[] MiddleGameBishopTable = [ - -16, 6, -9, -32, -26, -19, -33, -7, - 6, 3, 11, -18, 1, -7, 28, -9, - -4, 10, -2, 8, -4, 16, 10, 30, - -6, 4, 2, 29, 25, -13, 9, 1, - -7, 4, -7, 24, 14, -7, 2, 10, - 3, 10, 5, -1, 6, 10, 12, 23, - 8, 11, 12, -9, -2, -3, 23, -1, - 5, 15, 0, -46, -25, -23, -6, -11, + -19, 14, -10, -26, -16, -23, -20, 7, + 7, 5, 7, -18, 3, -2, 32, -7, + -6, 7, -3, 2, -7, 14, 10, 33, + -3, -9, -8, 19, 18, -18, 4, 1, + -13, 0, -14, 18, 4, -10, -5, 9, + 5, 6, 8, -7, 4, 6, 11, 28, + 9, 18, 13, -5, -4, -1, 23, 2, + 15, 14, 5, -38, -18, -25, -6, -12, ]; public static readonly int[] EndGameBishopTable = [ - -8, 14, -24, 6, 4, -3, 10, -20, - 1, -5, -4, 4, 3, -3, -2, -14, - 15, 16, 6, 0, 12, 3, 7, 10, - 11, 6, 4, -2, -9, 8, 9, 7, - 4, 9, 6, -1, -8, 4, 7, 7, - 13, 5, 4, 2, 8, -3, 5, 10, - -9, -7, -11, 4, -1, -2, -3, -12, - -8, -10, -18, 6, 7, -1, 4, -9, + -11, 20, -22, 6, -5, 4, -4, -39, + -4, -5, -4, 6, 2, -10, -2, -16, + 15, 17, 9, 7, 15, 7, 3, 6, + 14, 11, 10, 1, -1, 10, 5, 1, + 10, 11, 8, 5, -9, 3, 5, 3, + 15, 5, 1, 3, 7, 0, 2, 6, + -16, -12, -19, 2, 1, 0, 0, -13, + -11, -14, -18, 6, 9, 6, -1, -22, ]; public static readonly int[] MiddleGameRookTable = [ - -9, -16, -13, -7, 4, -7, 2, -5, - -32, -17, -16, -15, -6, 0, 16, -7, - -33, -12, -16, -5, 4, 12, 57, 25, - -26, -17, -10, 3, 4, 18, 56, 27, - -19, -11, -7, 10, 5, 19, 51, 29, - -27, -9, -14, -1, 4, 19, 54, 33, - -26, -22, -10, -11, -4, -5, 18, -3, - -6, -11, -10, -1, 11, -1, 8, 7, + -6, -16, -15, -10, 7, -6, 3, -7, + -30, -12, -13, -13, -1, 0, 20, -4, + -31, -16, -17, -10, 8, 16, 60, 31, + -28, -18, -13, -8, 1, 7, 44, 29, + -19, -13, -7, 2, 0, 13, 33, 26, + -26, -13, -9, 1, 8, 24, 58, 36, + -29, -27, -8, -9, -1, 0, 25, -1, + -5, -8, -7, 3, 16, -1, 11, 8, ]; public static readonly int[] EndGameRookTable = [ - 3, 4, 9, 1, -9, 4, 0, -9, - 19, 20, 20, 9, -1, 0, -6, 4, - 11, 6, 9, 1, -7, -4, -20, -17, - 12, 13, 12, 5, 0, 1, -17, -17, - 10, 10, 13, 2, 1, -3, -16, -15, - 13, 11, 7, -2, -8, -8, -22, -13, - 21, 21, 14, 6, -3, 0, -3, 4, - -3, 1, 6, -3, -13, -2, -4, -17, + 6, 9, 16, 4, -6, 6, 7, -1, + 14, 21, 21, 10, -2, 3, -4, 2, + 8, 6, 9, 3, -10, -12, -25, -27, + 11, 6, 11, 7, -6, -2, -16, -24, + 10, 7, 12, 1, -4, -11, -17, -20, + 10, 13, 1, -7, -13, -16, -25, -19, + 20, 23, 16, 5, -5, 0, -6, 6, + 0, 0, 9, -1, -13, -1, -5, -13, ]; public static readonly int[] MiddleGameQueenTable = [ - -11, -21, -14, 0, -9, -49, -5, -12, - -6, -11, 7, 0, 4, 0, 23, 44, - -10, -1, -10, -6, -5, 10, 36, 57, - -6, -14, -12, -4, -1, 8, 19, 31, - -11, -9, -12, -11, 1, 4, 21, 30, - -7, -3, -12, -10, -3, 6, 25, 43, - -17, -15, 4, 5, 6, 1, 6, 38, - -14, -23, -9, -2, -11, -52, -24, 25, + -19, -22, -22, -3, -13, -38, 1, -3, + 5, -7, 8, 0, 4, 6, 22, 53, + -3, -3, -5, -5, -8, 11, 39, 59, + -6, -18, -13, -6, -8, 0, 18, 30, + -8, -11, -15, -15, -7, 1, 10, 24, + -2, -2, -11, -9, -2, 5, 25, 40, + -10, -21, 4, 11, 7, 0, 12, 41, + -14, -29, -14, 1, -9, -50, -20, 15, ]; public static readonly int[] EndGameQueenTable = [ - -19, -13, -17, -27, -11, 4, -20, 40, - -17, -10, -30, -11, -12, -21, -54, 9, - -9, -9, 5, -5, 9, 20, -2, 11, - -15, 6, 0, 11, 17, 30, 42, 39, - -4, 1, 3, 23, 12, 32, 24, 50, - -15, -11, 11, 5, 9, 20, 21, 22, - -8, -8, -26, -16, -15, -22, -41, 9, - -9, -5, -11, -13, -5, 21, 22, 11, + -24, -13, 1, -10, -5, -4, -38, 2, + -26, -18, -27, -2, 0, -17, -44, -5, + -18, -5, -1, -1, 20, 21, -13, 9, + -14, 7, -6, 11, 25, 35, 41, 31, + 0, 1, 9, 23, 20, 26, 26, 46, + -17, -11, 11, 9, 15, 24, 17, 22, + -15, -7, -21, -19, -7, -4, -37, 4, + -9, -5, -1, -11, 4, 30, 19, -8, ]; public static readonly int[] MiddleGameKingTable = [ - 13, 47, 17, -87, 5, -73, 40, 52, - -1, -12, -34, -70, -79, -56, -3, 23, - -83, -67, -98, -94, -101, -114, -76, -100, - -90, -78, -101, -122, -121, -120, -122, -165, - -65, -60, -88, -114, -121, -115, -122, -164, - -71, -40, -90, -93, -89, -100, -78, -96, - 64, -11, -30, -64, -66, -50, 8, 31, - 38, 70, 32, -80, 10, -67, 50, 63, + 53, 65, 33, -77, 7, -63, 47, 72, + 4, -4, -28, -71, -83, -55, -2, 30, + -85, -77, -123, -127, -133, -145, -94, -100, + -136, -135, -163, -205, -197, -181, -183, -215, + -86, -109, -150, -188, -195, -153, -184, -193, + -73, -36, -114, -127, -105, -117, -81, -86, + 105, 4, -25, -59, -62, -41, 16, 41, + 66, 90, 42, -63, 21, -48, 65, 87, ]; public static readonly int[] EndGameKingTable = [ - -75, -42, -21, 3, -50, -5, -37, -92, - -24, 15, 26, 38, 43, 32, 11, -28, - 7, 41, 57, 65, 69, 63, 42, 23, - 12, 49, 70, 82, 81, 77, 63, 39, - 0, 44, 68, 80, 84, 75, 65, 38, - 3, 37, 56, 65, 64, 58, 44, 21, - -40, 11, 26, 36, 39, 30, 7, -30, - -92, -57, -29, -2, -42, -8, -40, -97, + -90, -54, -25, 4, -38, -2, -41, -98, + -21, 17, 31, 47, 54, 37, 15, -21, + 5, 46, 69, 82, 84, 76, 51, 25, + 17, 63, 91, 113, 107, 96, 80, 53, + 2, 53, 87, 107, 111, 92, 83, 47, + 2, 39, 67, 81, 78, 68, 50, 21, + -50, 9, 29, 43, 44, 33, 9, -28, + -103, -64, -29, -2, -33, -7, -47, -104, ]; public static readonly int[] MiddleGamePawnTableBlack = MiddleGamePawnTable.Select((_, index) => -MiddleGamePawnTable[index ^ 56]).ToArray();