Invalid fen

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Invalid fen

Post by mcostalba »

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:
Amazing to see (for the thousandth time) how a garbage post on SF is able to spark haters....amazing how actors involved are always the same that repeat this pity comedy again and again.....but guys...are you not bored of this endless deja-vu? Time to find something new? Perhaps even something original?
User avatar
SMIRF
Posts: 91
Joined: Wed Mar 26, 2014 4:29 pm
Location: Buettelborn/Hessen/Germany

Re: Invalid fen

Post by SMIRF »

SMIRF has tried to avoid misinterpretations by visualizing castling rights using black spots near castling enabled pieces:

Image
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Invalid fen

Post by Henk »

I don't have a GUI that allows me to set up an aribitrary legal chess position. Creating such a GUI is time consuming.

[When there is a bug in my engine when computing perft I have to compare results with other engines using perft divide. That means I have to create fens for positions at lower depth. Debugging these errors is not that easy and worse if the fens are not valid ]
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Invalid fen

Post by Henk »

Henk wrote:I don't have a GUI that allows me to set up an aribitrary legal chess position. Creating such a GUI is time consuming.

[When there is a bug in my engine when computing perft I have to compare results with other engines using perft divide. That means I have to create fens for positions at lower depth. Debugging these errors is not that easy and worse if the fens are not valid ]
Wait a minute. I have Arena. Did not use it for more than a year for they told me that Arena had many bugs.
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Invalid fen

Post by hgm »

lucasart wrote: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 ?
When developing software designed to cooperate with other software, assuming the other party will always behave correctly is a rather unrealistic assumption, and a sign of low quality. High-quality software is not only doing what it is designed for, but is also robust to errors and non-ideal conditions.

There really is no reason to assume GUIs are less bug prone than engines. In particular when you advertize a funtion like 'perft', which is not supported in UCI, and for which there is no GUI support. This function can only be used from the command line, by fallible humans.

So if you don't want to do any reasonable form of error checking, it would be fair to warn the user: "the perft feature of Stockfish is only for use by the developers, and should not be used for other purposes, as it utterly sucks".
Last edited by hgm on Wed Apr 01, 2015 9:58 am, edited 1 time in total.
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Invalid fen

Post by hgm »

Henk wrote:Wait a minute. I have Arena. Did not use it for more than a year for they told me that Arena had many bugs.
I thought you also had WinBoard. It should be easy enough to set up positions there.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Invalid fen

Post by Henk »

hgm wrote:
Henk wrote:Wait a minute. I have Arena. Did not use it for more than a year for they told me that Arena had many bugs.
I thought you also had WinBoard. It should be easy enough to set up positions there.
Arena also wants me to type a fen. So there is no difference with Winboard. Actually I would like a GUI where I can select and drag pieces when creating a position. Otherwise there is not much difference with using the command line, except for a validity test.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Invalid fen

Post by Henk »

hgm wrote:
Henk wrote:Wait a minute. I have Arena. Did not use it for more than a year for they told me that Arena had many bugs.
I thought you also had WinBoard. It should be easy enough to set up positions there.
O yes I see now Winboard has an edit position.
User avatar
gbtami
Posts: 389
Joined: Wed Sep 26, 2012 1:29 pm
Location: Hungary

Re: Invalid fen

Post by gbtami »

lucasart wrote:
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 ?
I don't think he "knowingly inputs wrong FEN". He just faced with a problem and posted it here. Nothing wrong with this.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Invalid fen

Post by lucasart »

hgm wrote:
lucasart wrote: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 ?
When developing software designed to cooperate with other software, assuming the other party will always behave correctly is a rather unrealistic assumption, and a sign of low quality. High-quality software is not only doing what it is designed for, but is also robust to errors and non-ideal conditions.

There really is no reason to assume GUIs are less bug prone than engines. In particular when you advertize a funtion like 'perft', which is not supported in UCI, and for which there is no GUI support. This function can only be used from the command line, by fallible humans.

So if you don't want to do any reasonable form of error checking, it would be fair to warn the user: "the perft feature of Stockfish is only for use by the developers, and should not be used for other purposes, as it utterly sucks".
I don't know if the UCI protocol specifies this explicitly, but if it doesn't it's because it assumes the reader isn't retarded. So I will re-explain it for you:

Code: Select all

Incorrect input => Undefined behaviour
Even if SF could recognize an invalid FEN, SF would write a message, and what is the GUI supposed to do? Nothing in the UCI protocol specifies the format of such an error message, and how it's supposed to be handled by the GUI. It is the assumption of the UCI protocol that the GUI isn't bogous. And it is the intent of the UCI protocol to avoid reinventing wheels in every engine, and factorizing as much as possible in the GUI (eg. input validation, book management, option parsing rather than reading text config files in hardcoded paths like old xboard engines etc.)
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.