What's wrong with this EPD?

Discussion of chess software programming and technical issues.

Moderators: Harvey Williamson, bob, hgm

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Jouni
Posts: 2227
Joined: Wed Mar 08, 2006 7:15 pm

What's wrong with this EPD?

Post by Jouni » Sun Mar 20, 2011 8:27 am

Chessbase says illegal, but Arena accepts:

[D]Nb1QN3/1pp1PPp1/1rnn1p1P/1Pkr2B1/P1pRpK1p/2P1P2B/2qb2Pp/4R3 w - -

Jouni

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

Re: What's wrong with this EPD?

Post by sje » Sun Mar 20, 2011 8:38 am

The full six field FEN is:
[D]Nb1QN3/1pp1PPp1/1rnn1p1P/1Pkr2B1/P1pRpK1p/2P1P2B/2qb2Pp/4R3 w - - 0 1

It is legal FEN.

User avatar
George Tsavdaris
Posts: 1627
Joined: Thu Mar 09, 2006 11:35 am

Re: What's wrong with this EPD?

Post by George Tsavdaris » Sun Mar 20, 2011 9:54 am

sje wrote:The full six field FEN is:
[D]Nb1QN3/1pp1PPp1/1rnn1p1P/1Pkr2B1/P1pRpK1p/2P1P2B/2qb2Pp/4R3 w - - 0 1

It is legal FEN.
Actually that would be illegal too.
How can you reach this position in 1 move? :D

Replacing w - - 0 1 with w - - 0 100 for example i guess would make it legal(if there is a sequence of moves that reaches this position from the initial).
After his son's birth they've asked him:
"Is it a boy or girl?"
YES! He replied.....

Dann Corbit
Posts: 11627
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: What's wrong with this EPD?

Post by Dann Corbit » Sun Mar 20, 2011 10:57 am

White has all but one of his chessmen on the board.
How did the black pawns move to those locations.

As a retrograde position, it is not possible. It's pretty clever that an interface caught it.

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

Re: What's wrong with this EPD?

Post by hgm » Sun Mar 20, 2011 12:10 pm

'Annoying' would describe it better than 'clever'! If it really refuses it for this reason, it is just needlessly restricting its usefulness to the user. Nothing worse than pedantic software...

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

Re: What's wrong with this EPD?

Post by sje » Sun Mar 20, 2011 12:53 pm

FEN describes all chess positions including those that cannot be reached from the initial array.

User avatar
Evert
Posts: 2929
Joined: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Re: What's wrong with this EPD?

Post by Evert » Sun Mar 20, 2011 4:35 pm

Dann Corbit wrote:White has all but one of his chessmen on the board.
How did the black pawns move to those locations.
Same question about the white pawns on the 7th rank, actually.

Jouni
Posts: 2227
Joined: Wed Mar 08, 2006 7:15 pm

Re: What's wrong with this EPD?

Post by Jouni » Sun Mar 20, 2011 6:05 pm

Stockfish 2 isn't doing anything in this position, a bug?

2011-03-20 20:04:12.666-->1:isready
2011-03-20 20:04:12.666<--1:readyok
2011-03-20 20:04:12.791-->1:position fen Nb1QN3/1pp1PPp1/1rnn1p1P/1Pkr2B1/P1pRpK1p/2P1P2B/2qb2Pp/4R3 w - - 0 1
2011-03-20 20:04:12.791-->1:go infinite
2011-03-20 20:04:12.807**Time for starting analysis:640
2011-03-20 20:04:14.304-->1:stop

Jouni

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

Re: What's wrong with this EPD?

Post by sje » Sun Mar 20, 2011 6:42 pm

Jouni wrote:Stockfish 2 isn't doing anything in this position, a bug?
Maybe not, depending on interpretation. Black's bishops are running on the same color squares but neither is the result of a promotion.

Then again, if a program thinks that a position is broken, then the program should note that fact in its output or at least refuse to accept the broken position.

Another subtle problem that can hang an unsuspecting program: triple check. This can't happen in any position from the initial array, but it can happen in a setup position. It's possible for a program's check evasion routine to say "if my king is attacked but if the number of attacks is not two then I assume the number is one". That would be okay for normal play, but not for a maliciously specified busted position.

Sven
Posts: 3883
Joined: Thu May 15, 2008 7:57 pm
Location: Berlin, Germany
Full name: Sven Schüle
Contact:

Re: What's wrong with this EPD?

Post by Sven » Sun Mar 20, 2011 9:59 pm

sje wrote:
Jouni wrote:Stockfish 2 isn't doing anything in this position, a bug?
Maybe not, depending on interpretation. Black's bishops are running on the same color squares but neither is the result of a promotion.

Then again, if a program thinks that a position is broken, then the program should note that fact in its output or at least refuse to accept the broken position.

Another subtle problem that can hang an unsuspecting program: triple check. This can't happen in any position from the initial array, but it can happen in a setup position. It's possible for a program's check evasion routine to say "if my king is attacked but if the number of attacks is not two then I assume the number is one". That would be okay for normal play, but not for a maliciously specified busted position.
I think it is acceptable if an engine rejects an FEN of a position that cannot be reached by any sequence of legal move from the initial position (possibly including all 960 initial positions of Chess 960 if you like). This implies that situations like "triple check", "two like bishops where none of them results from promotion", or "pawn structure would have required more captures than enemy pieces are missing" can be rejected.

I agree that the way how such a position is rejected should be like you mentioned, i.e. not crashing but either sending an appropriate output or refusing to play or analyze from that position.

An engine can make assumptions like the one you mentioned about the number of checks if it is strict enough in rejecting "illegal FENs". Here the term "illegal FEN" is not precise, of course, since it is not the FEN itself which is illegal (the PGN standard describes the format only) but the position described by the FEN is unreachable based on FIDE chess rules.

It is a separate topic whether engines should also support analysis (or even game playing) for such unreachable positions. I would not be surprised, however, if most of today's competetive engines stick to not supporting these since playing strength in standard games often has the main focus.

Sven

Post Reply