Page 1 of 4

Invalid fen

Posted: Tue Mar 31, 2015 10:59 am
by Henk
Stockfish accepts this fen which says that black has short castling rights. That makes no sense.

[d] rrrrkr1R/rr1rr3/8/8/8/8/8/6K1 b k - 0 1

Re: Invalid fen

Posted: Tue Mar 31, 2015 11:39 am
by mar
Henk wrote:Stockfish accepts this fen which says that black has short castling rights. That makes no sense.

[d] rrrrkr1R/rr1rr3/8/8/8/8/8/6K1 b k - 0 1
My engine accepts that FEN as well.
It assumes it's a valid X-FEN from Chess960.

Re: Invalid fen

Posted: Tue Mar 31, 2015 11:44 am
by Henk
mar wrote:
Henk wrote:Stockfish accepts this fen which says that black has short castling rights. That makes no sense.

[d] rrrrkr1R/rr1rr3/8/8/8/8/8/6K1 b k - 0 1
My engine accepts that FEN as well.
It assumes it's a valid X-FEN from Chess960.
Engines. It's all crap.

Re: Invalid fen

Posted: Tue Mar 31, 2015 11:58 am
by mar
Henk wrote:Engines. It's all crap.
Blame the GUIs :) Arena's FRC supports is certainly crap and I had to add a hack to support FRC under Arena.
My engine simply ignores UCI_Chess960 flag because it can be determined directly from the (X-/S-/FEN).
You may/may not like this approach. I like it because it makes the code simpler.

Re: Invalid fen

Posted: Tue Mar 31, 2015 12:06 pm
by Henk
mar wrote:
Henk wrote:Engines. It's all crap.
Blame the GUIs :) Arena's FRC supports is certainly crap and I had to add a hack to support FRC under Arena.
My engine simply ignores UCI_Chess960 flag because it can be determined directly from the (X-/S-/FEN).
You may/may not like this approach. I like it because it makes the code simpler.
At least user should see a warning if it types an invalid fen. But maybe engines assume there are no Spartan users anymore that create fens. O yes it really assumes Spartan users.

Re: Invalid fen

Posted: Tue Mar 31, 2015 1:10 pm
by Henk
Actually problem was that Skipper computed perft(3) = 17838 instead of 17835. Because if short castling rights are set wrongly in the fen, Skipper doesn't correct them and a move like f8-h8 does not update them. For why should it be updated. So it thinks that after f8-h8 it can castle short.

Re: Invalid fen

Posted: Tue Mar 31, 2015 3:18 pm
by lucasart
Henk wrote:Stockfish accepts this fen which says that black has short castling rights. That makes no sense.

[d] rrrrkr1R/rr1rr3/8/8/8/8/8/6K1 b k - 0 1
what's the point of this trolling post? to ask a question to which you know the answer?

Re: Invalid fen

Posted: Tue Mar 31, 2015 4:07 pm
by Henk
lucasart wrote:
Henk wrote:Stockfish accepts this fen which says that black has short castling rights. That makes no sense.

[d] rrrrkr1R/rr1rr3/8/8/8/8/8/6K1 b k - 0 1
what's the point of this trolling post? to ask a question to which you know the answer?
Yes to troll only. Stockfish and more engines allow import of invalid fens. As I said they should at least give a warning. In the fen given above the user probably meant q instead of k. For castling on the queen side makes sense.
Removing seven black rooks in this position would make it a more realistic example. [b8, c8, d8] and the rooks on the seventh row.

Re: Invalid fen

Posted: Tue Mar 31, 2015 7:11 pm
by hgm
Well, being user friendly does not bring any Elo, I guess. We should not forget that the purpose of the Stockfish project is to inflict maximal hurt on its users. That needs high Elo to make sure there will be any users, and then mess up anything else as long as it doesn't cost any Elo. :lol:

Re: Invalid fen

Posted: Wed Apr 01, 2015 1:23 am
by lucasart
hgm wrote:Well, being user friendly does not bring any Elo, I guess. We should not forget that the purpose of the Stockfish project is to inflict maximal hurt on its users. That needs high Elo to make sure there will be any users, and then mess up anything else as long as it doesn't cost any Elo. :lol:
UCI is made for engine <-> GUI communication, so the engine can assume correct input, and any invalid input is a GUI bug. "Inflicting pain" to some smart ass user who knowingly inputs wrong FEN to fuel his trolling posts on talkchess… maybe that's a good thing ?