PGN file for SAN testing

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Dave_N
Posts: 153
Joined: Fri Sep 30, 2011 7:48 am

PGN file for SAN testing

Post by Dave_N »

I find lots of errors when I try to compress large PGN files, and they usually occur when a there are 2 pieces of the same type that can reach a square but one of them is pinned. (i.e. Ree6 when a rook is pinned by another Rook on g6)

I think my code is correct because I debugged and tested for a long time, is there a good large pgn with perfect SAN to error check the program code?
User avatar
hgm
Posts: 27810
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: PGN file for SAN testing

Post by hgm »

It should be considered a bug if you cannot handle unnecessary disambiguators, right?
Dave_N
Posts: 153
Joined: Fri Sep 30, 2011 7:48 am

Re: PGN file for SAN testing

Post by Dave_N »

I don't know, I always handle the ambiguity so when I compress and decompress the SAN strings don't match, so I need a good SAN stress test PGN to make sure the compression is working properly.
User avatar
hgm
Posts: 27810
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: PGN file for SAN testing

Post by hgm »

OK, I see. You want to test by seeing if you get the original text back.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: PGN file for SAN testing

Post by Don »

Dave_N wrote:I find lots of errors when I try to compress large PGN files, and they usually occur when a there are 2 pieces of the same type that can reach a square but one of them is pinned. (i.e. Ree6 when a rook is pinned by another Rook on g6)

I think my code is correct because I debugged and tested for a long time, is there a good large pgn with perfect SAN to error check the program code?
Run a large pgn file through pgn-extract and it will clean up any problems if it's possible and identify any ambiguities. It can also remove comments if you want it to. It's a great tool.

It can also convert long algebraic to SAN, i.e. 1. e2e4 d7d5 2. e4d5
Dave_N
Posts: 153
Joined: Fri Sep 30, 2011 7:48 am

Re: PGN file for SAN testing

Post by Dave_N »

Had to wait until the program finished the compression test ... 238Mb compressed to 39.2Mb, with errors.

pgn-extract still produces the san disambiguity after running

"pgn-extract-16-7 -ostress.pgn stress_test.pgn"

here is the game

[Event "?"]
[Site "?"]
[Date "2011.??.??"]
[Round "?"]
[White "Jang Kyungsik"]
[Black "Iskandar, Bin Abdullah"]
[Result "1/2-1/2"]
[ECO "C01"]
[WhiteElo "1779"]
[BlackElo "1876"]
[PlyCount "70"]
[EventDate "2011.??.??"]

1. e4 e6 2. d4 d5 3. exd5 exd5 4. Bd3 Bd6 5. Nf3 Ne7 6. O-O Bg4 7. c3 Nbc6 8.
Nbd2 Qd7 9. Qc2 O-O-O 10. b4 f6 11. a4 g5 12. a5 h5 13. b5 Nb8 14. Ba3 h4 15.
Bxd6 Qxd6 16. c4 Qf4 17. Rae1 Rde8 18. g3 hxg3 19. fxg3 Qd6 20. c5 Qd7 21. a6
bxa6 22. bxa6 Nf5 23. Qb2 c6 24. Rb1 Qc7 25. Nxg5 Nxg3 26. Qb7+ Qxb7 27. axb7+
Kd7 28. hxg3 fxg5 29. Bf5+ Bxf5 30. Rxf5 g4 31. Rbf1 Re7 32. Rf7 Rhe8 33. Nb3
Kd8 34. Rxe7 Rxe7 35. Rf8+ Kc7 1/2-1/2

The Rhe8 doesn't need the h because the rook on the e-file is pinned.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: PGN file for SAN testing

Post by Don »

Dave_N wrote:Had to wait until the program finished the compression test ... 238Mb compressed to 39.2Mb, with errors.

pgn-extract still produces the san disambiguity after running

"pgn-extract-16-7 -ostress.pgn stress_test.pgn"

here is the game

[Event "?"]
[Site "?"]
[Date "2011.??.??"]
[Round "?"]
[White "Jang Kyungsik"]
[Black "Iskandar, Bin Abdullah"]
[Result "1/2-1/2"]
[ECO "C01"]
[WhiteElo "1779"]
[BlackElo "1876"]
[PlyCount "70"]
[EventDate "2011.??.??"]

1. e4 e6 2. d4 d5 3. exd5 exd5 4. Bd3 Bd6 5. Nf3 Ne7 6. O-O Bg4 7. c3 Nbc6 8.
Nbd2 Qd7 9. Qc2 O-O-O 10. b4 f6 11. a4 g5 12. a5 h5 13. b5 Nb8 14. Ba3 h4 15.
Bxd6 Qxd6 16. c4 Qf4 17. Rae1 Rde8 18. g3 hxg3 19. fxg3 Qd6 20. c5 Qd7 21. a6
bxa6 22. bxa6 Nf5 23. Qb2 c6 24. Rb1 Qc7 25. Nxg5 Nxg3 26. Qb7+ Qxb7 27. axb7+
Kd7 28. hxg3 fxg5 29. Bf5+ Bxf5 30. Rxf5 g4 31. Rbf1 Re7 32. Rf7 Rhe8 33. Nb3
Kd8 34. Rxe7 Rxe7 35. Rf8+ Kc7 1/2-1/2

The Rhe8 doesn't need the h because the rook on the e-file is pinned.
You asked this: "is there a good large pgn with perfect SAN to error check the program code?"

You can create a perfect SAN by running through pgn-extract. I just did this on the game you posted with the ambiguious move and get this:


[Event "?"]
[Site "?"]
[Date "2011.??.??"]
[Round "?"]
[White "Jang Kyungsik"]
[Black "Iskandar, Bin Abdullah"]
[Result "1/2-1/2"]
[WhiteElo "1779"]
[BlackElo "1876"]
[ECO "C01"]
[EventDate "2011.??.??"]
[PlyCount "70"]

1. e4 e6 2. d4 d5 3. exd5 exd5 4. Bd3 Bd6 5. Nf3 Ne7 6. O-O Bg4 7. c3 Nbc6
8. Nbd2 Qd7 9. Qc2 O-O-O 10. b4 f6 11. a4 g5 12. a5 h5 13. b5 Nb8 14. Ba3
h4 15. Bxd6 Qxd6 16. c4 Qf4 17. Rae1 Rde8 18. g3 hxg3 19. fxg3 Qd6 20. c5
Qd7 21. a6 bxa6 22. bxa6 Nf5 23. Qb2 c6 24. Rb1 Qc7 25. Nxg5 Nxg3 26. Qb7+
Qxb7 27. axb7+ Kd7 28. hxg3 fxg5 29. Bf5+ Bxf5 30. Rxf5 g4 31. Rbf1 Re7 32.
Rf7 Re8 33. Nb3 Kd8 34. Rxe7 Rxe7 35. Rf8+ Kc7 1/2-1/2


So I'm not sure I understand what it is you are looking for.
Dave_N
Posts: 153
Joined: Fri Sep 30, 2011 7:48 am

Re: PGN file for SAN testing

Post by Dave_N »

Ok after the 2nd test pgn-extract worked - or I opened the wrong file last time :)

exactly what I was looking for, thanks.
jdart
Posts: 4367
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: PGN file for SAN testing

Post by jdart »

See http://arasanchess.org/games_downld.shtml under "Misc. Computer Games" - all of these have correct SAN.
Dave_N
Posts: 153
Joined: Fri Sep 30, 2011 7:48 am

Re: PGN file for SAN testing

Post by Dave_N »

Thanks for the link