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?
PGN file for SAN testing
Moderators: hgm, Rebel, chrisw
-
- Posts: 27810
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: PGN file for SAN testing
It should be considered a bug if you cannot handle unnecessary disambiguators, right?
-
- Posts: 153
- Joined: Fri Sep 30, 2011 7:48 am
Re: PGN file for SAN testing
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.
-
- Posts: 27810
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: PGN file for SAN testing
OK, I see. You want to test by seeing if you get the original text back.
-
- Posts: 5106
- Joined: Tue Apr 29, 2008 4:27 pm
Re: PGN file for SAN testing
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.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?
It can also convert long algebraic to SAN, i.e. 1. e2e4 d7d5 2. e4d5
-
- Posts: 153
- Joined: Fri Sep 30, 2011 7:48 am
Re: PGN file for SAN testing
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.
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.
-
- Posts: 5106
- Joined: Tue Apr 29, 2008 4:27 pm
Re: PGN file for SAN testing
You asked this: "is there a good large pgn with perfect SAN to error check the program code?"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 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.
-
- Posts: 153
- Joined: Fri Sep 30, 2011 7:48 am
Re: PGN file for SAN testing
Ok after the 2nd test pgn-extract worked - or I opened the wrong file last time
exactly what I was looking for, thanks.
exactly what I was looking for, thanks.
-
- Posts: 4367
- Joined: Fri Mar 10, 2006 5:23 am
- Location: http://www.arasanchess.org
Re: PGN file for SAN testing
See http://arasanchess.org/games_downld.shtml under "Misc. Computer Games" - all of these have correct SAN.
-
- Posts: 153
- Joined: Fri Sep 30, 2011 7:48 am
Re: PGN file for SAN testing
Thanks for the link