From 7a03450bd9a0e2b3d596bb0654add4402041957a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ste=CC=81phane=20Nicolet?= Date: Mon, 26 Feb 2018 00:55:01 +0100 Subject: [PATCH] Count passed pawns in asymmetry measure The previous asymmetry measure of the pawn structure only used to consider the number of pawns on semi-opened files in the position. With this patch we also increase the measure by the number of passed pawns for both players. Many thanks to the community for the nice feedback on the previous version, with special mentions to Alain Savard and Marco Costalba for clarity and speed suggestions. STC: LLR: 2.96 (-2.94,2.94) [0.00,5.00] Total: 13146 W: 3038 L: 2840 D: 7268 http://tests.stockfishchess.org/tests/view/5a91dd0c0ebc590297cc877e LTC: LLR: 2.96 (-2.94,2.94) [0.00,5.00] Total: 27776 W: 4771 L: 4536 D: 18469 http://tests.stockfishchess.org/tests/view/5a91fdd50ebc590297cc879b How to continue after this patch? Stockfish will now evaluate more positions with passed pawns, so tuning the passed pawns values may bring Elo. The patch has also consequences on the initiative term, where we might want to give different weights to passed pawns and semi-openfiles (idea by Stefano Cardanobile). Bench: 5302866 --- src/pawns.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pawns.cpp b/src/pawns.cpp index a1b53325..7e90089c 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -222,8 +222,9 @@ Entry* probe(const Position& pos) { e->key = key; e->scores[WHITE] = evaluate(pos, e); e->scores[BLACK] = evaluate(pos, e); - e->asymmetry = popcount(e->semiopenFiles[WHITE] ^ e->semiopenFiles[BLACK]); e->openFiles = popcount(e->semiopenFiles[WHITE] & e->semiopenFiles[BLACK]); + e->asymmetry = popcount( (e->passedPawns[WHITE] | e->passedPawns[BLACK]) + | (e->semiopenFiles[WHITE] ^ e->semiopenFiles[BLACK])); return e; } -- 2.39.2