lichess.org
Donate

FEN stucks Stockfish

I tried to play from a position:
r1bq2rk/5p1p/p2ppPnQ/1p2P3/7P/3B4/PPP2PP1/2KR3R w Kq - 0 1

Stockfish does not do anything and no error message were showed. I managed to fix this issue by fixing the castle settings. I set queenside castle for white and kingside for black. After that Stockfish managed to understand what to do.
I think it's a bug since it's a valid FEN and Stockfish should be able to play on.
The FEN is not valid. Both sides have already castled, yet your FEN is claiming that they both still have castling rights. The "Kq" near the end of the FEN should be replaced with "-", like this:

r1bq2rk/5p1p/p2ppPnQ/1p2P3/7P/3B4/PPP2PP1/2KR3R w - - 0 1

FEN does allow castling rights aside from the initial position of the king and rooks to accomodate for Chess960, but in 960, the rooks will always start on opposite sides of the king. In this position, both pkayers have both of their rooks on the same side of the king.

Stockfish tries to examine castling as a candidate move since the FEN indicates both sides may do so, but cannot interpret what it would mean from the position on the board.
Note: If you create a study and then 'play with computer', sometimes it can glitch out. Instead, copy the FEN(s) and paste in play with computer button in the homepage
#1 Ironically I've brought this to the SF developers' attention, and their opinion is the same as #2 that it is the responsibility of whatever calls the engine to ensure the position is valid.
A player needs to be able to recognize the castling rights of a chess position. Ideally, see the game played out to be aware if the King or Rook's have moved. A King or Rook could have moved and returned to their initial square, causing the loss of castling rights, depending on if the King moved or how many rooks moved.

If the rook needed for castling has moved, you cannot castle on that side.
If there is a piece between the rook and the king, you obviously cannot castle at that moment.
If the king is attacked or will move over a square that could put the king under attack while crossing that square the castling maneuver cannot be made at that time. (Block the attacked King or square and then castle.)

When copy pasting a FEN, just paste it in the editor and select the castling options.
If a FEN editor had these 3 options: Select 960; Standard: Variant.
Then with this theme selection ... it could then be able to recognize the castling rights of a given position and disable the options that are not possible. (It would have to be told which King or Rook has already moved.)

chess.stackexchange.com/questions/1482/how-do-you-know-when-a-fen-position-is-legal

For simplicity:
1) Place hte pieces on a chessboard and play with the options.
or
2) Copy paste the minimum of a FEN and then select the options, like first move and castling rights.
You need to know where the FEN came from like from a 960 game, a variant or Standard Chess.

This topic has been archived and can no longer be replied to.