lichess.org
Donate

Wrong FEN, en passant square ignored

When I play 1.e4, the correct FEN should be

rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1

but Lichess produces:

rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1

thus, not setting the en passant square. According to the spec it should be set even if there is no pawn that can capture en passant. This causes API calls to fail whenever a FEN is needed (like /cloud-eval).

When I play 1.e4, the correct FEN should be rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1 but Lichess produces: rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1 thus, not setting the en passant square. According to the spec it should be set even if there is no pawn that can capture en passant. This causes API calls to fail whenever a FEN is needed (like /cloud-eval).

To be technical, Lichess uses X-FEN { https://github.com/lichess-org/lila/issues/10578 }. So I think you just drop the ep. square (where it's not needed) when using the API

Better API support can be found in Discord.

To be technical, Lichess uses X-FEN { https://github.com/lichess-org/lila/issues/10578 }. So I think you just drop the ep. square (where it's not needed) when using the API Better API support can be found in Discord.

i cant imagine you have to specify the squares for all pawns on 2nd square ahead - only zhose can factually be captured. try with black pawn d4

i cant imagine you have to specify the squares for all pawns on 2nd square ahead - only zhose can factually be captured. try with black pawn d4

Not all of them. There can be only one (precisely: no more than one) pawn that just moved by two squares.

Not all of them. There can be only one (precisely: no more than one) pawn that just moved by two squares.

According to X-FEN: "It is fully backward compatible with FEN.".

When I paste the FEN in the lichess board setup, it works.
https://lichess.org/editor/rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR_b_KQkq_e3_0_1

However, if I use the same FEN in the /api/cloud-eval API, I get an error:
https://lichess.org/api/cloud-eval?fen=rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1

This means it's not using X-FEN, at least it's not fully backwards compatible (or Lichess should convert to FEN and then do the DB lookup).

According to X-FEN: "It is fully backward compatible with FEN.". When I paste the FEN in the lichess board setup, it works. https://lichess.org/editor/rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR_b_KQkq_e3_0_1 However, if I use the same FEN in the /api/cloud-eval API, I get an error: https://lichess.org/api/cloud-eval?fen=rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1 This means it's not using X-FEN, at least it's not fully backwards compatible (or Lichess should convert to FEN and then do the DB lookup).

Not displaying the flag when ep is impossible is a feature, not a bug.

Not displaying the flag when ep is impossible is a feature, not a bug.

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