- Blind mode tutorial
lichess.org
Donate

Study can have illegal positions

@Matt2013 said in #10:
> I know maybe it doesnt work on a mac or with LiChess tools extension but it doesnt work. Rxd3 is hillarious though .
I'm on a Windows 11 laptop using Edge.
@dummy_devnull said in #3:
> A software QA engineer walks into a bar.
>
> He orders a beer. Orders 0 beers. Orders 99999999999 beers. Orders a lizard. Orders -1 beers. Orders a ueicbksjdhd.
>
> First real customer walks in and asks where the bathroom is. The bar bursts into flames, killing everyone.
This not good
On Lichess.org, the message “The study may contain illegal positions” means that one or more positions within the study could not be reached legally in a chess game that follows the normal rules of the game.

What can cause this?
Here are some common causes:

Manual editing of positions: If someone uses the “FEN” button or the board editor to manually place pieces, they can create a position that cannot be achieved in a legal game (e.g., two kings in check, a pawn on the first row, too many pieces of the same type, etc.).

Errors when loading FEN or PGN: A poorly generated FEN or a PGN game that has errors can cause illegal positions.

Backtracking in the study without corrections: If previous moves are deleted or the move history is changed without correctly adjusting the position, this can leave the final position in an “illegal” state.

Problems with chess logic: Such as having a pawn on row 1 or 8 without having promoted it, a king in check without it being the opponent's turn, etc.

How to fix it?
Review each chapter or position in the study.

Click on the tools icon (usually at the top or side of the editor).

Use the “Board Editor” option to check if the position is legal.

You can also copy the FEN of the position and verify it with another engine or online FEN editor.

Remove or correct illegal positions manually.
> Use the “Board Editor” option to check if the position is legal.
Illegal positions of some type can be set in the Board Editor and next "analyzed" using Analysis Board
(lichess.org/forum/lichess-feedback/first-bug-ive-found-on-lichess-it-doesnt-affect-anything?page=1).
We can also make a study using them and play such positions in "practice with computer". Even positions
with nine pawns of one colour are available for computer analysis, although the illegality of such positions
is easily detectable.
@MercantileCircle said in #16:
> On Lichess.org, the message “The study may contain illegal positions” means that one or more positions within the study could not be reached legally in a chess game that follows the normal rules of the game.
>
> What can cause this?
> Here are some common causes:
>
> Manual editing of positions: If someone uses the “FEN” button or the board editor to manually place pieces, they can create a position that cannot be achieved in a legal game (e.g., two kings in check, a pawn on the first row, too many pieces of the same type, etc.).
>
> Errors when loading FEN or PGN: A poorly generated FEN or a PGN game that has errors can cause illegal positions.
>
> Backtracking in the study without corrections: If previous moves are deleted or the move history is changed without correctly adjusting the position, this can leave the final position in an “illegal” state.
>
> Problems with chess logic: Such as having a pawn on row 1 or 8 without having promoted it, a king in check without it being the opponent's turn, etc.
>
> How to fix it?
> Review each chapter or position in the study.
>
> Click on the tools icon (usually at the top or side of the editor).
>
> Use the “Board Editor” option to check if the position is legal.
>
> You can also copy the FEN of the position and verify it with another engine or online FEN editor.
>
> Remove or correct illegal positions manually.
AI written, also it makes no sense we know its illegal we are saying it shouldn't allow it, not how to keep only legal positions

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