When I remove the KQkq tags there is no problem and Stockfish immediately outputs analysis. If I had to guess I'd say crashing is not compiler dependent, but rather dependent on the GUI parsing the FEN. But I suppose this still wouldn't make sense given the working re-compiles using different compiler options.
Hart wrote:I've tried this position with a dozen engines but it fails every time with Rybka 3, RobboLito 0.085g3, Stockfish 1.5.1 (intel x64), and Stockfish 1.6 (x64 ja).
Also, I don't know if this means anything but this FEN shows up as a Chess 960 position when I input it into Arena. Maybe a problem reading the FEN? I noticed the original FEN has the KQkq tags. Does that mean castling should be allowed when it cannot?
It means all those engines are glaurung derivatives
The position is illegal, and the only sensible alternative is to reject the FEN or at least send some sort of warning. In the quest for ELO points, this does not matter, so sometimes commercial authors do not bother to fix these bugs. If I paid for any engine and does not send a minimum warning, it will surely annoy me. Come on... even my poor Gaviota can figure this out.
Hart wrote:I've tried this position with a dozen engines but it fails every time with Rybka 3, RobboLito 0.085g3, Stockfish 1.5.1 (intel x64), and Stockfish 1.6 (x64 ja).
Also, I don't know if this means anything but this FEN shows up as a Chess 960 position when I input it into Arena. Maybe a problem reading the FEN? I noticed the original FEN has the KQkq tags. Does that mean castling should be allowed when it cannot?
It means all those engines are glaurung derivatives
The position is illegal, and the only sensible alternative is to reject the FEN or at least send some sort of warning. In the quest for ELO points, this does not matter, so sometimes commercial authors do not bother to fix these bugs. If I paid for any engine and does not send a minimum warning, it will surely annoy me. Come on... even my poor Gaviota can figure this out.
Miguel
I disagree
A sensible alternative is simply to read the FEN and understand based on the FEN that the kings cannot castle
The engine should understand that KQkq at the end of the FEN string is only an hint that the king may castle in case of doubt and understand that it means that the king can castle except cases when there is an obvious reason that the king cannot castle(and not having rooks on the board is one obvious reason that the kings cannot castle).
Hart wrote:I've tried this position with a dozen engines but it fails every time with Rybka 3, RobboLito 0.085g3, Stockfish 1.5.1 (intel x64), and Stockfish 1.6 (x64 ja).
Also, I don't know if this means anything but this FEN shows up as a Chess 960 position when I input it into Arena. Maybe a problem reading the FEN? I noticed the original FEN has the KQkq tags. Does that mean castling should be allowed when it cannot?
It means all those engines are glaurung derivatives
The position is illegal, and the only sensible alternative is to reject the FEN or at least send some sort of warning. In the quest for ELO points, this does not matter, so sometimes commercial authors do not bother to fix these bugs. If I paid for any engine and does not send a minimum warning, it will surely annoy me. Come on... even my poor Gaviota can figure this out.
Miguel
I disagree
A sensible alternative is simply to read the FEN and understand based on the FEN that the kings cannot castle
The engine should understand that KQkq at the end of the FEN string is only an hint that the king may castle in case of doubt and understand that it means that the king can castle except cases when there is an obvious reason that the king cannot castle(and not having rooks on the board is one obvious reason that the kings cannot castle).
Uri
No, it is a very poor practice to do that without at least warning the user. It is a very basic principle that garbage input (the FEN is wrong by definition) should be rejected, warned, or the user, being aware of that possibility and knowing what he/she is doing, forced it with a switch. The user should always be aware of what is going on. Silently fixing the errors is a recipe for disaster. How does the program know that the problem is in the castling or the user just put the rook in the wrong square? If you are automatically analyzing FENs, you are going to get back an answer that is wrong and you won't find it out.
And by the way, crashing or getting confused as mentioned above is NEVER an option.
michiguel wrote:
It means all those engines are glaurung derivatives
I guess this was a joke, but anyway: I have seen many engines crashing on this wrong FEN with the KQkq tags which are certainly NOT Glaurung derivatives
michiguel wrote:
It means all those engines are glaurung derivatives
I guess this was a joke, but anyway: I have seen many engines crashing on this wrong FEN with the KQkq tags which are certainly NOT Glaurung derivatives
The function from_fen() that parses the fen string is in position.cpp and the description comment says it all
/// Position::from_fen() initializes the position object with the given FEN
/// string. This function is not very robust - make sure that input FENs are
/// correct (this is assumed to be the responsibility of the GUI).
void Position::from_fen(const string& fen) {
michiguel wrote:
It means all those engines are glaurung derivatives
I guess this was a joke, but anyway: I have seen many engines crashing on this wrong FEN with the KQkq tags which are certainly NOT Glaurung derivatives
The function from_fen() that parses the fen string is in position.cpp and the description comment says it all
/// Position::from_fen() initializes the position object with the given FEN
/// string. This function is not very robust - make sure that input FENs are
/// correct (this is assumed to be the responsibility of the GUI).
void Position::from_fen(const string& fen) {
Looking at the source of that from_fen() function, it is obvious for me that this comment is partially wrong. from_fen() does a lot of error checking (so it is obviously intended to be very robust), but regarding the castle rights part it only does so for the "AHah" style but not for the "KQkq" style castling rights string. A simple fix could look like this (note: I have not tested it):