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
def was_into_check(self) -> bool:
king = self.king(not self.turn)
return king is not None and self.is_attacked_by(self.turn, king)
Here it only picks one king.... but if the position loaded has multiple kings, it only return the bool of one king which depends on FEN parsing order, that means - a flipped position can bring different king of the corresponding side to move.
While it isn't too much - this is kind of UB for pseudo-legal FENs, and it affects Board.is_valid, Board.status and possibly its variants.
returns False, but should be True (because the king at A8 is in check)
I would be happy to submit a PR to fix this (by iterating over the kings bitboard), but I wanted to ask first: is this "single king" assumption kept intentionally for performance reasons?
Please assign this to me if you would like me to implement the fix.
Activity
EiSiMo commentedon Feb 3, 2026
This reproduces the bug:
returns False, but should be True (because the king at A8 is in check)
I would be happy to submit a PR to fix this (by iterating over the kings bitboard), but I wanted to ask first: is this "single king" assumption kept intentionally for performance reasons?
Please assign this to me if you would like me to implement the fix.