pgn-tactics-generator icon indicating copy to clipboard operation
pgn-tactics-generator copied to clipboard

Example games files that are guaranteed to produce output tactics

Open karol-brejna-i opened this issue 3 years ago • 3 comments

@vitogit Can you share some PGN files that are guaranteed to produce output tactics (tactics.pgn)?

It would be very helpful for testing/development.

We could even consider adding them to the repo for regression tests.

karol-brejna-i avatar May 11 '21 12:05 karol-brejna-i

Good idea, also I would love to have tests. Do you have some suggestion in python? My idea is something simple like have some game.pgn files and compare the output to make sure is ok.

vitogit avatar May 13 '21 15:05 vitogit

I was thinking about something similar: some pgn's that are sure to produce results (for regression), some that should fail (for checking that ambiguousness detection works fine), etc.

karol-brejna-i avatar May 15 '21 07:05 karol-brejna-i

I'm not sure if the results are deterministic. If I run the same input sometimes it generates less tactics. I don't have much time to go deep into this but here are 3 games that sometimes produce 2 tactics or 1 tactic

[Event "<1700 Rapid Arena"]
[Site "https://lichess.org/13Q4NqCj"]
[Date "2019.11.01"]
[White "PedrosF1"]
[Black "artemchampion"]
[Result "1-0"]
[UTCDate "2019.11.01"]
[UTCTime "08:47:32"]
[WhiteElo "1417"]
[BlackElo "1678"]
[WhiteRatingDiff "+12"]
[BlackRatingDiff "-11"]
[Variant "Standard"]
[TimeControl "600+0"]
[ECO "B40"]
[Termination "Normal"]

1. e4 c5 2. Nf3 e6 3. Nc3 a6 4. d4 b5 5. dxc5 Bxc5 6. Bd3 Qb6 7. O-O Bb7 8. Ne5 Nf6 9. a3 Nc6 10. Nxc6 Bxc6 11. b4 Bd4 12. Bd2 Nxe4 13. Bxe4 Bxe4 14. Nxe4 Bxa1 15. Qxa1 Rc8 16. Qxg7 Rf8 17. Nf6+ Ke7 18. Bg5 Kd6 19. Rd1+ Kc6 20. Nxd7 Rcd8 21. Bxd8 Rxd8 22. Qxf7 Qc7 23. Qxe6+ Kb7 24. Nc5+ Ka8 25. Rxd8+ Qxd8 26. Qc6+ Kb8 27. Qb7# 1-0

[Event "U1700 Rapid Arena"]
[Site "https://lichess.org/2BZx5TDD"]
[Date "2019.11.01"]
[Round "-"]
[White "Dicazman"]
[Black "Meju"]
[Result "0-1"]
[UTCDate "2019.11.01"]
[UTCTime "08:42:29"]
[WhiteElo "1547"]
[BlackElo "1629"]
[WhiteRatingDiff "-6"]
[BlackRatingDiff "+6"]
[Variant "Standard"]
[TimeControl "600+0"]
[ECO "C41"]
[Termination "Normal"]

1. e4 e5 2. Nf3 d6 3. d4 exd4 4. Nxd4 Nc6 5. Bb5 Bd7 6. Bxc6 Bxc6 7. Nc3 Nf6 8. Bg5 Be7 9. Bxf6 Bxf6 10. Nxc6 bxc6 11. O-O O-O 12. Re1 Be5 13. g3 Qd7 14. Rb1 Rfe8 15. Na4 Re6 16. Nc5 Qe7 17. Nxe6 Qxe6 18. b3 Qh3 19. Qf3 Re8 20. a4 c5 21. a5 Bc3 22. Re2 Bxa5 23. Ra1 Bb6 24. Qf5 Qh6 25. Qd7 Kf8 26. c4 Qh5 27. Re3 Qe5 28. Rd1 h5 29. f4 Qb2 30. f5 Qf6 31. e5 dxe5 32. Rxe5 Qxe5 33. Rf1 Qe3+ 34. Kh1 Qxb3 35. f6 g6 36. Qd5 c6 37. Qxc6 Qxc4 38. Qd6+ Kg8 39. Rd1 Qe4+ 40. Kg1 c4+ 41. Kf1 Qf3# 0-1

[Event "<1700 Rapid Arena"]
[Site "https://lichess.org/oFKr1UUx"]
[Date "2019.11.01"]
[White "fibberybosch"]
[Black "momentum"]
[Result "1-0"]
[UTCDate "2019.11.01"]
[UTCTime "08:41:29"]
[WhiteElo "1566"]
[BlackElo "1374"]
[WhiteRatingDiff "+4"]
[BlackRatingDiff "-3"]
[Variant "Standard"]
[TimeControl "600+0"]
[ECO "C21"]
[Termination "Normal"]

1. e4 e5 2. d4 exd4 3. c3 Nc6 4. cxd4 Bb4+ 5. Nc3 Bxc3+ 6. bxc3 d5 7. e5 Be6 8. Nf3 Nf6 9. exf6 gxf6 10. Bh6 Qe7 11. Be2 Bg4 12. O-O Bxf3 13. Bxf3 O-O-O 14. Rb1 Qd6 15. Qa4 a6 16. c4 dxc4 17. Qxc4 f5 18. d5 Ne5 19. Qf4 Nxf3+ 20. Qxf3 Qxh6 21. Rfc1 Rhg8 22. Qb3 b6 23. Qf3 Qg6 24. g3 h5 25. h4 Qg4 26. Qc3 Rd7 27. Rxb6 Rg6 28. Rb4 Qh3 29. Qh8+ Rd8 30. Rb8+ Kxb8 31. Qxd8+ Kb7 32. Rb1+ Rb6 33. Rc1 a5 34. Qxc7+ Ka6 35. Qc8+ Kb5 36. Rb1+ Ka4 37. Qc2+ Ka3 38. Qc3+ Ka4 39. Rxb6 Qg4 40. Qc2+ Ka3 41. Qb3# 1-0

And here is my simple test suite

#!/bin/bash

# To run the test from root folder: ./tests/test_default.sh
test_tactics="./tests/tactics_default_3_games_2_found.pgn"
result_tactics="tactics.pgn"

# Run the script with default settings
python3 main.py --games='./tests/default_3_games_2_found.pgn'

diff --brief <(sort $test_tactics) <(sort $result_tactics) >/dev/null
comp_value=$?

if [ $comp_value -eq 1 ]
then
    echo "do something because they're different"
else
    echo "Success"
fi

vitogit avatar May 16 '21 15:05 vitogit