Invalid fen

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Henk
Posts: 5799
Joined: Mon May 27, 2013 8:31 am

Invalid fen

Post by Henk » Tue Mar 31, 2015 8:59 am

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

mar
Posts: 1992
Joined: Fri Nov 26, 2010 1:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Invalid fen

Post by mar » Tue Mar 31, 2015 9:39 am

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.

Henk
Posts: 5799
Joined: Mon May 27, 2013 8:31 am

Re: Invalid fen

Post by Henk » Tue Mar 31, 2015 9:44 am

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.

mar
Posts: 1992
Joined: Fri Nov 26, 2010 1:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Invalid fen

Post by mar » Tue Mar 31, 2015 9:58 am

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.

Henk
Posts: 5799
Joined: Mon May 27, 2013 8:31 am

Re: Invalid fen

Post by Henk » Tue Mar 31, 2015 10:06 am

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.

Henk
Posts: 5799
Joined: Mon May 27, 2013 8:31 am

Re: Invalid fen

Post by Henk » Tue Mar 31, 2015 11:10 am

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.

User avatar
lucasart
Posts: 3037
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: Invalid fen

Post by lucasart » Tue Mar 31, 2015 1:18 pm

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?
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.

Henk
Posts: 5799
Joined: Mon May 27, 2013 8:31 am

Re: Invalid fen

Post by Henk » Tue Mar 31, 2015 2:07 pm

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.

User avatar
hgm
Posts: 23630
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Invalid fen

Post by hgm » Tue Mar 31, 2015 5:11 pm

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:

User avatar
lucasart
Posts: 3037
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: Invalid fen

Post by lucasart » Tue Mar 31, 2015 11:23 pm

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 ?
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.

Post Reply