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

Wrong PGN export from study with multiple comments per node #15939

Open
Siderite opened this issue Aug 21, 2024 · 8 comments
Open

Wrong PGN export from study with multiple comments per node #15939

Siderite opened this issue Aug 21, 2024 · 8 comments
Labels
bug can't reproduce Needs steps to reproduce

Comments

@Siderite
Copy link

Siderite commented Aug 21, 2024

Exact URL of where the bug happened

https://lichess.org/study/GJ5NRo9a/t7QR44fO

Steps to reproduce the bug

  1. Export the chapter PGN
  2. Try to import it in Analysis or anywhere

What did you expect to happen?

Exported PGN is correct

What happened instead?

PGN fails to export move 12...a5, resulting in an invalid PGN

Operating system

Windows 11

Browser and version (or alternate access method)

Brave

Additional information

Particular node that causes the issue can be found at path "/?WG)8aP8GVNG8P?.>NF(6`N'*_b-=UM(']H&4^V=ENU19"

The simplified PGN to the move is this: 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Bd6 7. O-O O-O 8. c4 c6 9. Re1 Bf5 10. Qb3 Qd7 11. c5 Bc7 12. g3 {Torch v2: 839058Mn} {[#]Testing out the Nakamura-Nepo game from the 2024 Candidates!} a5 13. Nbd2

@Siderite Siderite added the bug label Aug 21, 2024
@Siderite
Copy link
Author

There are multiple chapters that are exported wrong in that study.

@kraktus
Copy link
Member

kraktus commented Aug 26, 2024

I cannot reproduce with the simplified example

https://lichess.org/study/a27kFcjo/MrbgVpLQ

copy PGN

[Event "multi-comment export #15939: Chapter 1"]
[Site "https://lichess.org/study/a27kFcjo/MrbgVpLQ"]
[Result "*"]
[Variant "Standard"]
[ECO "C42"]
[Opening "Petrov's Defense: Classical Attack, Staunton Variation"]
[Annotator "https://lichess.org/@/Solal35"]
[UTCDate "2024.08.26"]
[UTCTime "09:41:44"]

1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Bd6 7. O-O O-O 8. c4 c6 9. Re1 Bf5 10. Qb3 Qd7 11. c5 Bc7 12. g3 { [#]Testing out the Nakamura-Nepo game from the 2024 Candidates! } { Torch v2: 839058Mn } 12... a5 13. Nbd2 *

Export chapter PGN

[Event "multi-comment export #15939: Chapter 1"]
[Site "https://lichess.org/study/a27kFcjo/MrbgVpLQ"]
[Result "*"]
[Variant "Standard"]
[ECO "C42"]
[Opening "Petrov's Defense: Classical Attack, Staunton Variation"]
[Annotator "https://lichess.org/@/Solal35"]
[UTCDate "2024.08.26"]
[UTCTime "09:41:44"]

1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Bd6 7. O-O O-O 8. c4 c6 9. Re1 Bf5 10. Qb3 Qd7 11. c5 Bc7 12. g3 { [#]Testing out the Nakamura-Nepo game from the 2024 Candidates! } { Torch v2: 839058Mn } 12... a5 13. Nbd2 *

@kraktus kraktus added the can't reproduce Needs steps to reproduce label Aug 26, 2024
lenguyenthanh added a commit to lenguyenthanh/scala-examples that referenced this issue Aug 26, 2024
@lenguyenthanh
Copy link
Member

I looked at this the other day and there is definitely something wrong with our parser. Basically, this should work pgn ==parse(pgn).toPgn, but it doesn't.

lenguyenthanh/scala-examples@1676ecd

@Siderite
Copy link
Author

Note that the PGN exported from LiChess Tools in the client was OK, imported OK and yielded no issues. Which means at least getting the data from the server to the move tree works fine, and indeed the study works just fine. It's the string output that is the issue.

@lenguyenthanh
Copy link
Member

@Siderite could you send me the exported pgn by LiChess Tools?

@Siderite
Copy link
Author

Siderite commented Aug 26, 2024

[White "Torch Openings"]
[Black "1.e4 with theory review"]
[Date "2024.03.25"]
[Result "*"]
[Annotator "GM Matthew Sadler"]
[Site "https://lichess.org/study/GJ5NRo9a/t7QR44fO"]
[UTCDate "2024.08.26"]
[UTCTime "12:44:53"]
 {305093Mn produced a main line in the Berlin endgame.}
1. e4 e5 2. Nf3 Nf6 3. Nxe5 {Produced after 244243Mn} d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Bd6 7. O-O O-O 8. c4 c6 9. Re1 Bf5 10. Qb3 Qd7 11. c5 Bc7 12. g3 {Torch v2: 839058Mn} {[#]Testing out the Nakamura-Nepo game from the 2024 Candidates!} a5 (13. Nbd2 Be6 14. Qxb7 Nxf2 15. Bxh7+ Kxh7 16. Qxa8 Nh3+ 17. Kg2 Bg4 18. Qb7 Re8 19. Qb3 {Nakamura,H (2789)-Nepomniachtchi,I (2758) Toronto, Canada 2024}) 13. Nbd2 Be6 14. Qxb7 Nxf2 15. Bxh7+ Kxh7 16. Ng5+ (16. Qxa8) 16... Kg8 17. Qxa8 Nh3+ 18. Nxh3 Bxh3 19. Nf3 Qf5 20. Ng5 Qg4 21. Nxh3 Bxg3 22. Nf2 Bxf2+ 23. Kxf2 Qf5+ 24. Kg3 Qg6+ 25. Kf3 Qh5+ 26. Kg3 {0.00/76}

copied to the offending node and all variations following it.

But note that this is my own rendering of the node data, so it might not help much.

@Siderite
Copy link
Author

Siderite commented Aug 26, 2024

Lol! I just realized that it's not importing it. Geez! Steered you wrong. I remember that it was fine, though.

Yes, the children are all wrong. node with ply 23 has children with ply 24 and 25.

@lenguyenthanh
Copy link
Member

lenguyenthanh commented Aug 26, 2024

ah, thanks any way! We may need to ask the user for the original pgn. But I'll try to debug it first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug can't reproduce Needs steps to reproduce
Projects
None yet
Development

No branches or pull requests

3 participants