Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ambiguous san: 'Nec3' in 8/8/6K1/4k3/4N3/p4r2/N3N3/8 w - - 3 82 #144

Closed
robertnurnberg opened this issue Jan 22, 2025 · 2 comments
Closed

Comments

@robertnurnberg
Copy link
Contributor

This game was part of a pgn created by fastchess on fishtest. I assume the culprit is in chess-library.

[Event "Batch 44: new406 vs master"]
[Site "https://tests.stockfishchess.org/tests/view/678d48cfd63764e34db495ed"]
[Date "2025.01.19"]
[Round "144"]
[White "New-165e664d57c4dfde814377b58789b395b00f6751"]
[Black "Base-8e3e22b3d4f214e12aa83771be543aac1196d713"]
[Result "1/2-1/2"]
[SetUp "1"]
[FEN "r3k1nr/pbppqpb1/1pn1p2p/6p1/2PP4/2NBPN2/PP3PPP/R1BQ1RK1 w kq - 6 9"]
[GameDuration "00:02:37"]
[GameStartTime "2025-01-19T20:11:22 +0100"]
[GameEndTime "2025-01-19T20:14:00 +0100"]
[PlyCount "158"]
[Termination "adjudication"]
[TimeControl "45.161+0.452"]

1. Nb5 {+1.08/25 5.572s} d5 {-1.04/23 2.355s} 2. cxd5 {+0.99/21 1.442s}
exd5 {-1.06/21 1.189s} 3. Bd2 {+1.06/19 0.662s} a6 {-0.98/21 1.044s}
4. Nc3 {+1.03/20 0.690s} g4 {-1.09/22 2.064s} 5. Ne1 {+1.01/20 0.808s}
Nf6 {-1.03/20 0.702s} 6. Nc2 {+1.18/24 4.363s} h5 {-0.99/17 0.750s}
7. f3 {+1.27/20 0.662s} gxf3 {-1.08/23 3.331s} 8. Rxf3 {+1.43/22 2.222s}
O-O-O {-1.26/26 4.887s} 9. Qe2 {+1.28/21 1.703s} a5 {-1.33/23 1.452s}
10. Raf1 {+1.27/21 0.739s} h4 {-1.39/22 1.453s} 11. Be1 {+1.33/20 0.864s}
Kb8 {-1.21/23 5.064s} 12. a3 {+1.34/22 2.873s} Rdg8 {-1.26/22 1.168s}
13. Rh3 {+1.40/17 0.531s} Ne4 {-1.21/21 1.980s} 14. Nxd5 {+1.39/19 0.833s}
Qe8 {-1.34/21 1.086s} 15. Nc3 {+1.23/20 2.153s} Nd6 {-1.25/19 0.658s}
16. Rf4 {+1.31/19 0.708s} f5 {-1.23/19 0.683s} 17. Rfxh4 {+1.34/22 1.104s}
Rxh4 {-1.26/19 0.577s} 18. Bxh4 {+1.28/20 1.145s} f4 {-1.27/19 0.649s}
19. Bf2 {+1.26/18 0.784s} Qd7 {-1.18/20 0.904s} 20. Rh7 {+1.55/19 0.744s}
fxe3 {-1.15/18 1.427s} 21. Qxe3 {+1.55/20 1.433s} Ne7 {-1.22/19 0.718s}
22. Qf4 {+1.14/25 4.134s} Rf8 {-1.14/20 1.288s} 23. Qg3 {+1.16/24 3.201s}
Ndf5 {-1.01/23 4.085s} 24. Qg4 {+1.10/20 3.016s} Qe6 {-0.96/18 0.445s}
25. Be4 {+1.14/22 2.399s} Qg8 {-0.96/20 1.492s} 26. Rh3 {+1.12/17 0.460s}
Bc8 {-0.86/18 0.989s} 27. Rf3 {+1.30/19 0.632s} Rf6 {-0.14/19 0.729s}
28. Rd3 {+0.09/26 8.138s} Nd6 {-0.10/23 3.655s} 29. Qd1 {+0.11/17 0.672s}
Nxe4 {-0.13/20 0.641s} 30. Nxe4 {+0.29/18 0.361s} Rf8 {-0.09/23 1.899s}
31. d5 {+0.24/23 0.600s} Nxd5 {-0.07/19 0.334s} 32. Rxd5 {+0.19/21 0.553s}
Bb7 {-0.07/22 0.682s} 33. Ne3 {+0.20/25 0.490s} Bxd5 {-0.05/21 0.470s}
34. Qxd5 {+0.18/22 0.437s} Qxd5 {-0.06/21 0.631s} 35. Nxd5 {+0.10/21 0.734s}
Bxb2 {-0.09/21 0.698s} 36. a4 {+0.08/26 0.538s} b5 {-0.15/24 1.491s}
37. axb5 {+0.13/23 0.348s} a4 {-0.22/20 0.620s} 38. Ndc3 {+0.14/23 0.795s}
a3 {-0.12/22 0.651s} 39. Na2 {+0.13/20 0.291s} Be5 {-0.13/23 0.721s}
40. h4 {+0.05/26 1.982s} Rf4 {-0.08/29 0.739s} 41. Nec3 {+0.05/20 0.170s}
Rf5 {-0.08/22 0.641s} 42. Nb1 {0.00/24 1.351s} Bd6 {-0.05/23 0.644s}
43. Nbc3 {0.00/18 0.140s} Be5 {-0.04/21 0.464s} 44. g4 {0.00/25 0.205s}
Rf4 {0.00/33 0.688s} 45. g5 {0.00/25 0.245s} Bd4 {0.00/31 0.484s}
46. Bxd4 {0.00/25 0.180s} Rxd4 {0.00/33 0.498s} 47. Kg2 {0.00/30 0.280s}
Rxh4 {0.00/33 0.455s} 48. Kf3 {0.00/32 0.317s} Kb7 {0.00/40 0.692s}
49. Ne2 {0.00/32 0.496s} Rh8 {0.00/39 2.128s} 50. Kg4 {-0.03/23 0.875s}
c6 {0.00/29 0.355s} 51. b6 {0.00/28 0.304s} Rh2 {0.00/42 0.592s}
52. Nec3 {0.00/39 0.295s} Rg2+ {0.00/48 0.557s} 53. Kf5 {0.00/51 0.382s}
Rf2+ {0.00/40 0.778s} 54. Ke6 {0.00/45 0.398s} Rg2 {0.00/52 0.544s}
55. Kf6 {0.00/57 0.390s} Rf2+ {0.00/46 0.496s} 56. Ke6 {0.00/51 1.439s}
Rg2 {0.00/48 0.606s} 57. Kf6 {0.00/55 0.387s} Rf2+ {0.00/49 0.954s}
58. Kg7 {0.00/36 0.212s} Kxb6 {0.00/24 0.281s} 59. g6 {0.00/23 0.166s}
Kc7 {0.00/30 0.339s} 60. Kh6 {0.00/31 0.270s} Rh2+ {0.00/34 0.443s}
61. Kg5 {0.00/24 0.203s} Kd7 {0.00/39 0.448s} 62. g7 {0.00/25 0.214s}
Rg2+ {0.00/38 0.471s} 63. Kf6 {0.00/36 0.355s} Rf2+ {0.00/43 0.457s}
64. Kg5 {0.00/45 0.731s} Ke7 {0.00/32 1.647s} 65. g8=N+ {+0.08/19 0.321s}
Ke6 {0.00/27 0.237s} 66. Nh6 {+0.06/18 0.295s} c5 {0.00/26 0.472s}
67. Ng4 {0.00/26 0.384s} Rf5+ {0.00/32 0.490s} 68. Kg6 {0.00/25 0.631s}
Rf3 {0.00/27 0.333s} 69. Ne2 {0.00/24 0.356s} Kd5 {0.00/23 0.293s}
70. Nf6+ {0.00/27 0.389s} Ke5 {0.00/24 0.497s} 71. Nd7+ {-0.01/25 0.916s}
Ke6 {0.00/29 0.563s} 72. Nxc5+ {0.00/23 0.149s} Kd6 {0.00/26 0.575s}
73. Ne4+ {0.00/29 0.497s} Ke5 {0.00/32 0.371s} 74. Nec3 {0.00/31 0.604s}
Rf1 {0.00/26 0.358s} 75. Kh5 {0.00/29 0.377s} Rf3 {0.00/32 0.419s}
76. Nb5 {0.00/29 0.397s} Re3 {0.00/41 0.360s} 77. Nbc3 {0.00/29 0.465s}
Kf5 {0.00/41 0.360s} 78. Nd4+ {0.00/33 0.356s} Ke5 {0.00/38 0.681s}
79. Ndb5 {0.00/36 0.385s} Kf5 {0.00/36 0.861s, Draw by adjudication} 1/2-1/2

Parsing this pgn with python-chess gives this error:

  File "/usr/local/lib/python3.10/dist-packages/chess/pgn.py", line 1685, in read_game
    move = visitor.parse_san(board_stack[-1], token)
  File "/usr/local/lib/python3.10/dist-packages/chess/pgn.py", line 1059, in parse_san
    return board.parse_san(san)
  File "/usr/local/lib/python3.10/dist-packages/chess/__init__.py", line 3057, in parse_san
    raise AmbiguousMoveError(f"ambiguous san: {san!r} in {self.fen()}")
chess.AmbiguousMoveError: ambiguous san: 'Nec3' in 8/8/6K1/4k3/4N3/p4r2/N3N3/8 w - - 3 82
  Original source of game 1 has error ambiguous san: 'Nec3' in 8/8/6K1/4k3/4N3/p4r2/N3N3/8 w - - 3 82.
@robertnurnberg
Copy link
Contributor Author

robertnurnberg commented Jan 22, 2025

I guess once fixed the following FEN could be a useful test case, with checks whether each knight moving to c3 is encoded correctly in SAN: 8/8/6K1/4k3/N3N3/p4r2/N3N3/8 w - - 3 82. (Together with the original FEN with just 3 knights possibly moving to c3).

@robertnurnberg
Copy link
Contributor Author

This seems to be a duplicate of #140 and so is probably fixed by #141. But adding more tests (also for other pieces) might be a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants