nguyenpham / Banksia

Chess tournament manager, standard C++ 11
Apache License 2.0
83 stars 13 forks source link

Ranking issue #3

Closed twoplan closed 5 years ago

twoplan commented 5 years ago

I ran a small test with Banksia 2.00 and noticed some strange issues.

./banksia -jsonpath ./tour.json 
Banksia, Chess Tournament Manager, by Nguyen Pham - version 2.00
opening books loaded, total items: 0
type: roundrobin, timer: 40/1:0.5, players: 3, matches: 3, concurrency: 1, ponder: off, book: off
 pgn: /Users/max/chess/Banksia/games.pgn, on
 result: /Users/max/chess/Banksia/logresult.txt, on
 engines: /Users/max/chess/Banksia/logengine.txt, on

1. Glaurung-2.2 vs Gaviota-1.0
1) Glaurung-2.2 vs Gaviota-1.0, #262, 1/2-1/2 (fifty moves)
2. Glaurung-2.2 vs Crafty-25.3
2) Glaurung-2.2 vs Crafty-25.3, #83, 1-0 (mate)
3. Gaviota-1.0 vs Crafty-25.3
3) Gaviota-1.0 vs Crafty-25.3, #145, 1-0 (mate)

-------------------------------------
rank    name        games   wins    draws   losses score
1.  Crafty-25.3     2   0.0%    0.0%    100.0%  0
2.  Gaviota-1.0     2   50.0%   50.0%   0.0%    1
3.  Glaurung-2.2    2   50.0%   50.0%   0.0%    1

-------------------------------------
Tournamemt finished! Elapsed: 3:10
[Event  "My test engine tournament"]
[Site   "MacBook Air"]
[Date   "2019.07.13"]
[Round  "1"]
[White  "Glaurung-2.2"]
[Black  "Gaviota-1.0"]
[Result     "1/2-1/2"]
[TimeControl    "40/1:0.5"]
[Time   "13:29:55"]
[Termination    "fifty moves"]
1. Nf3 2. Nf6 Nc3 3. d5 e3 4. Nc6 Bb5 5. Bd7
O-O 6. a6 Bxc6 7. Bxc6 Ne5 8. e6 Nxc6 9. xc6
d4 10. Bb4 Bd2 11. O-O Na4 12. Bd6 c4 13. Ne4
c5 14. Be7 Nc3 15. Nxc3 Bxc3 16. Bh4 Re1 17. f5
Rc1 18. Qd7 Qe2 19. g6 Qf3 20. Bf6 Qf4 21. a5
Re2 22. a4 Qh6 23. R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ke6 111. Rf4 Rd1 112. Rh4 Ke5 113. Kd7
Re1 114. Ke7 Re2 115. Rh5+ Kf4+ 116. Kf6 Ke3 117. Rh4
Kd3 118. Rg4 Re3 119. Kf5 Rf3+ 120. Ke6 Re3+ 121. Kd7
Re2 122. Rf4 Re5 123. Rf3+ Ke2 124. Rf4 Ke3 125. Rg4
Rh5 126. Re4+ Kd3 127. Rg4 Rh7+ 128. Kc8 Ke3 129. Re4+
Kd3 130. Rf4 Ra7 131. Rf3+ Ke2 132. Rf4 1/2-1/2

[Event  "My test engine tournament"]
[Site   "MacBook Air"]
[Date   "2019.07.13"]
[Round  "1"]
[White  "Glaurung-2.2"]
[Black  "Crafty-25.3"]
[Result     "1-0"]
[TimeControl    "40/1:0.5"]
[Time   "13:30:14"]
[Termination    "mate"]
1. Nf3 2. Nf6 Nc3 3. e6 e4 4. d6 d4 5. Nc6
Bb5 6. Be7 O-O 7. O-O Bg5 8. Bd7 Qd2 9. a6
Be2 10. Ng4 Bxe7 11. Qxe7 Rad1 12. Rfd8 Bc4 13. b5
Bb3 14. b4 Ne2 15. a5 Bc4 16. Nf6 e5 17. Nd5
Rfe1 18. xe5 xe5 19. Nb6 Bd3 20. Qc5 Qf4 21. Nd5
Bxh7+ 22. Kf8 Qh4 23. Qe7 Ng5 24. Ke8 Ng3 25. Qf8
Rd3 26. Nce7 Rf3 27. f5 xf6 28. Nxf6 Nh5 29. Rdb8
Be4 30. Kd8 Nh7 31. Nf5 Bxf5 32. Qf7 N5xf6 33. xf6
Bxe6 34. Bxe6 Rxf6 35. Kd7 Qd4+ 36. Kc8 Rexe6 37. Qh5
Re7 38. Qb5 Qe4 39. Qd7 Rf8+ 40. Qd8 Rxd8+ 41. Kxd8
Re8+ 42. Kd7 Qe6+ 1-0

[Event  "My test engine tournament"]
[Site   "MacBook Air"]
[Date   "2019.07.13"]
[Round  "1"]
[White  "Gaviota-1.0"]
[Black  "Crafty-25.3"]
[Result     "1-0"]
[TimeControl    "40/1:0.5"]
[Time   "13:30:53"]
[Termination    "mate"]
1. e4 2. c5 Nf3 3. d6 d4 4. xd4 Nxd4 5. Nf6
Nc3 6. a6 Be3 7. e6 f3 8. b5 Qd2 9. Nbd7
g4 10. h6 O-O-O 11. Bb7 a3 12. Rc8 g5 13. xg5
Bxg5 14. Be7 Kb1 15. d5 Bxf6 16. Nxf6 e5 17. Nh5
Nce2 18. Qc7 f4 19. g5 xg5 20. Qxe5 Rg1 21. Rg8
g6 22. Rxg6 Rxg6 23. xg6 Bh3 24. Ng7 Rg1 25. Qf6
Qh6 26. g5 Qh7 27. Qf7 Rf1 28. Bf6 Qh6 29. Ke7
Ng3 30. Rc4 Bxe6 31. Nxe6 Rxf6 32. Qxf6 Ngf5+ 33. Kf7
Nd6+ 34. Ke7 N4f5+ 35. Qxf5 Nxf5+ 36. Kd7 Qf6 37. Bc8
Qe7+ 38. Kc6 b3 39. Rh4 Qd6+ 40. Kb7 Qxd5+ 41. Kc7
Qd6+ 42. Kb7 Qe7+ 43. Kc6 Qd6+ 44. Kb7 Nxh4 45. xh4
Qe7+ 46. Nc7 Qxh4 47. Bd7 Qe4+ 48. Bc6 Qe5 49. Bd5
h4 50. Bg8 h5 51. Bh7 h6 52. Bg6 Qg7 53. Be4
h7 54. Bxh7 Qxh7 55. Kc6 Qe4+ 56. Kd7 Qd4+ 57. Kc6
c4 58. xc4 xc4 59. a5 Qf6+ 60. Kc5 Kc2 61. Ne8
Qe5+ 62. Kxc4 Qxe8 63. Kc5 Qe5+ 64. Kb6 a4 65. Kc6
Qxa5 66. Kd6 Qd8+ 67. Ke6 a5 68. Ke5 a6 69. Ke4
a7 70. Ke5 a8=Q 71. Kf5 Qad5+ 72. Kg4 Q8g5+ 73. Kh3
Qdg2+ 1-0
nguyenpham commented 5 years ago

Thanks for the report. All bugs are fixed in new version 2.2.

twoplan commented 5 years ago

The file engines.json is there, but I get this error message now:

./banksia -jsonpath tour.json 
Banksia, Chess Tournament Manager, by Nguyen Pham - version 2.2
Error: missing parametter "engine configurations" or the file is not existed

If engines.json is renamed to engines.jso (in tour.json) the error message changes. It seems that Banksia found the file in the first case, but for a different reason doesn't like to continue.

./banksia -jsonpath tour.json 
Banksia, Chess Tournament Manager, by Nguyen Pham - version 2.2
Error: cannot load (or broken) json file /Users/max/chess/Banksia/engines.jso, error: * Line 1, Column 1
  Syntax error: value, object or array expected.

Error: missing parametter "engine configurations" or the file is not existed
twoplan commented 5 years ago

Argh .. just noticed, that you changed the engines.json layout.

./banksia -jsonpath tour.json 
Banksia, Chess Tournament Manager, by Nguyen Pham - version 2.2
opening books loaded, total items: 404
type: roundrobin, timer: 40/1:0.5, players: 3, matches: 6, concurrency: 1, ponder: off, book: on
 pgn: /Users/max/chess/Banksia/games.pgn, on
 result: /Users/max/chess/Banksia/logresult.txt, on
 engines: /Users/max/chess/Banksia/logengine.txt, on

1. Glaurung-2.2 vs Gaviota-1.0
1) Glaurung-2.2 vs Gaviota-1.0, #248, 0-1 (mate)
2. Gaviota-1.0 vs Glaurung-2.2
2) Gaviota-1.0 vs Glaurung-2.2, #153, 1-0 (mate)
3. Glaurung-2.2 vs Crafty-25.3
3) Glaurung-2.2 vs Crafty-25.3, #131, 1-0 (mate)
4. Crafty-25.3 vs Glaurung-2.2
4) Crafty-25.3 vs Glaurung-2.2, #123, 0-1 (mate)
5. Gaviota-1.0 vs Crafty-25.3
5) Gaviota-1.0 vs Crafty-25.3, #155, 1-0 (mate)
6. Crafty-25.3 vs Gaviota-1.0
6) Crafty-25.3 vs Gaviota-1.0, #131, 0-1 (mate)
--------------------------------------------------------------
  #  name         games     wins    draws   losses   score
  1. Gaviota-1.0      4   100.0%     0.0%     0.0%     4.0
  2. Glaurung-2.2     4    50.0%     0.0%    50.0%     2.0
  3. Crafty-25.3      4     0.0%     0.0%   100.0%     0.0
--------------------------------------------------------------

Tournamemt finished! Elapsed: 5:18
nguyenpham commented 5 years ago

Ah, thanks. I missed them! My PGN generator has some bugs, including wrong counting and creating SAN moves (such as creating xd5). All will be fixed soon (maybe done tomorrow).

The lucky point is that the game is still correct. The result is correct too (the last move is actually made by Black event the counter says White). That PGN is still readable by other GUI (e.g. WinBoard can read correctly).

nguyenpham commented 5 years ago

All are fixed (hope that ;) ) in the new version 2.22.

Warning: I have changed the structure of JSON control file again: group logs together (to make them look better). If you feel tired to change them again, please try (and help me to test) the new feature to generate automatically all JSON files. In my iMac, the process of generating takes under 3 minutes even it has to test about 70 files to detect 23 engines from them. That is all, you may forget to change JSON fields, except the fields of opening books.

twoplan commented 5 years ago

Great, version 2.22 works for me. ChessX now reads the complete pgn. Well done!

A small feature request: when playing two games per opponent ("games per pair" : 2), it would be nice Banksia feeds the same opening to both players. So an engine gets the same opening with white and black. Maybe as an option in tour.json?

 ./banksia -jsonpath tour.json
Banksia, Chess Tournament Manager, by Nguyen Pham - version 2.22
opening books loaded, total items: 404
type: roundrobin, timer: 40/1:0.5, players: 3, matches: 6, concurrency: 1, ponder: off, book: on
 pgn: /Users/max/chess/Banksia/games.pgn, on
 result: /Users/max/chess/Banksia/logresult.txt, on
 engines: /Users/max/chess/Banksia/logengine.txt, on

1. Komodo-10 vs Arasan-21.4
1) Komodo-10 vs Arasan-21.4, #86, 0-1 (mate)
2. Arasan-21.4 vs Komodo-10
2) Arasan-21.4 vs Komodo-10, #165, 1-0 (mate)
3. Arasan-21.4 vs Crafty-25.3
3) Arasan-21.4 vs Crafty-25.3, #101, 1-0 (mate)
4. Crafty-25.3 vs Arasan-21.4
4) Crafty-25.3 vs Arasan-21.4, #162, 0-1 (mate)
5. Crafty-25.3 vs Komodo-10
5) Crafty-25.3 vs Komodo-10, #105, 0-1 (mate)
6. Komodo-10 vs Crafty-25.3
6) Komodo-10 vs Crafty-25.3, #113, 1-0 (mate)
-------------------------------------------------------------
  #  name        games     wins    draws   losses   score
  1. Arasan-21.4     4   100.0%     0.0%     0.0%     4.0
  2. Komodo-10       4    50.0%     0.0%    50.0%     2.0
  3. Crafty-25.3     4     0.0%     0.0%   100.0%     0.0
-------------------------------------------------------------

Tournamemt finished! Elapsed: 3:44
[Event  "Roundrobin engine tournament"]
[Site   "MacBook Air"]
[Date   "2019.07.15"]
[Round  "1"]
[White  "Komodo-10"]
[Black  "Arasan-21.4"]
[Result     "0-1"]
[TimeControl    "40/1:0.5"]
[Time   "15:36:18"]
[Board  "1"]
[Termination    "mate"]
[FEN    "rnbqkbnr/pp2pppp/3p4/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R w KQkq c6 0 1"]
[SetUp  "1"]
1. c3 Nf6 2. d4 Nxe4 3. dxc5 Nxc5 4. Be3 Nbd7
5. Nbd2 e5 6. b4 Ne6 7. Ne4 Qc7 8. Qd5 Be7
9. O-O-O O-O 10. Qc4 Qb8 11. Qd3 Nb6 12. Nxd6 Rd8
13. Nxc8 Qxc8 14. Qc2 Nd5 15. Bd3 Nxc3 16. Bxh7+ Kf8
17. Rxd8+ Qxd8 18. Kb2 Rc8 19. Qd2 Qc7 20. Rc1 Bxb4
21. Ka1 g6 22. Bh6+ Ke8 23. Qb2 Qa5 24. Bd2 e4
25. Nh4 b5 26. Bxg6 fxg6 27. Nxg6 Nd4 28. f3 Ba3
29. Qxc3 Rxc3 30. Bxc3 Qd8 31. Bb2 Qf6 32. Kb1 Qxg6
33. Bxa3 exf3+ 34. Ka1 fxg2 35. Rg1 Nc2+ 36. Kb2 Nxa3
37. Kc3 Qc2+ 38. Kd4 Qf2+ 39. Ke4 Qxg1 40. Kf3 Qf1+
41. Ke4 g1=Q 42. h3 Qc5 43. h4 Qff5# 0-1

[Event  "Roundrobin engine tournament"]
[Site   "MacBook Air"]
[Date   "2019.07.15"]
[Round  "1"]
[White  "Arasan-21.4"]
[Black  "Komodo-10"]
[Result     "1-0"]
[TimeControl    "40/1:0.5"]
[Time   "15:37:31"]
[Board  "2"]
[Termination    "mate"]
[FEN    "rnbqkbnr/p2ppppp/1p6/2p5/4P3/1P6/P1PP1PPP/RNBQKBNR w KQkq - 0 1"]
[SetUp  "1"]
1. Nf3 e6 2. Bb2 Nc6 3. Bc4 a6 4. a4 d5
5. exd5 exd5 6. Qe2+ Nge7 7. Bd3 Nb4 8. O-O Nxd3
9. Qxd3 Bf5 10. Qe2 d4 11. d3 Rc8 12. a5 b5
13. Nbd2 Qd5 14. b4 Be6 15. bxc5 Nc6 16. c4 dxc3
17. Bxc3 Rd8 18. Ne4 b4 19. Bb2 Qxd3 20. Qe1 h6
21. Ne5 Nxe5 22. Bxe5 b3 23. Rc1 Rd5 24. Bb2 Be7
25. Bxg7 Rg8 26. Rc3 Qb5 27. Bf6 Rg6 28. Bxe7 Kxe7
29. c6 b2 30. c7 Re5 31. Qb1 Qb4 32. Re3 Rxa5
33. Qd3 Kf8 34. Nf6 Qb7 35. g3 Rxf6 36. Qd8+ Kg7
37. Rxe6 Rxe6 38. c8=Q Qxc8 39. Qxc8 Rb5 40. Rb1 Reb6
41. Qc3+ Kg8 42. Qc8+ Kh7 43. f3 a5 44. Qg4 Rc5
45. Qe4+ Kg8 46. Qe8+ Kg7 47. Qe3 Rcb5 48. h4 Kg8
49. Qe8+ Kg7 50. Qe4 Kg8 51. Kf2 Kg7 52. Qe1 Kf8
53. Qe3 Kg8 54. Qe8+ Kg7 55. Qe4 Kg8 56. g4 Rb8
57. g5 Rb4 58. Qe5 R4b5 59. Qf6 hxg5 60. hxg5 R5b6
61. Qc3 Rb3 62. Qxa5 R3b5 63. Qc7 Rb3 64. Qh2 Rc8
65. Qe5 Rc2+ 66. Kg3 Rc1 67. Rxb2 Rxb2 68. Qxb2 Re1
69. Qc2 Re8 70. Kg4 Re6 71. f4 Kf8 72. f5 Re1
73. Qc5+ Ke8 74. Qb5+ Ke7 75. Qb4+ Kd7 76. Qxe1 Kc6
77. g6 fxg6 78. fxg6 Kc5 79. g7 Kd4 80. g8=Q Kc5
81. Qc8+ Kb5 82. Qb1+ Ka4 83. Qa6# 1-0
nguyenpham commented 5 years ago

Thanks!

For openings, I have been implementing a new feature: select type. There are three types:

There is also a field "seed" for controlling random seed when selecting openings too.

Any suggestions?

twoplan commented 5 years ago

Thats great!