From 5654974717144f40e76b31cc941c6d3360554c0c Mon Sep 17 00:00:00 2001 From: TheRealGioviok <425gioviok@gmail.com> Date: Thu, 18 Dec 2025 22:35:37 +0100 Subject: [PATCH 1/3] Bench: 12447864 --- src/eval_constants.hpp | 185 +++++++++++++++++++++-------------------- src/evaluation.cpp | 6 +- 2 files changed, 96 insertions(+), 95 deletions(-) diff --git a/src/eval_constants.hpp b/src/eval_constants.hpp index 81728fa2..4575bfbd 100644 --- a/src/eval_constants.hpp +++ b/src/eval_constants.hpp @@ -5,155 +5,156 @@ namespace Clockwork { // clang-format off -inline const PParam PAWN_MAT = S(291,312); -inline const PParam KNIGHT_MAT = S(1137,913); -inline const PParam BISHOP_MAT = S(1226,947); -inline const PParam ROOK_MAT = S(1712,1682); -inline const PParam QUEEN_MAT = S(3665,2886); -inline const PParam TEMPO_VAL = S(59,15); +inline const PParam PAWN_MAT = S(180, 164); +inline const PParam KNIGHT_MAT = S(741, 541); +inline const PParam BISHOP_MAT = S(780, 532); +inline const PParam ROOK_MAT = S(751, 703); +inline const PParam QUEEN_MAT = S(1632, 1199); +inline const PParam TEMPO_VAL = S(58, 15); -inline const PParam BISHOP_PAIR_VAL = S(80,178); -inline const PParam ROOK_OPEN_VAL = S(104,-29); -inline const PParam ROOK_SEMIOPEN_VAL = S(39,13); +inline const PParam BISHOP_PAIR_VAL = S(77, 175); +inline const PParam ROOK_OPEN_VAL = S(101, -25); +inline const PParam ROOK_SEMIOPEN_VAL = S(38, 14); -inline const PParam DOUBLED_PAWN_VAL = S(-37,-78); +inline const PParam DOUBLED_PAWN_VAL = S(-35, -77); -inline const PParam POTENTIAL_CHECKER_VAL = S(-75,-3); -inline const PParam OUTPOST_KNIGHT_VAL = S(7,51); -inline const PParam OUTPOST_BISHOP_VAL = S(29,27); +inline const PParam POTENTIAL_CHECKER_VAL = S(-77, -1); +inline const PParam OUTPOST_KNIGHT_VAL = S(53, 31); +inline const PParam OUTPOST_BISHOP_VAL = S(63, 21); -inline const PParam PAWN_PUSH_THREAT_KNIGHT = S(54,18); -inline const PParam PAWN_PUSH_THREAT_BISHOP = S(56,-14); -inline const PParam PAWN_PUSH_THREAT_ROOK = S(33,33); -inline const PParam PAWN_PUSH_THREAT_QUEEN = S(55,-53); +inline const PParam PAWN_PUSH_THREAT_KNIGHT = S(45, 9); +inline const PParam PAWN_PUSH_THREAT_BISHOP = S(50, -19); +inline const PParam PAWN_PUSH_THREAT_ROOK = S(33, 32); +inline const PParam PAWN_PUSH_THREAT_QUEEN = S(51, -46); inline const std::array PAWN_PHALANX = { - S(20,20), S(63,31), S(74,70), S(190,140), S(561,241), S(925,1154), + S(19, 19), S(61, 31), S(72, 69), S(184, 138), S(520, 249), S(638, 693), }; inline const std::array DEFENDED_PAWN = { - S(64,43), S(61,31), S(67,57), S(147,120), S(688,-90), + S(61, 42), S(58, 30), S(66, 56), S(144, 117), S(605, -50), }; inline const std::array PASSED_PAWN = { - S(-71,-104), S(-61,-85), S(-35,-9), S(20,70), S(42,211), S(307,314), + S(-69, -94), S(-59, -76), S(-33, -3), S(22, 75), S(50, 207), S(281, 300), }; inline const std::array DEFENDED_PASSED_PUSH = { - S(50,-44), S(36,-6), S(21,27), S(23,76), S(92,152), S(144,296), + S(51, -43), S(37, -5), S(20, 29), S(20, 78), S(84, 157), S(163, 283), }; inline const std::array BLOCKED_PASSED_PAWN = { - S(15,-46), S(4,3), S(1,-27), S(7,-47), S(5,-96), S(-192,-145), + S(15, -45), S(1, 3), S(-0, -25), S(5, -45), S(1, -90), S(-190, -140), }; inline const std::array FRIENDLY_KING_PASSED_PAWN_DISTANCE = { - CS(0,0), S(13,101), S(-22,89), S(-14,38), S(-1,8), S(9,13), S(39,10), S(18,-1), + S(0, 0), S(12, 98), S(-21, 86), S(-14, 36), S(-0, 7), S(9, 12), S(40, 9), S(19, -4), }; inline const std::array ENEMY_KING_PASSED_PAWN_DISTANCE = { - CS(0,0), S(-185,-49), S(32,-3), S(-11,46), S(12,76), S(17,101), S(37,100), S(-12,120), + S(0, 0), S(-184, -54), S(27, -7), S(-13, 40), S(10, 70), S(15, 94), S(35, 94), S(-13, 114), }; inline const std::array KNIGHT_MOBILITY = { - S(-227,-224), S(-120,-61), S(-63,-8), S(-19,25), S(28,40), S(54,78), S(91,75), S(125,77), S(171,20), + S(3, -15), S(106, 146), S(160, 199), S(202, 234), S(247, 250), S(273, 288), S(309, 284), S(342, 287), S(389, 228), }; inline const std::array BISHOP_MOBILITY = { - S(-236,-283), S(-162,-99), S(-87,-37), S(-51,13), S(-20,44), S(-2,65), S(17,80), S(37,86), S(56,90), S(70,86), S(96,74), S(161,28), S(191,6), S(251,-28), + S(34, -61), S(105, 120), S(178, 181), S(213, 231), S(243, 262), S(260, 284), S(279, 298), S(297, 304), S(317, 308), S(331, 304), S(355, 292), S(421, 245), S(447, 224), S(513, 187), }; inline const std::array ROOK_MOBILITY = { - S(-306,-230), S(-152,-82), S(-100,-18), S(-68,-8), S(-41,15), S(-26,37), S(-8,49), S(11,55), S(28,67), S(46,76), S(64,78), S(77,80), S(98,83), S(109,69), S(255,-58), + S(164, 217), S(292, 413), S(343, 478), S(375, 487), S(401, 511), S(415, 533), S(432, 545), S(451, 551), S(467, 563), S(485, 572), S(503, 574), S(515, 576), S(536, 578), S(548, 564), S(691, 439), }; inline const std::array QUEEN_MOBILITY = { - S(-966,-877), S(-255,-659), S(-159,-521), S(-104,-314), S(-95,-106), S(-57,-1), S(-53,109), S(-28,123), S(-23,177), S(-11,203), S(-2,228), S(4,243), S(22,235), S(33,247), S(40,241), S(53,237), S(60,228), S(59,235), S(85,191), S(107,154), S(122,135), S(165,70), S(178,61), S(338,-112), S(372,-155), S(616,-312), S(485,-255), S(857,-453), + S(-1, 2), S(722, 361), S(819, 488), S(878, 652), S(890, 834), S(929, 929), S(934, 1031), S(960, 1040), S(966, 1091), S(979, 1112), S(988, 1133), S(995, 1144), S(1015, 1132), S(1028, 1138), S(1036, 1128), S(1052, 1118), S(1062, 1102), S(1067, 1099), S(1099, 1044), S(1129, 995), S(1158, 958), S(1226, 862), S(1227, 862), S(1319, 735), S(1281, 738), S(1250, 729), S(1013, 798), S(907, 782), }; inline const std::array KING_MOBILITY = { - S(448,-4), S(99,-121), S(-5,-32), S(-20,6), S(-48,10), S(-82,15), S(-61,17), S(-70,11), S(-71,-38), + S(333, 145), S(139, -115), S(39, -29), S(24, 8), S(-2, 11), S(-35, 17), S(-15, 18), S(-24, 12), S(-24, -36), }; inline const std::array KNIGHT_KING_RING = { - CS(0,0), S(88,-32), S(158,-79), + S(0, 0), S(88, -30), S(158, -76), }; inline const std::array BISHOP_KING_RING = { - CS(0,0), S(36,-7), S(136,-45), + S(0, 0), S(33, -5), S(132, -42), }; inline const std::array ROOK_KING_RING = { - CS(0,0), S(68,-50), S(53,-65), S(104,-64), S(162,-130), + S(0, 0), S(65, -46), S(47, -59), S(96, -56), S(143, -116), }; inline const std::array QUEEN_KING_RING = { - CS(0,0), S(-39,27), S(-56,38), S(-1,-9), S(162,-98), S(357,-238), + S(0, 0), S(-53, 64), S(-85, 99), S(-50, 78), S(81, 23), S(211, -62), }; -inline const PParam PAWN_THREAT_KNIGHT = S(240,58); -inline const PParam PAWN_THREAT_BISHOP = S(208,102); -inline const PParam PAWN_THREAT_ROOK = S(199,56); -inline const PParam PAWN_THREAT_QUEEN = S(179,-64); +inline const PParam PAWN_THREAT_KNIGHT = S(228, 62); +inline const PParam PAWN_THREAT_BISHOP = S(203, 102); +inline const PParam PAWN_THREAT_ROOK = S(194, 57); +inline const PParam PAWN_THREAT_QUEEN = S(175, -65); -inline const PParam KNIGHT_THREAT_BISHOP = S(106,73); -inline const PParam KNIGHT_THREAT_ROOK = S(244,5); -inline const PParam KNIGHT_THREAT_QUEEN = S(156,-68); +inline const PParam KNIGHT_THREAT_BISHOP = S(103, 72); +inline const PParam KNIGHT_THREAT_ROOK = S(240, 4); +inline const PParam KNIGHT_THREAT_QUEEN = S(158, -79); -inline const PParam BISHOP_THREAT_KNIGHT = S(111,35); -inline const PParam BISHOP_THREAT_ROOK = S(244,55); -inline const PParam BISHOP_THREAT_QUEEN = S(192,49); +inline const PParam BISHOP_THREAT_KNIGHT = S(110, 32); +inline const PParam BISHOP_THREAT_ROOK = S(238, 55); +inline const PParam BISHOP_THREAT_QUEEN = S(194, 33); inline const std::array BISHOP_PAWNS = { - S(-1,-11), S(-3,-5), S(-3,-15), S(-8,-26), S(-14,-31), S(-19,-38), S(-21,-45), S(-27,-40), S(-37,-44), + S(-0, -10), S(-3, -5), S(-3, -15), S(-8, -26), S(-14, -31), S(-19, -39), S(-20, -45), S(-27, -40), S(-36, -43), }; inline const std::array PAWN_PSQT = { - S(110,161), S(101,208), S(170,174), S(233,55), S(178,50), S(164,115), S(58,138), S(117,114), // - S(81,46), S(194,73), S(170,16), S(172,-42), S(125,-58), S(69,-10), S(30,37), S(-21,41), // - S(-0,13), S(20,17), S(37,-27), S(24,-41), S(6,-45), S(-36,-39), S(-77,8), S(-103,30), // - S(-26,-35), S(-8,-7), S(-12,-40), S(-30,-37), S(-56,-46), S(-76,-38), S(-128,12), S(-147,-0), // - S(-29,-65), S(35,-62), S(-14,-18), S(-45,-16), S(-66,-25), S(-105,-27), S(-125,-13), S(-149,-19), // - S(-19,-58), S(112,-54), S(67,-18), S(9,0), S(-28,-12), S(-64,-17), S(-91,6), S(-128,-6), // + S(232, 316), S(229, 360), S(289, 331), S(352, 214), S(300, 208), S(284, 273), S(180, 294), S(239, 271), // + S(178, 192), S(288, 220), S(267, 164), S(266, 109), S(221, 93), S(168, 139), S(128, 185), S(79, 188), // + S(101, 156), S(120, 160), S(137, 116), S(126, 102), S(109, 98), S(66, 105), S(26, 151), S(-1, 173), // + S(76, 109), S(92, 137), S(89, 104), S(71, 107), S(46, 99), S(26, 107), S(-25, 156), S(-42, 144), // + S(74, 79), S(134, 82), S(86, 126), S(55, 128), S(36, 119), S(-3, 118), S(-22, 131), S(-44, 125), // + S(83, 86), S(208, 91), S(163, 126), S(107, 143), S(71, 130), S(36, 125), S(10, 150), S(-25, 138), // }; inline const std::array KNIGHT_PSQT = { - S(-403,-162), S(-355,58), S(-465,233), S(-127,64), S(-258,90), S(-342,96), S(-576,83), S(-547,-20), // - S(-1,-6), S(65,6), S(166,-61), S(112,5), S(114,12), S(51,-14), S(-9,7), S(-28,-39), // - S(55,-32), S(98,13), S(189,4), S(141,27), S(140,17), S(59,25), S(48,-0), S(-48,7), // - S(110,2), S(100,24), S(130,29), S(108,57), S(117,44), S(84,37), S(59,-5), S(34,2), // - S(99,-18), S(125,-21), S(119,5), S(91,22), S(82,30), S(79,25), S(52,-3), S(38,-58), // - S(11,-27), S(42,-39), S(37,-18), S(48,25), S(54,22), S(-3,0), S(2,-39), S(-38,-45), // - S(13,-12), S(34,-40), S(18,-34), S(18,-15), S(5,-21), S(-23,-42), S(-12,-56), S(-69,-124), // - S(-36,-63), S(2,-20), S(20,-43), S(29,-36), S(21,-28), S(-27,-59), S(-39,-35), S(-88,-87), // + S(-256, -8), S(-198, 194), S(-277, 344), S(4, 211), S(-116, 231), S(-193, 235), S(-403, 212), S(-392, 124), // + S(124, 145), S(190, 155), S(288, 89), S(236, 151), S(238, 158), S(178, 135), S(120, 155), S(99, 114), // + S(174, 120), S(209, 163), S(291, 161), S(243, 183), S(240, 175), S(165, 182), S(153, 156), S(74, 159), // + S(224, 154), S(212, 178), S(238, 185), S(220, 210), S(224, 200), S(191, 193), S(169, 150), S(148, 156), // + S(217, 137), S(244, 135), S(240, 161), S(211, 176), S(201, 186), S(199, 181), S(174, 152), S(156, 97), // + S(137, 120), S(167, 107), S(162, 127), S(172, 171), S(179, 168), S(123, 146), S(128, 108), S(90, 103), // + S(140, 137), S(161, 108), S(145, 113), S(145, 131), S(132, 125), S(106, 105), S(116, 93), S(60, 28), // + S(91, 91), S(130, 130), S(148, 105), S(156, 112), S(148, 120), S(103, 90), S(89, 115), S(40, 68), // }; inline const std::array BISHOP_PSQT = { - S(-162,84), S(-183,64), S(-426,92), S(-305,105), S(-256,108), S(-425,134), S(-166,111), S(-118,87), // - S(10,-28), S(-8,47), S(12,29), S(-9,34), S(-34,49), S(4,40), S(-19,30), S(-53,33), // - S(40,29), S(86,19), S(163,26), S(93,26), S(68,29), S(43,41), S(101,13), S(-0,30), // - S(57,-16), S(70,16), S(105,18), S(103,43), S(110,43), S(48,41), S(37,18), S(-11,25), // - S(58,-44), S(65,-6), S(72,10), S(72,34), S(64,50), S(24,41), S(8,4), S(4,-38), // - S(70,-35), S(110,-21), S(115,-7), S(55,33), S(37,39), S(39,34), S(67,-10), S(35,-32), // - S(57,-70), S(107,-46), S(77,-34), S(49,-4), S(40,-19), S(41,-30), S(23,-15), S(43,-79), // - S(53,-51), S(39,-5), S(44,2), S(55,-32), S(63,-43), S(60,-1), S(52,-29), S(34,-32), // + S(-20, 262), S(-44, 244), S(-273, 267), S(-156, 281), S(-108, 284), S(-269, 308), S(-26, 288), S(24, 263), // + S(146, 153), S(128, 228), S(149, 209), S(128, 214), S(104, 228), S(140, 220), S(118, 210), S(84, 213), // + S(173, 209), S(212, 199), S(284, 209), S(215, 209), S(189, 213), S(166, 224), S(224, 195), S(134, 211), // + S(188, 165), S(199, 197), S(231, 200), S(230, 225), S(234, 226), S(174, 223), S(165, 200), S(121, 206), // + S(189, 138), S(203, 175), S(212, 192), S(208, 216), S(200, 233), S(161, 224), S(145, 187), S(136, 144), // + S(203, 146), S(240, 159), S(246, 173), S(187, 213), S(170, 219), S(171, 214), S(198, 171), S(168, 151), // + S(191, 113), S(239, 135), S(209, 147), S(182, 176), S(173, 161), S(174, 152), S(156, 167), S(175, 104), // + S(185, 133), S(173, 177), S(177, 183), S(188, 149), S(197, 139), S(193, 181), S(185, 154), S(167, 152), // }; inline const std::array ROOK_PSQT = { - S(106,12), S(171,10), S(100,41), S(100,35), S(108,24), S(56,37), S(64,40), S(72,45), // - S(14,70), S(101,45), S(176,22), S(101,66), S(117,53), S(64,63), S(4,81), S(-5,87), // - S(3,47), S(151,6), S(181,-0), S(182,-4), S(136,6), S(61,47), S(79,34), S(-41,85), // - S(-28,41), S(48,34), S(80,25), S(102,-11), S(70,13), S(9,61), S(-9,60), S(-80,68), // - S(-93,-8), S(-11,-3), S(-26,14), S(-43,15), S(-48,12), S(-66,52), S(-96,48), S(-115,38), // - S(-116,-29), S(-41,-55), S(-47,-25), S(-66,-24), S(-50,-43), S(-99,12), S(-102,-6), S(-124,-9), // - S(-178,-18), S(-78,-78), S(-54,-63), S(-49,-61), S(-56,-56), S(-75,-40), S(-96,-62), S(-127,-46), // - S(-143,-17), S(-112,-11), S(-59,-47), S(-34,-64), S(-47,-49), S(-60,-37), S(-76,-46), S(-93,-29), // + S(551, 468), S(616, 467), S(546, 496), S(548, 490), S(558, 478), S(505, 492), S(514, 494), S(522, 499), // + S(469, 521), S(553, 498), S(626, 476), S(555, 517), S(569, 505), S(518, 514), S(460, 532), S(451, 538), // + S(456, 500), S(602, 460), S(632, 454), S(632, 450), S(588, 459), S(515, 499), S(531, 488), S(415, 536), // + S(426, 493), S(501, 487), S(533, 478), S(555, 441), S(524, 465), S(464, 513), S(445, 513), S(375, 520), // + S(364, 445), S(444, 450), S(429, 466), S(412, 467), S(407, 464), S(389, 504), S(361, 501), S(342, 490), // + S(341, 424), S(414, 398), S(409, 427), S(388, 428), S(405, 410), S(356, 464), S(355, 446), S(333, 443), // + S(281, 435), S(377, 376), S(401, 390), S(405, 393), S(399, 397), S(380, 414), S(361, 391), S(330, 408), // + S(314, 438), S(344, 442), S(396, 408), S(420, 391), S(407, 405), S(395, 417), S(380, 409), S(363, 426), // }; inline const std::array QUEEN_PSQT = { - S(38,43), S(77,8), S(81,14), S(-38,143), S(33,62), S(-23,89), S(42,4), S(-22,29), // - S(24,81), S(-49,176), S(-53,231), S(-141,263), S(-113,209), S(-123,207), S(-74,113), S(-39,53), // - S(-18,113), S(72,109), S(12,186), S(-5,197), S(-46,179), S(-78,178), S(-7,72), S(-42,45), // - S(50,26), S(54,95), S(18,130), S(6,195), S(-16,180), S(-25,114), S(13,20), S(-1,-12), // - S(15,53), S(50,15), S(24,85), S(-16,142), S(-29,129), S(-22,86), S(-11,8), S(-9,-42), // - S(25,-105), S(50,-62), S(51,7), S(-3,34), S(9,-9), S(12,-4), S(23,-74), S(-1,-68), // - S(10,-212), S(44,-311), S(31,-175), S(48,-103), S(22,-83), S(39,-154), S(13,-92), S(-5,-90), // - S(-46,-132), S(15,-382), S(12,-369), S(39,-275), S(41,-193), S(45,-238), S(32,-198), S(-22,-122), // + S(835, 784), S(890, 739), S(891, 756), S(789, 871), S(832, 824), S(780, 844), S(821, 784), S(752, 812), // + S(777, 892), S(712, 978), S(725, 1006), S(649, 1028), S(658, 1001), S(635, 1017), S(672, 941), S(710, 875), // + S(739, 919), S(824, 922), S(771, 990), S(753, 1002), S(709, 993), S(668, 1010), S(736, 908), S(703, 877), // + S(795, 850), S(796, 923), S(761, 958), S(746, 1032), S(721, 1024), S(712, 958), S(746, 875), S(738, 832), // + S(754, 889), S(786, 856), S(758, 930), S(712, 1002), S(699, 994), S(708, 948), S(722, 863), S(724, 815), // + S(759, 744), S(782, 788), S(781, 862), S(725, 897), S(736, 858), S(738, 866), S(752, 789), S(732, 788), // + S(742, 648), S(772, 555), S(759, 688), S(774, 767), S(748, 787), S(766, 717), S(740, 777), S(727, 769), // + S(688, 731), S(746, 489), S(742, 496), S(765, 598), S(769, 682), S(772, 637), S(760, 672), S(709, 743), // }; inline const std::array KING_PSQT = { - S(-136,-382), S(93,-23), S(-65,29), S(-173,53), S(20,-11), S(20,-11), S(20,-11), S(20,-11), // - S(190,-116), S(5,142), S(22,127), S(127,58), S(20,-11), S(20,-11), S(20,-11), S(20,-11), // - S(-37,55), S(66,134), S(106,102), S(91,57), S(20,-11), S(20,-11), S(20,-11), S(20,-11), // - S(-257,79), S(31,94), S(24,91), S(-30,76), S(20,-11), S(20,-11), S(20,-11), S(20,-11), // - S(-230,36), S(-47,67), S(-30,72), S(-113,108), S(20,-11), S(20,-11), S(20,-11), S(20,-11), // - S(-136,6), S(56,9), S(-34,60), S(-78,86), S(20,-11), S(20,-11), S(20,-11), S(20,-11), // - S(80,-85), S(134,-45), S(45,2), S(-37,46), S(20,-11), S(20,-11), S(20,-11), S(20,-11), // - S(-44,-114), S(87,-104), S(-14,-68), S(-31,-67), S(20,-11), S(20,-11), S(20,-11), S(20,-11), // -}; -// Epoch duration: 61.8411s + S(-233, -320), S(30, 5), S(-98, 45), S(-169, 61), S(0, 0), S(0, 0), S(0, 0), S(0, 0), // + S(124, -85), S(-17, 153), S(1, 139), S(117, 68), S(0, 0), S(0, 0), S(0, 0), S(0, 0), // + S(-66, 71), S(48, 145), S(86, 114), S(73, 69), S(0, 0), S(0, 0), S(0, 0), S(0, 0), // + S(-277, 92), S(10, 106), S(2, 104), S(-50, 89), S(0, 0), S(0, 0), S(0, 0), S(0, 0), // + S(-247, 48), S(-68, 80), S(-48, 85), S(-128, 119), S(0, 0), S(0, 0), S(0, 0), S(0, 0), // + S(-153, 17), S(34, 23), S(-54, 74), S(-95, 98), S(0, 0), S(0, 0), S(0, 0), S(0, 0), // + S(58, -71), S(109, -29), S(23, 17), S(-56, 59), S(0, 0), S(0, 0), S(0, 0), S(0, 0), // + S(-61, -101), S(65, -88), S(-33, -54), S(-50, -53), S(0, 0), S(0, 0), S(0, 0), S(0, 0), // +}; + +// Epoch duration: 6.87929s // clang-format on } // namespace Clockwork diff --git a/src/evaluation.cpp b/src/evaluation.cpp index 835bbff0..a04b7ff3 100644 --- a/src/evaluation.cpp +++ b/src/evaluation.cpp @@ -225,7 +225,7 @@ PScore evaluate_outposts(const Position& pos) { Bitboard opp_pawns = pos.bitboard_for(opp, PieceType::Pawn); Bitboard opp_pawn_span = pawn_spans(opp_pawns); Bitboard opp_pawn_span_attacks = static_pawn_attacks( - opp_pawns); // Note, this does NOT consider pins! Might need to test this more thoroughly. + opp_pawn_span); // Note, this does NOT consider pins! Might need to test this more thoroughly. Bitboard pawn_defended_squares = pos.attacked_by(color, PieceType::Pawn); Bitboard viable_outposts = viable_outposts_ranks & pawn_defended_squares & ~opp_pawn_span_attacks; @@ -304,9 +304,9 @@ PScore evaluate_space(const Position& pos) { Bitboard openfiles = ~(ourfiles | theirfiles); Bitboard half_open_files = (~ourfiles) & theirfiles; - eval += ROOK_OPEN_VAL * (openfiles & pos.bitboard_for(color, PieceType::Rook)).ipopcount(); + eval += ROOK_OPEN_VAL * (openfiles & pos.bitboard_for(color, PieceType::Rook)).popcount(); eval += - ROOK_SEMIOPEN_VAL * (half_open_files & pos.bitboard_for(color, PieceType::Rook)).ipopcount(); + ROOK_SEMIOPEN_VAL * (half_open_files & pos.bitboard_for(color, PieceType::Rook)).popcount(); return eval; } From 45c7957ce9764b633192ea3810b5627f21e791ec Mon Sep 17 00:00:00 2001 From: TheRealGioviok <425gioviok@gmail.com> Date: Mon, 22 Dec 2025 05:12:55 +0100 Subject: [PATCH 2/3] Bench: 12447864 --- src/evaluation.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/evaluation.cpp b/src/evaluation.cpp index a04b7ff3..1fed8ec7 100644 --- a/src/evaluation.cpp +++ b/src/evaluation.cpp @@ -98,7 +98,7 @@ PScore evaluate_pawns(const Position& pos) { Square their_king = pos.king_sq(them); PScore eval = PSCORE_ZERO; - eval += DOUBLED_PAWN_VAL * static_cast((pawns & pawns.shift(Direction::North)).popcount()); + eval += DOUBLED_PAWN_VAL * (pawns & pawns.shift(Direction::North)).ipopcount(); for (Square sq : pawns) { Square push = sq.push(); @@ -233,10 +233,10 @@ PScore evaluate_outposts(const Position& pos) { PScore eval = PSCORE_ZERO; eval += OUTPOST_KNIGHT_VAL - * static_cast((pos.bitboard_for(color, PieceType::Knight) & viable_outposts).popcount()); + * (pos.bitboard_for(color, PieceType::Knight) & viable_outposts).ipopcount(); eval += OUTPOST_BISHOP_VAL - * static_cast((pos.bitboard_for(color, PieceType::Bishop) & viable_outposts).popcount()); + * (pos.bitboard_for(color, PieceType::Bishop) & viable_outposts).ipopcount(); return eval; } @@ -304,9 +304,9 @@ PScore evaluate_space(const Position& pos) { Bitboard openfiles = ~(ourfiles | theirfiles); Bitboard half_open_files = (~ourfiles) & theirfiles; - eval += ROOK_OPEN_VAL * (openfiles & pos.bitboard_for(color, PieceType::Rook)).popcount(); + eval += ROOK_OPEN_VAL * (openfiles & pos.bitboard_for(color, PieceType::Rook)).ipopcount(); eval += - ROOK_SEMIOPEN_VAL * (half_open_files & pos.bitboard_for(color, PieceType::Rook)).popcount(); + ROOK_SEMIOPEN_VAL * (half_open_files & pos.bitboard_for(color, PieceType::Rook)).ipopcount(); return eval; } From dca73f30149979851b5247128b80a74761e5f23f Mon Sep 17 00:00:00 2001 From: TheRealGioviok <425gioviok@gmail.com> Date: Mon, 22 Dec 2025 05:17:30 +0100 Subject: [PATCH 3/3] Format Bench: 12447864 --- src/evaluation.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/evaluation.cpp b/src/evaluation.cpp index 1fed8ec7..508dbaf9 100644 --- a/src/evaluation.cpp +++ b/src/evaluation.cpp @@ -231,12 +231,10 @@ PScore evaluate_outposts(const Position& pos) { viable_outposts_ranks & pawn_defended_squares & ~opp_pawn_span_attacks; // Check for minor pieces on outposts PScore eval = PSCORE_ZERO; - eval += - OUTPOST_KNIGHT_VAL - * (pos.bitboard_for(color, PieceType::Knight) & viable_outposts).ipopcount(); - eval += - OUTPOST_BISHOP_VAL - * (pos.bitboard_for(color, PieceType::Bishop) & viable_outposts).ipopcount(); + eval += OUTPOST_KNIGHT_VAL + * (pos.bitboard_for(color, PieceType::Knight) & viable_outposts).ipopcount(); + eval += OUTPOST_BISHOP_VAL + * (pos.bitboard_for(color, PieceType::Bishop) & viable_outposts).ipopcount(); return eval; }