From 69ec5dcbfcec498e378297d0383c79ba7804a8cf Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Thu, 16 Jan 2025 14:42:27 +0300 Subject: [PATCH] Remove the type of moved piece from the evasion capture movepick formula In the move generation the moves are generated in the order pawns, knight, bishops, rooks, queens and king. This follows increasing type_of(pos.moved_piece(m)) term, so in master a capturing was sorted after a capturing rook if the same piece was captured in evasion. Because we use a stable sorting method (stable means the order of elements with the same value are not changed) and generate the moves in the above order we do'nt need the removed term. Passed STC: LLR: 2.98 (-2.94,2.94) <-1.75,0.25> Total: 170560 W: 44222 L: 44148 D: 82190 Ptnml(0-2): 569, 18792, 46488, 18858, 573 https://tests.stockfishchess.org/tests/view/678530ee460e2910c51de21d closes https://github.com/official-stockfish/Stockfish/pull/5784 No functional change --- src/movepick.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/movepick.cpp b/src/movepick.cpp index 84486169..bee5ef5b 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -186,8 +186,7 @@ void MovePicker::score() { else // Type == EVASIONS { if (pos.capture_stage(m)) - m.value = - PieceValue[pos.piece_on(m.to_sq())] - type_of(pos.moved_piece(m)) + (1 << 28); + m.value = PieceValue[pos.piece_on(m.to_sq())] + (1 << 28); else m.value = (*mainHistory)[pos.side_to_move()][m.from_to()] + (*continuationHistory[0])[pos.moved_piece(m)][m.to_sq()]