liground
liground copied to clipboard
Last move of 3check game in pgn does not get imported
- Loading a
pgnfile of3checkgames, does not import the last move of every game
- For
atomicpgns aren't loaded correctly as well. It is even more sever. - Not only the last move is missing, but arbitrarily many last moves
This seems to be related to ffish.js. I assume we need to fix it there.
I don't know about the 3check issue, but for atomic it is basically expected that PGN parsing can't work properly right now, sorry if I missed to point that out.
The reason is that atomic is implemented as an extinction variant with a non-royal king in Fairy-Stockfish, and the requirement to move the "king" out of check ("pseudoRoyal") is implemented independently from the normal check/checkmate logic. Therefore no generated SAN will have a +, and since we use the very strict parsing logic, checking moves won't be recognized. This should also apply to generated SAN/PGN by ffishjs, as well as to general detection of check situations (e.g., to highlight the king), but these might not be as critical as in the parsing.
Finding out if a pseudo-royal piece is under attack in atomic rules unfortunately is not completely trivial and therefore slow, but I already have the code for checkmate detection https://github.com/ianfab/Fairy-Stockfish/blob/57681a7d40d3cd6a297aae6a45ef8f0b961e16ee/src/position.h#L749-L761 which does exactly that. We could consider to either take this into account in the SAN generation (and even in is_check), or only restrict it to the parsing code, or maybe more generally allow to skip + in the PGN. Feel free to raise a bug and/or PR in my repo.
@gbtami FYI, as it might also be relevant for pychess.