Update NNUE architecture to SFNNv14 and net nn-7bf13f9655c8.nnue

[STC](https://tests.stockfishchess.org/tests/live_elo/69cb991bc025c305b7daa219)

LLR: 2.97 (-2.94,2.94) <0.00,2.00>
Total: 47520 W: 12558 L: 12219 D: 22743
Ptnml(0-2): 190, 5474, 12102, 5795, 199

[LTC](https://tests.stockfishchess.org/tests/live_elo/69cc6b42731dfb72d2e92128)

LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 123756 W: 31996 L: 31497 D: 60263
Ptnml(0-2): 81, 13512, 34221, 13955, 109

Adds features for pawns pushing against other pawns. For indexing, we
use the existing threats feature set by adding the forward square to the
squares threatened by a pawn. This threat is only enabled when another
pawn occupies that square. We then add appropriate logic changes in
`update_piece_threats` and `features/full_threats.cpp`.

The wonderful Ciekce (of Stormphrax) and peregrine (of Reckless) also
had similar ideas with adding forward pawn movements to TI, and I
appreciate their giving me motivation to figure out `nnue-pytorch` and
test it.

closes https://github.com/official-stockfish/Stockfish/pull/6694

Bench: 2926703
This commit is contained in:
anematode
2026-04-02 20:32:43 +02:00
committed by Disservin
parent 8a1b0f8b04
commit 5eeca7392e
5 changed files with 55 additions and 7 deletions
+15
View File
@@ -155,6 +155,9 @@ constexpr Bitboard pawn_attacks_bb(Bitboard b) {
: shift<SOUTH_WEST>(b) | shift<SOUTH_EAST>(b);
}
constexpr Bitboard pawn_single_push_bb(Color c, Bitboard b) {
return c == WHITE ? shift<NORTH>(b) : shift<SOUTH>(b);
}
// Returns a bitboard representing an entire line (from board edge
// to board edge) that intersects the two given squares. If the given squares
@@ -397,6 +400,18 @@ inline constexpr auto PseudoAttacks = []() constexpr {
return attacks;
}();
inline constexpr auto PawnPushOrAttacks = []() constexpr {
std::array<std::array<Bitboard, SQUARE_NB>, COLOR_NB> attacks{};
for (Square s1 = SQ_A1; s1 <= SQ_H8; ++s1)
{
attacks[WHITE][s1] = pawn_single_push_bb(WHITE, square_bb(s1)) | PseudoAttacks[WHITE][s1];
attacks[BLACK][s1] = pawn_single_push_bb(BLACK, square_bb(s1)) | PseudoAttacks[BLACK][s1];
}
return attacks;
}();
// Returns the pseudo attacks of the given piece type
// assuming an empty board.