diff --git a/src/bin/tune.rs b/src/bin/tune.rs index 5c7e887..5635ad2 100644 --- a/src/bin/tune.rs +++ b/src/bin/tune.rs @@ -345,7 +345,7 @@ fn print_weights(weights: &Weights) { let fscore = weights.rule_values[pt_idx + sq as usize]; let mg_val = (fscore.0 * 100.) as i16; let eg_val = (fscore.1 * 100.) as i16; - print!("({mg_val}, {eg_val}), "); + print!("({mg_val:>4}, {eg_val:>4}), "); } println!(); } diff --git a/src/engine/evaluate/pst.rs b/src/engine/evaluate/pst.rs index 9c88c1d..0a2b3e6 100644 --- a/src/engine/evaluate/pst.rs +++ b/src/engine/evaluate/pst.rs @@ -123,64 +123,64 @@ pub fn delta(game: &Game, m: Move) -> Score { /// squares, and the innermost index as 0 for midgame and 1 for endgame. pub const PST: Pst = unsafe { transmute([ [ // N - (-8i16, -10i16), (0, -14), (-35, -8), (-11, 1), (0, 0), (-21, -5), (0, -6), (-55, -27), - (-55, -46), (-42, -26), (-16, -8), (3, 2), (4, 5), (-10, -32), (-27, -28), (-9, -50), - (-15, -9), (-13, -9), (0, 0), (5, 8), (8, 0), (10, -1), (5, -10), (-12, -23), - (-13, -3), (-17, -6), (2, 4), (2, 7), (7, 5), (0, 7), (18, -1), (0, -12), - (-2, 2), (5, 6), (9, 13), (26, 10), (13, 9), (32, 11), (3, 3), (8, 0), - (-35, -5), (15, 0), (3, 15), (24, 1), (36, 0), (32, 0), (33, -14), (0, -26), - (-28, -7), (-16, 6), (24, -13), (-6, 4), (0, -10), (7, -18), (-2, -12), (-20, -28), - (-96, -25), (-50, -32), (-38, 5), (-27, -4), (6, -6), (-70, -15), (-35, -37), (-90, -36), + (-8i16,-10i16), ( 0, -14), ( -35, -8), ( -11, 1), ( 0, 0), ( -21, -5), ( 0, -6), ( -55, -27), + ( -55, -46), ( -42, -26), ( -16, -8), ( 3, 2), ( 4, 5), ( -10, -32), ( -27, -28), ( -9, -50), + ( -15, -9), ( -13, -9), ( 0, 0), ( 5, 8), ( 8, 0), ( 10, -1), ( 5, -10), ( -12, -23), + ( -13, -3), ( -17, -6), ( 2, 4), ( 2, 7), ( 7, 5), ( 0, 7), ( 18, -1), ( 0, -12), + ( -2, 2), ( 5, 6), ( 9, 13), ( 26, 10), ( 13, 9), ( 32, 11), ( 3, 3), ( 8, 0), + ( -35, -5), ( 15, 0), ( 3, 15), ( 24, 1), ( 36, 0), ( 32, 0), ( 33, -14), ( 0, -26), + ( -28, -7), ( -16, 6), ( 24, -13), ( -6, 4), ( 0, -10), ( 7, -18), ( -2, -12), ( -20, -28), + ( -96, -25), ( -50, -32), ( -38, 5), ( -27, -4), ( 6, -6), ( -70, -15), ( -35, -37), ( -90, -36), ], [ // B - (-1, -1), (0, -12), (0, -1), (-11, 0), (-8, -4), (-10, -2), (-27, -4), (-33, 0), - (-50, -22), (0, -11), (-8, -5), (-4, 2), (2, 3), (0, -12), (16, -18), (-34, -15), - (-13, -9), (0, -8), (6, 0), (3, 5), (1, 3), (7, 1), (0, -7), (-13, -17), - (-11, -5), (-9, -10), (1, 1), (8, 2), (5, -7), (-3, 0), (-2, -15), (5, -9), - (-17, 5), (0, 3), (-4, 6), (12, 5), (15, 0), (11, 3), (-4, 0), (-5, 0), - (-21, 0), (0, -3), (7, 0), (6, -5), (9, -6), (17, 0), (10, -6), (-13, 1), - (-14, -5), (-12, 3), (-20, 9), (-34, -17), (-17, 0), (18, -9), (2, -10), (-44, -15), - (-26, -14), (-21, -14), (-50, -17), (-34, 2), (-28, -4), (-61, -4), (-28, -11), (-10, -30), + ( -1, -1), ( 0, -12), ( 0, -1), ( -11, 0), ( -8, -4), ( -10, -2), ( -27, -4), ( -33, 0), + ( -50, -22), ( 0, -11), ( -8, -5), ( -4, 2), ( 2, 3), ( 0, -12), ( 16, -18), ( -34, -15), + ( -13, -9), ( 0, -8), ( 6, 0), ( 3, 5), ( 1, 3), ( 7, 1), ( 0, -7), ( -13, -17), + ( -11, -5), ( -9, -10), ( 1, 1), ( 8, 2), ( 5, -7), ( -3, 0), ( -2, -15), ( 5, -9), + ( -17, 5), ( 0, 3), ( -4, 6), ( 12, 5), ( 15, 0), ( 11, 3), ( -4, 0), ( -5, 0), + ( -21, 0), ( 0, -3), ( 7, 0), ( 6, -5), ( 9, -6), ( 17, 0), ( 10, -6), ( -13, 1), + ( -14, -5), ( -12, 3), ( -20, 9), ( -34, -17), ( -17, 0), ( 18, -9), ( 2, -10), ( -44, -15), + ( -26, -14), ( -21, -14), ( -50, -17), ( -34, 2), ( -28, -4), ( -61, -4), ( -28, -11), ( -10, -30), ], [ // R - (0, 0), (0, -4), (0, 0), (1, -1), (2, -4), (6, -8), (-16, -3), (-16, -6), - (-20, -24), (-11, -15), (-6, -7), (0, 0), (1, -6), (0, -18), (2, -27), (-29, -23), - (-22, -12), (-22, -8), (-12, -6), (-5, -6), (-4, -11), (-3, -12), (-1, -19), (-24, -26), - (-18, -12), (-21, -1), (-6, -2), (0, -6), (0, -9), (-12, -10), (0, -13), (-7, -21), - (-10, -8), (-21, -11), (0, 0), (-5, -7), (-7, -10), (6, -13), (-12, -17), (-9, -18), - (-7, -3), (0, 0), (0, -3), (3, 0), (0, -2), (24, -14), (17, -11), (2, -13), - (3, 2), (6, 6), (25, 8), (27, 3), (20, -5), (39, 0), (25, -4), (1, -6), - (-2, 7), (16, 0), (10, 3), (23, 0), (26, 0), (0, 0), (0, -11), (-1, 0), + ( 0, 0), ( 0, -4), ( 0, 0), ( 1, -1), ( 2, -4), ( 6, -8), ( -16, -3), ( -16, -6), + ( -20, -24), ( -11, -15), ( -6, -7), ( 0, 0), ( 1, -6), ( 0, -18), ( 2, -27), ( -29, -23), + ( -22, -12), ( -22, -8), ( -12, -6), ( -5, -6), ( -4, -11), ( -3, -12), ( -1, -19), ( -24, -26), + ( -18, -12), ( -21, -1), ( -6, -2), ( 0, -6), ( 0, -9), ( -12, -10), ( 0, -13), ( -7, -21), + ( -10, -8), ( -21, -11), ( 0, 0), ( -5, -7), ( -7, -10), ( 6, -13), ( -12, -17), ( -9, -18), + ( -7, -3), ( 0, 0), ( 0, -3), ( 3, 0), ( 0, -2), ( 24, -14), ( 17, -11), ( 2, -13), + ( 3, 2), ( 6, 6), ( 25, 8), ( 27, 3), ( 20, -5), ( 39, 0), ( 25, -4), ( 1, -6), + ( -2, 7), ( 16, 0), ( 10, 3), ( 23, 0), ( 26, 0), ( 0, 0), ( 0, -11), ( -1, 0), ], [ // Q - (-8, -9), (-18, 0), (-8, -1), (3, -6), (-10, 0), (-22, 0), (-8, -2), (-32, -1), - (-38, -5), (-38, 1), (-4, 7), (-2, 0), (6, 0), (-1, -4), (-13, -1), (3, -24), - (-24, -6), (-5, 0), (-8, 1), (0, 5), (-3, 9), (8, -1), (0, -1), (11, -10), - (-18, 0), (-22, 7), (-6, 2), (-3, 11), (0, 19), (0, 8), (0, 0), (0, -3), - (-25, -3), (-21, 0), (-13, 9), (0, 10), (13, 3), (17, 0), (5, 0), (0, -6), - (-26, -7), (-21, -2), (-4, -1), (8, 9), (35, -4), (38, -6), (46, -12), (28, -26), - (-43, -4), (-35, 4), (2, 2), (15, 6), (7, 0), (32, -7), (29, -13), (14, -23), - (-28, -14), (0, 2), (10, 1), (0, 5), (36, 0), (8, -6), (17, -9), (23, -22), + ( -8, -9), ( -18, 0), ( -8, -1), ( 3, -6), ( -10, 0), ( -22, 0), ( -8, -2), ( -32, -1), + ( -38, -5), ( -38, 1), ( -4, 7), ( -2, 0), ( 6, 0), ( -1, -4), ( -13, -1), ( 3, -24), + ( -24, -6), ( -5, 0), ( -8, 1), ( 0, 5), ( -3, 9), ( 8, -1), ( 0, -1), ( 11, -10), + ( -18, 0), ( -22, 7), ( -6, 2), ( -3, 11), ( 0, 19), ( 0, 8), ( 0, 0), ( 0, -3), + ( -25, -3), ( -21, 0), ( -13, 9), ( 0, 10), ( 13, 3), ( 17, 0), ( 5, 0), ( 0, -6), + ( -26, -7), ( -21, -2), ( -4, -1), ( 8, 9), ( 35, -4), ( 38, -6), ( 46, -12), ( 28, -26), + ( -43, -4), ( -35, 4), ( 2, 2), ( 15, 6), ( 7, 0), ( 32, -7), ( 29, -13), ( 14, -23), + ( -28, -14), ( 0, 2), ( 10, 1), ( 0, 5), ( 36, 0), ( 8, -6), ( 17, -9), ( 23, -22), ], [ // P - (1, 2), (0, 0), (0, 0), (0, 0), (0, 0), (0, 0), (0, 0), (0, 0), - (-7, 0), (4, 2), (-15, 0), (-11, 2), (0, 8), (13, 0), (20, 2), (-10, -3), - (-7, -8), (-4, 1), (-4, -5), (-5, 0), (0, -1), (0, -6), (6, -1), (-3, -13), - (-8, 3), (-2, 9), (0, 0), (9, -5), (9, -4), (-1, -4), (-3, 1), (-13, -9), - (-2, 22), (10, 19), (1, 9), (15, 4), (9, 0), (6, 3), (7, 10), (-9, 7), - (12, 63), (31, 69), (28, 52), (37, 49), (48, 26), (43, 32), (34, 50), (10, 48), - (15, 116), (24, 110), (44, 100), (77, 104), (97, 101), (57, 52), (34, 66), (-1, 107), - (0, 0), (0, 0), (0, 0), (0, 0), (0, 0), (0, 0), (0, 0), (0, 0), + ( 1, 2), ( 0, 0), ( 0, 0), ( 0, 0), ( 0, 0), ( 0, 0), ( 0, 0), ( 0, 0), + ( -7, 0), ( 4, 2), ( -15, 0), ( -11, 2), ( 0, 8), ( 13, 0), ( 20, 2), ( -10, -3), + ( -7, -8), ( -4, 1), ( -4, -5), ( -5, 0), ( 0, -1), ( 0, -6), ( 6, -1), ( -3, -13), + ( -8, 3), ( -2, 9), ( 0, 0), ( 9, -5), ( 9, -4), ( -1, -4), ( -3, 1), ( -13, -9), + ( -2, 22), ( 10, 19), ( 1, 9), ( 15, 4), ( 9, 0), ( 6, 3), ( 7, 10), ( -9, 7), + ( 12, 63), ( 31, 69), ( 28, 52), ( 37, 49), ( 48, 26), ( 43, 32), ( 34, 50), ( 10, 48), + ( 15, 116), ( 24, 110), ( 44, 100), ( 77, 104), ( 97, 101), ( 57, 52), ( 34, 66), ( -1, 107), + ( 0, 0), ( 0, 0), ( 0, 0), ( 0, 0), ( 0, 0), ( 0, 0), ( 0, 0), ( 0, 0), ], [ // K - (0, -1), (8, -25), (3, -13), (-22, -16), (-10, -13), (-22, -3), (19, -16), (-28, -10), - (-7, -17), (13, -25), (9, -18), (-14, -12), (0, -7), (0, -9), (24, -18), (-4, -6), - (-10, -14), (18, -21), (9, -7), (0, -3), (-6, 0), (-1, 0), (1, -4), (-16, -2), - (-30, -12), (7, -17), (8, 0), (-3, 2), (-7, 3), (-1, 2), (-18, -6), (-41, -1), - (-23, 0), (21, 2), (18, 3), (0, 6), (0, 5), (15, 6), (12, 5), (-7, 4), - (3, 4), (28, 0), (36, 4), (8, 0), (12, 0), (40, 16), (32, 11), (3, 21), - (0, -8), (22, 5), (14, 0), (14, 0), (17, 0), (24, 9), (25, 3), (21, 4), - (-30, -33), (-1, -32), (-5, -17), (-26, -4), (-20, 1), (-16, 12), (28, 6), (0, -9), + ( 0, -1), ( 8, -25), ( 3, -13), ( -22, -16), ( -10, -13), ( -22, -3), ( 19, -16), ( -28, -10), + ( -7, -17), ( 13, -25), ( 9, -18), ( -14, -12), ( 0, -7), ( 0, -9), ( 24, -18), ( -4, -6), + ( -10, -14), ( 18, -21), ( 9, -7), ( 0, -3), ( -6, 0), ( -1, 0), ( 1, -4), ( -16, -2), + ( -30, -12), ( 7, -17), ( 8, 0), ( -3, 2), ( -7, 3), ( -1, 2), ( -18, -6), ( -41, -1), + ( -23, 0), ( 21, 2), ( 18, 3), ( 0, 6), ( 0, 5), ( 15, 6), ( 12, 5), ( -7, 4), + ( 3, 4), ( 28, 0), ( 36, 4), ( 8, 0), ( 12, 0), ( 40, 16), ( 32, 11), ( 3, 21), + ( 0, -8), ( 22, 5), ( 14, 0), ( 14, 0), ( 17, 0), ( 24, 9), ( 25, 3), ( 21, 4), + ( -30, -33), ( -1, -32), ( -5, -17), ( -26, -4), ( -20, 1), ( -16, 12), ( 28, 6), ( 0, -9), ], ]) };