Invalid fen

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 7:17 pm

Re: Invalid fen

Post by mcostalba » Wed Apr 01, 2015 6:46 am

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 3:29 pm
Location: Buettelborn/Hessen/Germany
Contact:

Re: Invalid fen

Post by SMIRF » Wed Apr 01, 2015 7:12 am

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

Image

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

Re: Invalid fen

Post by Henk » Wed Apr 01, 2015 7:42 am

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: 5744
Joined: Mon May 27, 2013 8:31 am

Re: Invalid fen

Post by Henk » Wed Apr 01, 2015 7:52 am

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: 23511
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Invalid fen

Post by hgm » Wed Apr 01, 2015 7:53 am

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 7:58 am, edited 1 time in total.

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

Re: Invalid fen

Post by hgm » Wed Apr 01, 2015 7:56 am

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: 5744
Joined: Mon May 27, 2013 8:31 am

Re: Invalid fen

Post by Henk » Wed Apr 01, 2015 8:05 am

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: 5744
Joined: Mon May 27, 2013 8:31 am

Re: Invalid fen

Post by Henk » Wed Apr 01, 2015 8:12 am

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: 363
Joined: Wed Sep 26, 2012 11:29 am
Location: Hungary
Contact:

Re: Invalid fen

Post by gbtami » Wed Apr 01, 2015 8:32 am

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: 3036
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: Invalid fen

Post by lucasart » Wed Apr 01, 2015 10:34 am

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.

Post Reply