well, now there's no excuses. Verification code, C, all stand-alone to be found here, free to use.
https://github.com/ChrisWhittington/Che ... /README.md
Should work, fixes bad EPDs or returns a NULL if not.
Excuses for Wishy Washy FEN/EPD/PGN implementation
Moderators: hgm, Rebel, chrisw
-
- Posts: 4319
- Joined: Tue Apr 03, 2012 4:28 pm
-
- Posts: 395
- Joined: Fri Aug 12, 2016 8:43 pm
Re: Excuses for Wishy Washy FEN/EPD/PGN implementation
Have you take into account that the castling flags can also generate different FENs that refer to the same position?
r1b1k1nr/pp1n1ppp/2pb4/3p4/3PpPPq/2N1P2P/PPP3B1/R1BQK1NR w KQkq -
r1b1k1nr/pp1n1ppp/2pb4/3p4/3PpPPq/2N1P2P/PPP3B1/R1BQK1NR w Kkq -
r1b1k1nr/pp1n1ppp/2pb4/3p4/3PpPPq/2N1P2P/PPP3B1/R1BQK1NR w Qkq -
r1b1k1nr/pp1n1ppp/2pb4/3p4/3PpPPq/2N1P2P/PPP3B1/R1BQK1NR w kq -
r1b1k1nr/pp1n1ppp/2pb4/3p4/3PpPPq/2N1P2P/PPP3B1/R1BQK1NR w KQkq -
r1b1k1nr/pp1n1ppp/2pb4/3p4/3PpPPq/2N1P2P/PPP3B1/R1BQK1NR w Kkq -
r1b1k1nr/pp1n1ppp/2pb4/3p4/3PpPPq/2N1P2P/PPP3B1/R1BQK1NR w Qkq -
r1b1k1nr/pp1n1ppp/2pb4/3p4/3PpPPq/2N1P2P/PPP3B1/R1BQK1NR w kq -
-
- Posts: 12541
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Excuses for Wishy Washy FEN/EPD/PGN implementation
Castle flags can be bugs (e.g. castle flag set when there are no castle moves possible). I have a program to detect and correct this defect.
However, different castle states that are valid mean the positions really are different (IOW, different moves are possible as a function of the flags).
It is not uncommon to find in the wild a position with no rooks and with castle flags KQkq
However, different castle states that are valid mean the positions really are different (IOW, different moves are possible as a function of the flags).
It is not uncommon to find in the wild a position with no rooks and with castle flags KQkq
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
-
- Posts: 4319
- Joined: Tue Apr 03, 2012 4:28 pm
Re: Excuses for Wishy Washy FEN/EPD/PGN implementation
That's all taken care of in the source release. Now you just have to persuade all engine programmers to use it (or their own or whatever) .Dann Corbit wrote: ↑Thu Apr 16, 2020 11:36 pm Castle flags can be bugs (e.g. castle flag set when there are no castle moves possible). I have a program to detect and correct this defect.
However, different castle states that are valid mean the positions really are different (IOW, different moves are possible as a function of the flags).
It is not uncommon to find in the wild a position with no rooks and with castle flags KQkq
-
- Posts: 395
- Joined: Fri Aug 12, 2016 8:43 pm
Re: Excuses for Wishy Washy FEN/EPD/PGN implementation
Nope.Dann Corbit wrote: ↑Thu Apr 16, 2020 11:36 pm However, different castle states that are valid mean the positions really are different (IOW, different moves are possible as a function of the flags).
Didn't I just posted 4 different valid FENs that have exactly the same possible moves?
-
- Posts: 4319
- Joined: Tue Apr 03, 2012 4:28 pm
Re: Excuses for Wishy Washy FEN/EPD/PGN implementation
So what? They may have exactly the same possible moves because they block the R from moving or whatever, but their descendants will be different because of differing castle status flags still holding true. The FEN position data may be the same, but the positions are not.Fulvio wrote: ↑Fri Apr 17, 2020 12:17 amNope.Dann Corbit wrote: ↑Thu Apr 16, 2020 11:36 pm However, different castle states that are valid mean the positions really are different (IOW, different moves are possible as a function of the flags).
Didn't I just posted 4 different valid FENs that have exactly the same possible moves?
-
- Posts: 395
- Joined: Fri Aug 12, 2016 8:43 pm
Re: Excuses for Wishy Washy FEN/EPD/PGN implementation
[d]r1b1k1nr/pp1n1ppp/2pb4/3p4/3PpPPq/2N1P2P/PPP3B1/R1BQK1NR w KQkq -chrisw wrote: ↑Fri Apr 17, 2020 12:21 am So what? They may have exactly the same possible moves because they block the R from moving or whatever, but their descendants will be different because of differing castle status flags still holding true. The FEN position data may be the same, but the positions are not.
Did you at least read my message before replying?
Please post an example of this immaginary different descendants.
-
- Posts: 12541
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Excuses for Wishy Washy FEN/EPD/PGN implementation
His point is that white has to move his king, so white will lose the white castle rights.
I consider this as the same category as a true e.p. pawn that cannot capture because it is pinned,
It would be nice to strip that e.p. flag (and I even have a tool to do it) but I can live with those.
I don't encounter many of those types of positions, but bad e.p. pawns are in the millions in data that I have collected,
I have a cleansing tool I run EPD through before I analyze it.
If I had a tool to remove spurious castle flags, I would use that too, but that one does not concern me because of the rarity of those positions,
I consider this as the same category as a true e.p. pawn that cannot capture because it is pinned,
It would be nice to strip that e.p. flag (and I even have a tool to do it) but I can live with those.
I don't encounter many of those types of positions, but bad e.p. pawns are in the millions in data that I have collected,
I have a cleansing tool I run EPD through before I analyze it.
If I had a tool to remove spurious castle flags, I would use that too, but that one does not concern me because of the rarity of those positions,
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
-
- Posts: 12541
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Excuses for Wishy Washy FEN/EPD/PGN implementation
Let's consider this position: [d]r1b1k1nr/pp1n1ppp/2pb4/3p4/3PpPPq/2N1P2P/PPP3B1/R1BQK1NR w KQkq -
In order for the K or the Q to be stripped, one of the rooks would have had to have moved. Looking at this position, how often do you think it would have happened in a real game?
Also, it is necessary that the king is in check and can neither capture nor interpose a chessman.
It is a very interesting thing that I have never thought about before, so thank you for bringing it up.
In order for the K or the Q to be stripped, one of the rooks would have had to have moved. Looking at this position, how often do you think it would have happened in a real game?
Also, it is necessary that the king is in check and can neither capture nor interpose a chessman.
It is a very interesting thing that I have never thought about before, so thank you for bringing it up.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
-
- Posts: 4319
- Joined: Tue Apr 03, 2012 4:28 pm
Re: Excuses for Wishy Washy FEN/EPD/PGN implementation
Ah, yes, I see the idea now. Interesting, one learns something new every day, but of what practical import is this? Some different FENS (by castling rights) all morph into the same thing. And?Dann Corbit wrote: ↑Fri Apr 17, 2020 12:43 am His point is that white has to move his king, so white will lose the white castle rights.
Well, as far as an engine is concerned, the pawn can pseudo-legal capture, and like all pseudo-legals, that gets tested as if arises and checked off.
I consider this as the same category as a true e.p. pawn that cannot capture because it is pinned,
to check that stuff off at EPD verification time would be massive overkill, way too complex and asking for bugs.
It would be nice to strip that e.p. flag (and I even have a tool to do it) but I can live with those.
I don't encounter many of those types of positions, but bad e.p. pawns are in the millions in data that I have collected,
I have a cleansing tool I run EPD through before I analyze it.
If I had a tool to remove spurious castle flags, I would use that too, but that one does not concern me because of the rarity of those positions,