From 14466419aead0d33fc8b3574021f40a83ce3a5d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20C=C3=A1ceres?= Date: Mon, 27 Nov 2023 15:19:25 +0100 Subject: [PATCH] Revert to 66-33 --- src/Lynx.Cli/appsettings.json | 52 ++++----- src/Lynx/EvaluationConstants.cs | 192 ++++++++++++++++---------------- 2 files changed, 122 insertions(+), 122 deletions(-) diff --git a/src/Lynx.Cli/appsettings.json b/src/Lynx.Cli/appsettings.json index ac64e3ec0..fdf2bfe46 100644 --- a/src/Lynx.Cli/appsettings.json +++ b/src/Lynx.Cli/appsettings.json @@ -46,44 +46,44 @@ // Evaluation "DoubledPawnPenalty": { - "MG": -5, - "EG": -14 + "MG": -7, + "EG": -12 }, "IsolatedPawnPenalty": { - "MG": -17, + "MG": -16, "EG": -14 }, "OpenFileRookBonus": { - "MG": 60, - "EG": 28 + "MG": 61, + "EG": 23 }, "SemiOpenFileRookBonus": { - "MG": 25, - "EG": 23 + "MG": 26, + "EG": 22 }, "BishopMobilityBonus": { - "MG": 10, - "EG": 10 + "MG": 9, + "EG": 11 }, "QueenMobilityBonus": { "MG": 3, "EG": 9 }, "SemiOpenFileKingPenalty": { - "MG": -38, - "EG": 25 + "MG": -32, + "EG": 22 }, "OpenFileKingPenalty": { - "MG": -107, + "MG": -96, "EG": 4 }, "KingShieldBonus": { - "MG": 19, - "EG": -6 + "MG": 16, + "EG": -5 }, "BishopPairBonus": { - "MG": 30, - "EG": 88 + "MG": 29, + "EG": 85 }, "PassedPawnBonus": { "Rank0": { @@ -91,28 +91,28 @@ "EG": 0 }, "Rank1": { - "MG": -2, - "EG": 7 + "MG": 0, + "EG": 5 }, "Rank2": { "MG": -16, "EG": 13 }, "Rank3": { - "MG": -16, - "EG": 44 + "MG": -13, + "EG": 41 }, "Rank4": { - "MG": 20, - "EG": 83 + "MG": 25, + "EG": 78 }, "Rank5": { - "MG": 61, - "EG": 175 + "MG": 77, + "EG": 156 }, "Rank6": { - "MG": 92, - "EG": 257 + "MG": 125, + "EG": 238 }, "Rank7": { "MG": 0, diff --git a/src/Lynx/EvaluationConstants.cs b/src/Lynx/EvaluationConstants.cs index 1bce6c76e..4160c9096 100644 --- a/src/Lynx/EvaluationConstants.cs +++ b/src/Lynx/EvaluationConstants.cs @@ -26,158 +26,158 @@ public static class EvaluationConstants public static readonly int[] MiddleGamePieceValues = [ - +102, +382, +352, +500, +1102, 0, - -102, -382, -352, -500, -1102, 0 + +103, +380, +357, +502, +1126, 0, + -103, -380, -357, -502, -1126, 0 ]; public static readonly int[] EndGamePieceValues = [ - +149, +484, +435, +892, +1531, 0, - -149, -484, -435, -892, -1531, 0 + +142, +457, +402, +845, +1432, 0, + -142, -457, -402, -845, -1432, 0 ]; public static readonly int[] MiddleGamePawnTable = [ 0, 0, 0, 0, 0, 0, 0, 0, - -31, -22, -15, -11, -4, 25, 31, -18, - -29, -24, -5, 11, 19, 27, 26, 7, - -23, -14, 5, 20, 29, 34, 5, -3, - -23, -10, 3, 21, 30, 30, 4, -4, - -26, -18, -3, 4, 15, 22, 18, 1, - -31, -20, -20, -15, -7, 19, 20, -25, + -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, 0, 0, 0, 0, 0, 0, 0, 0, ]; public static readonly int[] EndGamePawnTable = [ 0, 0, 0, 0, 0, 0, 0, 0, - 15, 12, 7, -15, 6, 3, -4, -11, - 12, 12, 0, -14, -7, -6, -3, -11, - 28, 20, 0, -22, -18, -13, 8, -1, - 24, 19, -2, -17, -16, -10, 5, -4, - 13, 10, -4, -13, -3, -3, -2, -11, - 17, 12, 9, -15, 17, 7, -1, -7, + 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, 0, 0, 0, 0, 0, 0, 0, 0, ]; public static readonly int[] MiddleGameKnightTable = [ - -155, -30, -62, -43, -21, -26, -16, -97, - -46, -25, -2, 16, 18, 23, -13, -17, - -27, 4, 22, 60, 62, 43, 38, -1, - -8, 28, 45, 62, 63, 63, 50, 22, - -4, 27, 48, 50, 60, 61, 51, 21, - -25, 6, 21, 51, 61, 36, 31, -2, - -48, -16, 1, 15, 17, 17, -10, -18, - -170, -33, -59, -33, -19, -17, -24, -91, + -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, ]; public static readonly int[] EndGameKnightTable = [ - -73, -70, -11, -12, -9, -27, -63, -93, - -21, -1, 15, 9, 12, 10, -12, -20, - -13, 17, 40, 39, 38, 20, 11, -14, - 8, 21, 52, 53, 57, 51, 26, -5, - 5, 28, 51, 55, 59, 47, 32, 0, - -17, 20, 29, 46, 36, 22, 7, -10, - -27, 2, 5, 13, 6, 2, -14, -24, - -79, -70, -7, -14, -10, -25, -60, -93, + -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, ]; public static readonly int[] MiddleGameBishopTable = [ - -13, 12, -10, -26, -20, -21, -27, 3, - 8, 5, 8, -18, 1, -2, 30, -11, - -5, 8, -3, 4, -6, 14, 8, 32, - -4, -4, -4, 25, 21, -16, 5, 2, - -13, 1, -12, 19, 7, -10, -3, 8, - 6, 8, 8, -5, 6, 7, 10, 27, - 9, 16, 13, -7, -4, 1, 22, -2, - 12, 15, 3, -42, -23, -27, -5, -12, + -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, ]; public static readonly int[] EndGameBishopTable = [ - -14, 19, -24, 5, -2, 2, 2, -31, - -4, -7, -3, 6, 5, -9, -1, -15, - 15, 16, 9, 4, 14, 5, 8, 10, - 13, 9, 8, -1, -5, 8, 5, 5, - 8, 10, 8, 5, -9, 6, 4, 5, - 13, 4, 1, 2, 7, 1, 4, 7, - -14, -10, -16, 3, 2, -1, 0, -10, - -8, -11, -17, 8, 9, 6, 0, -21, + -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, ]; public static readonly int[] MiddleGameRookTable = [ - -8, -16, -13, -9, 6, -6, 2, -6, - -30, -13, -14, -15, -3, 0, 19, -6, - -31, -15, -18, -7, 8, 11, 60, 31, - -24, -18, -12, -3, 3, 13, 50, 26, - -18, -12, -5, 4, -1, 14, 40, 23, - -24, -11, -12, 1, 6, 23, 56, 33, - -28, -24, -8, -8, -2, -2, 25, 0, - -5, -8, -8, 2, 15, -1, 11, 7, + -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, ]; public static readonly int[] EndGameRookTable = [ - 6, 8, 13, 4, -6, 6, 6, -4, - 16, 20, 20, 9, -1, 2, -4, 4, - 9, 7, 10, 3, -9, -9, -23, -21, - 12, 10, 11, 5, -4, -1, -17, -20, - 12, 8, 12, 2, -1, -7, -14, -15, - 12, 13, 2, -6, -11, -13, -21, -15, - 21, 23, 16, 5, -3, 1, -5, 5, - 0, 1, 8, -1, -13, -1, -4, -14, + 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, ]; public static readonly int[] MiddleGameQueenTable = [ - -16, -20, -20, -2, -11, -41, 5, 0, - 0, -8, 9, -1, 3, 3, 23, 49, - -5, -1, -5, -5, -8, 10, 39, 62, - -9, -14, -13, -3, -4, 2, 17, 29, - -9, -9, -13, -14, -4, 1, 15, 26, - -2, 0, -12, -9, -3, 7, 24, 42, - -15, -18, 5, 9, 7, 0, 7, 36, - -12, -22, -10, 0, -9, -49, -20, 27, + -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, ]; public static readonly int[] EndGameQueenTable = [ - -24, -15, -1, -13, -8, -3, -36, 12, - -19, -14, -28, -1, -1, -14, -47, 0, - -17, -7, 0, -5, 18, 21, -10, 4, - -11, 4, 0, 5, 22, 35, 45, 35, - -1, -1, 9, 21, 19, 28, 23, 48, - -19, -15, 11, 9, 14, 21, 21, 19, - -12, -8, -25, -17, -11, -7, -32, 10, - -11, -8, -8, -6, 2, 29, 21, -6, + -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, ]; public static readonly int[] MiddleGameKingTable = [ - 44, 57, 27, -83, 6, -66, 45, 65, - 1, -8, -29, -70, -83, -58, -3, 28, - -81, -68, -113, -117, -129, -135, -86, -99, - -119, -121, -139, -181, -171, -160, -159, -190, - -82, -86, -129, -160, -174, -144, -162, -181, - -76, -40, -106, -116, -100, -114, -77, -90, - 89, 2, -30, -60, -64, -45, 12, 37, - 59, 85, 40, -67, 17, -55, 60, 79, + 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, ]; public static readonly int[] EndGameKingTable = [ - -87, -50, -24, 4, -43, -2, -40, -96, - -22, 16, 29, 43, 51, 36, 14, -24, - 6, 43, 64, 76, 80, 71, 47, 25, - 16, 60, 84, 102, 98, 89, 75, 47, - 3, 49, 82, 98, 103, 88, 78, 45, - 5, 39, 63, 77, 73, 66, 47, 20, - -47, 9, 30, 40, 43, 32, 9, -28, - -100, -62, -30, -3, -35, -6, -44, -101, + -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, ]; public static readonly int[] MiddleGamePawnTableBlack = MiddleGamePawnTable.Select((_, index) => -MiddleGamePawnTable[index ^ 56]).ToArray();