Page 2 of 4

Re: Invalid fen

Posted: Wed Apr 01, 2015 8:46 am
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?

Re: Invalid fen

Posted: Wed Apr 01, 2015 9:12 am
by SMIRF
SMIRF has tried to avoid misinterpretations by visualizing castling rights using black spots near castling enabled pieces:

Image

Re: Invalid fen

Posted: Wed Apr 01, 2015 9:42 am
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 ]

Re: Invalid fen

Posted: Wed Apr 01, 2015 9:52 am
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.

Re: Invalid fen

Posted: Wed Apr 01, 2015 9:53 am
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".

Re: Invalid fen

Posted: Wed Apr 01, 2015 9:56 am
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.

Re: Invalid fen

Posted: Wed Apr 01, 2015 10:05 am
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.

Re: Invalid fen

Posted: Wed Apr 01, 2015 10:12 am
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.

Re: Invalid fen

Posted: Wed Apr 01, 2015 10:32 am
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.

Re: Invalid fen

Posted: Wed Apr 01, 2015 12:34 pm
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.)