EPD blindness

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

EPD blindness

Post by Dann Corbit »

Crafty's EPD repair command {epdpfdr} stops on this record with an error:
[d]2kr3r/pppn3p/2n1p3/2P1Ppb1/3P4/2N2B2/PP3B1P/3RK2R w K f6 - bm O-O; id "Crafty Test Pos.82"; c0 "MIKE VALVO/DEEP THOUGHT 0.02 Game 1, On the Net 1988-9, move 21W (O-O)";

I can't for the life of me see anything wrong with that EPD record. What is the problem?
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: EPD blindness

Post by michiguel »

Dann Corbit wrote:Crafty's EPD repair command {epdpfdr} stops on this record with an error:
[d]2kr3r/pppn3p/2n1p3/2P1Ppb1/3P4/2N2B2/PP3B1P/3RK2R w K f6 - bm O-O; id "Crafty Test Pos.82"; c0 "MIKE VALVO/DEEP THOUGHT 0.02 Game 1, On the Net 1988-9, move 21W (O-O)";

I can't for the life of me see anything wrong with that EPD record. What is the problem?
2kr3r/pppn3p/2n1p3/2P1Ppb1/3P4/2N2B2/PP3B1P/3RK2R w K f6 - bm O-O; id "Crafty Test Pos.82"; c0 "MIKE VALVO/DEEP THOUGHT 0.02 Game 1, On the Net 1988-9, move 21W (O-O)";

From the top of my head, I think the dash (in red) is extra. You have already K (castle) and f6 (en passant)

Miguel
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: EPD blindness

Post by Dann Corbit »

michiguel wrote:
Dann Corbit wrote:Crafty's EPD repair command {epdpfdr} stops on this record with an error:
[d]2kr3r/pppn3p/2n1p3/2P1Ppb1/3P4/2N2B2/PP3B1P/3RK2R w K f6 - bm O-O; id "Crafty Test Pos.82"; c0 "MIKE VALVO/DEEP THOUGHT 0.02 Game 1, On the Net 1988-9, move 21W (O-O)";

I can't for the life of me see anything wrong with that EPD record. What is the problem?
2kr3r/pppn3p/2n1p3/2P1Ppb1/3P4/2N2B2/PP3B1P/3RK2R w K f6 - bm O-O; id "Crafty Test Pos.82"; c0 "MIKE VALVO/DEEP THOUGHT 0.02 Game 1, On the Net 1988-9, move 21W (O-O)";

From the top of my head, I think the dash (in red) is extra. You have already K (castle) and f6 (en passant)

Miguel
Quite right. Thanks
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: EPD blindness

Post by bob »

Dann Corbit wrote:Crafty's EPD repair command {epdpfdr} stops on this record with an error:
[d]2kr3r/pppn3p/2n1p3/2P1Ppb1/3P4/2N2B2/PP3B1P/3RK2R w K f6 - bm O-O; id "Crafty Test Pos.82"; c0 "MIKE VALVO/DEEP THOUGHT 0.02 Game 1, On the Net 1988-9, move 21W (O-O)";

I can't for the life of me see anything wrong with that EPD record. What is the problem?
I will look, but that code is not "Crafty's". Steven Edwards wrote the EPD kit many years ago and actually added it to Crafty's source and sent me the modified code, which I kept. I looked at the code and the EPD string and I too do not see anything that stands out. I deleted everything past the ep target, added two - characters, and it won't work with that either...

I can delete everything from that "-" on and it is accepted. No idea why. Note that just deleting the "-" won't fix it.
Norm Pollock
Posts: 1056
Joined: Thu Mar 09, 2006 4:15 pm
Location: Long Island, NY, USA

Re: EPD blindness

Post by Norm Pollock »

michiguel wrote:
Dann Corbit wrote:Crafty's EPD repair command {epdpfdr} stops on this record with an error:
[d]2kr3r/pppn3p/2n1p3/2P1Ppb1/3P4/2N2B2/PP3B1P/3RK2R w K f6 - bm O-O; id "Crafty Test Pos.82"; c0 "MIKE VALVO/DEEP THOUGHT 0.02 Game 1, On the Net 1988-9, move 21W (O-O)";

I can't for the life of me see anything wrong with that EPD record. What is the problem?
2kr3r/pppn3p/2n1p3/2P1Ppb1/3P4/2N2B2/PP3B1P/3RK2R w K f6 - bm O-O; id "Crafty Test Pos.82"; c0 "MIKE VALVO/DEEP THOUGHT 0.02 Game 1, On the Net 1988-9, move 21W (O-O)";

From the top of my head, I think the dash (in red) is extra. You have already K (castle) and f6 (en passant)

Miguel
I agree. An EPD has exactly 4 tokens prior to optional opcodes. Opcodes must start from a list of accepted opcodes. The "-" is not an accepted opcode. An opcode ends with a semicolon after its data.

Some opcodes are listed here:

http://scid.sourceforge.net/help/EPD.html

Another issue might be the lack of quotes around opcode data. Usually opcode data is embedded in a pair of quotation marks, and sometimes it is not. I do not know what the Standard is.

Disclaimer - I do not know where EPD standards are or where a full list of opcodes are. My views above are based upon my experience with EPDs.
Updated links for 40H Tools and Databases
http://40Hchess.epizy.com
http://nk-qy.info/40h
Norm Pollock
Posts: 1056
Joined: Thu Mar 09, 2006 4:15 pm
Location: Long Island, NY, USA

Re: EPD blindness

Post by Norm Pollock »

2kr3r/pppn3p/2n1p3/2P1Ppb1/3P4/2N2B2/PP3B1P/3RK2R w K f6 - bm O-O; id "Crafty Test Pos.82"; c0 "MIKE VALVO/DEEP THOUGHT 0.02 Game 1, On the Net 1988-9, move 21W (O-O)";

Looking at this a little further, I see two errors.

First is the "-" as the 5th token, preceding "bm"

Second is the lack of quotations around O-O in bm O-O;
The quotations are needed because of the "-" character. My guess is that the "-" character has some special significance if it is not inside quotes. Usually quotes are not needed.
Updated links for 40H Tools and Databases
http://40Hchess.epizy.com
http://nk-qy.info/40h
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: EPD blindness

Post by Dann Corbit »

Norm Pollock wrote:2kr3r/pppn3p/2n1p3/2P1Ppb1/3P4/2N2B2/PP3B1P/3RK2R w K f6 - bm O-O; id "Crafty Test Pos.82"; c0 "MIKE VALVO/DEEP THOUGHT 0.02 Game 1, On the Net 1988-9, move 21W (O-O)";

Looking at this a little further, I see two errors.

First is the "-" as the 5th token, preceding "bm"

Second is the lack of quotations around O-O in bm O-O;
The quotations are needed because of the "-" character. My guess is that the "-" character has some special significance if it is not inside quotes. Usually quotes are not needed.
I do not know of any chess engine that puts quotations around castle moves.

I thought that quotations were only needed if whitespace were present in a symbol.
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: EPD blindness

Post by jwes »

Dann Corbit wrote:
Norm Pollock wrote:2kr3r/pppn3p/2n1p3/2P1Ppb1/3P4/2N2B2/PP3B1P/3RK2R w K f6 - bm O-O; id "Crafty Test Pos.82"; c0 "MIKE VALVO/DEEP THOUGHT 0.02 Game 1, On the Net 1988-9, move 21W (O-O)";

Looking at this a little further, I see two errors.

First is the "-" as the 5th token, preceding "bm"

Second is the lack of quotations around O-O in bm O-O;
The quotations are needed because of the "-" character. My guess is that the "-" character has some special significance if it is not inside quotes. Usually quotes are not needed.
I do not know of any chess engine that puts quotations around castle moves.

I thought that quotations were only needed if whitespace were present in a symbol.
You are right. From the epd section of pgnstandard.txt

An operand is either a set of contiguous non-white space printing characters or a string. A string is a set of contiguous printing characters delimited by a quote character at each end.
Norm Pollock
Posts: 1056
Joined: Thu Mar 09, 2006 4:15 pm
Location: Long Island, NY, USA

Re: EPD blindness

Post by Norm Pollock »

jwes wrote:
Dann Corbit wrote:
Norm Pollock wrote:2kr3r/pppn3p/2n1p3/2P1Ppb1/3P4/2N2B2/PP3B1P/3RK2R w K f6 - bm O-O; id "Crafty Test Pos.82"; c0 "MIKE VALVO/DEEP THOUGHT 0.02 Game 1, On the Net 1988-9, move 21W (O-O)";

Looking at this a little further, I see two errors.

First is the "-" as the 5th token, preceding "bm"

Second is the lack of quotations around O-O in bm O-O;
The quotations are needed because of the "-" character. My guess is that the "-" character has some special significance if it is not inside quotes. Usually quotes are not needed.
I do not know of any chess engine that puts quotations around castle moves.

I thought that quotations were only needed if whitespace were present in a symbol.
You are right. From the epd section of pgnstandard.txt

An operand is either a set of contiguous non-white space printing characters or a string. A string is a set of contiguous printing characters delimited by a quote character at each end.
The way I look at it:
If the operand has whitespace, then you MUST enclose in quotes.
If the operand does NOT have whitespace, you have the OPTION to put the operand in quotes.

In the case of the buggy EPD line above, there seems to be an error in the software because the only visible error in the EPD line is an extra "-" and when that is removed, the EPD line is still buggy.

My suggestion is to use the OPTION of quotes around O-O to see if that would work around the presumed bug in the software. There is not a high probability of success, but it might work because I have seen this workaround work on my own software.

I have come across a case in my own software where, in rare situations, quotes are needed around a parameter even though that parameter does not contain whitespace. The problem might be coming from the compiler. Here is an actual example:

tagExtract alpha.pgn Site Paris
works well

tagExtract alpha.pgn Site "Paris"
works well

tagExtract alpha.pgn Site "New York"
works well

tagextract alpha.pgn Site &
does NOT work

tagextract alpha.pgn Site "&"
works well
Updated links for 40H Tools and Databases
http://40Hchess.epizy.com
http://nk-qy.info/40h