Skip to content

Commit

Permalink
allways fill history for en passant (LeelaChessZero#1837)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3a88534)
  • Loading branch information
borg323 authored and uwuplant committed Feb 2, 2023
1 parent 27ef14e commit eee9ec2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/neural/encoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,12 @@ InputPlanes EncodePositionForNN(
!board.en_passant().empty()) {
break;
}
if (history_idx < 0 && fill_empty_history == FillEmptyHistory::NO) break;
// If en-passant is possible we know the previous move.
if (fill_empty_history == FillEmptyHistory::NO &&
(history_idx < -1 ||
(history_idx == -1 && board.en_passant().empty()))) {
break;
}
// Board may be flipped so compare with position.GetBoard().
if (history_idx < 0 && fill_empty_history == FillEmptyHistory::FEN_ONLY &&
position.GetBoard() == ChessBoard::kStartposBoard) {
Expand Down

0 comments on commit eee9ec2

Please sign in to comment.