You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
remove_move and remove_mask truncate moves in the move generator:
fnmain(){let board = "8/8/5k2/8/3Pp3/8/2K5/8 b - d3 0 1".parse().unwrap();letmut moves = chess::MoveGen::new_legal(&board);let len = moves.len();
moves.remove_move("e4e3".parse().unwrap());assert_eq!(moves.len(), len - 1);//Assertion fails with 0 != 8}
fnmain(){let board = "8/8/5k2/8/3Pp3/8/2K5/8 b - d3 0 1".parse().unwrap();letmut moves = chess::MoveGen::new_legal(&board);let len = moves.len();
moves.remove_mask(chess::BitBoard::from_square(chess::Square::E3));assert_eq!(moves.len(), len - 1);//Assertion fails with 0 != 8}
This is because remove_move and remove_mask fail to uphold the invariant where no non-empty SquareAndBitBoards may come after an empty one. This invariant is mentioned here:
remove_move
andremove_mask
truncate moves in the move generator:This is because
remove_move
andremove_mask
fail to uphold the invariant where no non-emptySquareAndBitBoard
s may come after an empty one. This invariant is mentioned here:chess/src/movegen/movegen.rs
Lines 157 to 160 in ad13857
This leads to the iterator methods ending early.
The text was updated successfully, but these errors were encountered: