creating an opening book

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: creating an opening book

Post by jdart »

Here are a couple of long time-control games from the position. Stockfish played .. Nc4 and won; Komodo played .. b5 and lost.

[pgn]
[Event "Computer Chess Game"]
[Site "puppy"]
[Date "2015.06.25"]
[Round "1"]
[White "Stockfish 6 64 POPCNT"]
[Black "Komodo 9.01 64-bit"]
[Result "1-0"]
[TimeControl "40/4800"]
[Annotator "16. +0.57 15... -0.14"]

1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 Nc6 8.
Qd2 O-O 9. Bc4 Bd7 10. O-O-O Ne5 11. Bb3 Rc8 12. Kb1 Re8 13. h4 h5 14. Bg5
Rc5 15. Bh6 b5 {-0.14/26 1:28} 16. g4 {+0.57/32 3:59} hxg4 {-0.49/27 3:04}
17. h5 {+0.72/33 0.1} Nxh5 {-0.49/28 4:27} 18. Rdg1 {+0.53/35 9:51} Kh7
{-0.33/25 4:05} 19. Bxg7 {+0.81/32 3:26} Kxg7 {-0.83/27 2:22} 20. f4
{+1.28/31 22} b4 {-0.60/26 1:30} 21. Nd5 {+1.79/33 4:55} e6 {-1.58/29 1:15}
22. Ne3 {+1.80/36 1:54} Nxf4 {-1.33/28 30} 23. Nxg4 {+1.97/37 3:03} Nxg4
{-1.59/29 6} 24. Qxf4 {+1.94/39 3:09} Qf6 {-1.61/32 39} 25. Qxd6
{+2.04/38 2:54} Qe7 {-1.66/31 1:01} 26. Qxe7 {+1.99/36 1:32} Rxe7
{-1.66/32 1:11} 27. Rxg4 {+2.01/35 1:27} a5 {-1.65/32 1:11} 28. a3
{+2.16/34 2:03} bxa3 {-1.71/29 10} 29. bxa3 {+2.03/34 3:21} a4
{-1.66/30 1:05} 30. Ba2 {+2.11/34 3:48} Bc8 {-1.72/29 4:53} 31. Rgh4
{+2.22/34 0.1} Rec7 {-1.79/29 4:58} 32. R1h2 {+2.39/35 1:46} Kf6
{-1.95/28 6:52} 33. Kb2 {+2.40/34 5:32} Rb7+ {-2.04/27 7:25} 34. Kc1
{+2.75/38 1:54} Rbc7 {-2.18/31 6:31} 35. Re2 {+2.77/38 3} g5
{-2.25/32 10:20} 36. Rg4 {+2.88/36 7:12} Kg6 {-2.20/33 15} 37. Reg2
{+2.87/39 6:38} Ra5 {-2.27/33 4:21} 38. e5 {+3.02/39 0.1} Rxe5
{-2.27/32 1:58} 39. Nf3 {+3.06/39 2:47} Ra5 {-2.32/33 1:23} 40. Nxg5
{+3.05/37 4:49} Kf6 {-2.36/34 57} 41. R2g3 {+2.99/39 2:18} Rf5
{-2.37/33 4:40} 42. Nh7+ {+3.06/39 0.1} Ke7 {-2.43/31 2:04} 43. Rxa4
{+3.08/35 1:52} Bd7 {-2.51/33 4:02} 44. Rb4 {+2.90/34 14} Rcc5
{-2.49/32 2:50} 45. Bb3 {+3.17/37 12:14} Bb5 {-2.57/32 3:57} 46. Kb2
{+3.33/37 4:13} Bc6 {-2.58/33 4} 47. a4 {+3.32/33 3:56} Ra5 {-2.61/31 5:09}
48. Ka3 {+3.44/33 2:51} Bb5 {-2.81/28 7:40} 49. Rg8 {+3.87/35 2:17} Bc6
{-3.12/31 3:51} 50. Rb6 {+4.15/35 2:46} Bd5 {-3.45/29 3:18} 51. Kb4
{+4.43/34 2:27} Ra7 {-3.48/26 1:04} 52. c4 {+4.51/34 1:09} Rf4
{-3.59/28 4:17} 53. Rbb8 {+4.82/36 3:24} Be4 {-3.82/30 2:58} 54. Rge8+
{+5.08/36 40} Kd6 {-3.78/29 1:06} 55. Ng5 {+5.08/36 1:48} Bc6
{-3.74/26 2:37} 56. Rec8 {+4.91/35 0.1} Bg2 {-3.92/27 4:04} 57. a5
{+5.27/33 2:26} Rf5 {-4.19/27 2:25} 58. Rb5 {+5.50/32 1:58} Rf1
{-4.34/26 44} 59. Rb6+ {+5.69/31 1:22} Ke5 {-4.21/23 44} 60. Rf8
{+5.87/32 1:10} Kd4 {-4.83/25 51} 61. a6 {+6.12/34 1:06} Rf5
{-5.23/26 3:36} 62. Rg8 {+6.44/34 1:49} Rf2 {-5.58/27 1:51} 63. Rg7
{+6.91/34 2.9} e5 {-5.70/26 1:39} 64. Ne6+ {+7.44/33 14} Ke3
{-5.28/24 1:34} 65. Nc5 {+7.50/33 4:30} Ba8 {-5.32/24 59} 66. Kb5
{+7.85/31 1:50} Rf5 {-5.65/25 2.8} 67. Rb7 {+12.48/33 2:02} Rxa6
{-7.58/25 1:21} 68. Kxa6 {+13.75/34 1:11} Kd4 {-8.32/26 12} 69. Rc7
{+20.75/35 1:50} Rf1 {-8.92/25 10} 70. Kb5 {+65.61/41 1:37} f5
{-11.56/28 55} 71. Rg3 {+99.55/42 1:34} e4 {-28.50/27 5:05} 72. Ne6+
{+99.79/62 0.1} Ke5 {-37.36/24 3:41} 73. Rg6 {+99.81/67 0.1} e3
{-99.40/20 32} 74. Bc2 {+99.83/74 1:40} Rd1 {-99.50/19 10} 75. Rc5+
{+99.85/81 1:35} Bd5 {-99.86/22 5} 76. Bxd1 {+99.87/110 1:34} e2
{-99.88/45 5} 77. Rxd5+ {+99.89/127 25} Ke4 {-99.90/65 0.2} 78. Bxe2
{+99.91/127 0.8} f4 {-99.92/99 2.0} 79. Ng5+ {+99.93/127 0.4} Ke3
{-99.94/99 0.1} 80. Bd1 {+99.95/127 0.1} f3 {-99.96/99 0.1} 81. Nh3
{+99.97/127 0.1} Ke4 {-99.98/99 0.1} 82. Re6# {+99.99/127 0.1}
{Xboard adjudication: Checkmate} 1-0
[/pgn]

[pgn]
[Event "Computer Chess Game"]
[Site "puppy"]
[Date "2015.06.26"]
[Round "2"]
[White "Komodo 9.01 64-bit"]
[Black "Stockfish 6 64 POPCNT"]
[Result "0-1"]
[TimeControl "40/4800"]
[Annotator "16. +0.50 15... -0.41"]

1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 Nc6 8.
Qd2 O-O 9. Bc4 Bd7 10. O-O-O Ne5 11. Bb3 Rc8 12. Kb1 Re8 13. h4 h5 14. Bg5
Rc5 15. Bh6 Nc4 {-0.41/33 9:56} 16. Bxc4 {+0.50/27 3:38} Rxc4
{-0.23/32 0.1} 17. Bxg7 {+0.37/27 4:49} Kxg7 {-0.38/30 4} 18. Nd5
{+0.26/28 12:25} e5 {-0.21/40 0.1} 19. Nxf6 {+0.33/29 6:24} Qxf6
{-0.16/35 43} 20. Nb3 {+0.27/32 2:47} Rec8 {-0.19/35 40} 21. Qxd6
{+0.25/28 26} Be6 {-0.16/36 5:23} 22. c3 {+0.23/30 2:39} b5 {-0.21/36 4:26}
23. Rd2 {+0.27/29 3:42} R4c6 {-0.16/35 0.1} 24. Qd3 {+0.24/28 1:07} a6
{-0.16/37 4:16} 25. Qe3 {+0.31/28 3:20} Qe7 {+0.00/40 5:18} 26. g4
{+0.16/31 3:18} hxg4 {+0.30/33 4:04} 27. h5 {-0.11/28 3:04} Rh8
{+0.17/37 4:05} 28. fxg4 {-0.11/31 1:22} Bxg4 {+0.87/31 2:35} 29. h6+
{-0.11/31 1:08} Kh7 {+0.88/33 1:34} 30. Rg1 {-0.11/30 3:16} Be6
{+1.07/33 2:51} 31. Qg3 {-0.11/34 21} Qc7 {+0.97/33 3:04} 32. Nc1
{-0.27/28 3:50} Re8 {+1.24/33 1:55} 33. Qf3 {-0.36/26 4:18} a5
{+1.43/33 7:43} 34. Rf2 {-0.66/26 4:01} Rd6 {+1.46/31 3:02} 35. Nd3
{-0.67/24 2:18} Qc4 {+1.44/33 3:35} 36. Nc1 {-0.47/27 33} Red8
{+1.56/36 2:03} 37. Re1 {-0.80/24 2:13} Qc7 {+1.80/33 6:03} 38. c4
{-0.99/25 3:08} Qc5 {+1.65/33 2:33} 39. Qf6 {-1.36/25 2:43} Rg8
{+1.84/35 1:46} 40. Nb3 {-1.65/28 1:03} Qb4 {+1.59/36 51} 41. Ref1
{-1.37/30 5:45} Qxc4 {+1.91/39 0.1} 42. Qxe5 {-1.44/30 2:43} Qd3+
{+1.94/37 41} 43. Ka1 {-1.50/32 6:18} Rd7 {+1.86/39 4:03} 44. Rc1
{-1.55/31 1:17} Bxb3 {+2.17/38 2:27} 45. axb3 {-1.79/31 17} Qxb3
{+1.89/39 2:23} 46. Rff1 {-1.94/31 5:13} a4 {+2.41/39 11:05} 47. Rc7
{-2.07/32 0.1} Rd1+ {+2.30/37 2:19} 48. Rxd1 {-2.06/31 1:29} Qxd1+
{+2.24/38 1:19} 49. Ka2 {-2.14/31 50} Qb3+ {+2.00/37 4:36} 50. Ka1
{-2.22/31 1:46} a3 {+2.29/37 36} 51. bxa3 {-2.29/28 2:03} Qxa3+
{+2.41/35 1:51} 52. Kb1 {-2.40/28 1:29} Qb3+ {+2.60/33 1:22} 53. Kc1
{-2.39/27 1:34} Qf3 {+2.50/35 4:16} 54. Kc2 {-2.50/29 3:12} b4
{+3.12/35 3:35} 55. Kb2 {-2.52/29 44} Qa3+ {+3.08/34 2:03} 56. Kb1
{-2.74/28 5:11} Qd3+ {+3.38/36 32} 57. Kb2 {-2.90/25 12} Qf3
{+3.03/34 4:36} 58. Qe7 {-3.11/27 2:33} Qa3+ {+4.00/34 0.1} 59. Kc2
{-3.33/28 1:46} Qa2+ {+4.55/34 0.1} 60. Kc1 {-3.44/28 2:07} Qa1+
{+4.05/34 2:47} 61. Kd2 {-3.55/26 1:22} Kxh6 {+4.65/33 1:55} 62. Qd6
{-3.91/28 1:21} Qf1 {+5.58/35 2:44} 63. Qh2+ {-4.26/29 1:10} Kg5
{+4.65/34 2:07} 64. Qg3+ {-4.45/29 1:10} Kh5 {+5.36/36 21} 65. Rc5+
{-4.54/28 1:42} f5 {+6.08/36 0.1} 66. Ke3 {-4.78/29 2:10} Re8 {+12.03/42 8}
67. e5 {-5.13/33 1:33} Rd8 {+17.42/40 26} 68. Qf3+ {-9.42/34 1:47} Qxf3+
{+44.99/45 10} 69. Kxf3 {-9.42/34 6:31} Rd3+ {+56.00/54 0.1} 70. Kf2
{-10.61/29 2:05} f4 {+81.59/48 2:37} 71. Rc4 {-23.57/28 4:54} g5
{+109.02/49 4:17} 72. e6 {-26.98/29 0.1} b3 {+89.42/45 6:28} 73. Rc7
{-77.77/30 0.1} Re3 {+99.25/43 1:15} 74. Rb7 {-32.26/24 58} g4
{+99.35/42 1.7} 75. Rh7+ {-32.41/26 4:22} Kg6 {+99.47/48 0.1} 76. Rd7
{-45.82/26 2:13} g3+ {+99.69/52 1:21} 77. Kg2 {-99.62/21 0.1} b2
{+99.71/55 1:44} 78. Rb7 {-99.66/22 0.1} Re2+ {+99.73/54 1:31} 79. Kf3
{-99.70/22 0.1} g2 {+99.75/55 1:39} 80. Kxe2 {-99.66/19 8} g1=Q
{+99.77/60 1:32} 81. e7 {-99.74/21 2:01} Kf7 {+99.79/67 43} 82. e8=Q+
{-99.78/22 25} Kxe8 {+99.81/85 3:05} 83. Rb8+ {-99.80/24 2:45} Kd7
{+99.83/89 0.1} 84. Kf3 {-99.82/21 22} b1=Q {+99.85/93 2:21} 85. Rxb1
{-99.86/27 20} Qxb1 {+99.87/85 1:39} 86. Ke2 {-99.88/43 2.4} Ke6
{+99.89/83 2:08} 87. Kd2 {-99.90/98 19} Kd5 {+99.91/92 2:44} 88. Ke2
{-99.92/99 0.1} Ke4 {+99.93/127 7} 89. Kf2 {-99.94/99 0.1} Qb2+
{+99.95/127 0.1} 90. Ke1 {-99.96/99 0.1} Ke3 {+99.97/127 0.1} 91. Kd1
{-99.98/99 0.1} Qb1# {+99.99/127 0.1}
{Xboard adjudication: Checkmate} 0-1
[/pgn]
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: creating an opening book

Post by zullil »

Dann Corbit wrote:
jdart wrote:
no, it does not have that opening
Well, your game is interesting too, and the Anti-Meran Gambit is a good example of an opening you don't want to go into without book knowledge (and I don't mean a 15-ply search).

--Jon
I am going to have to delve into your opening position more deeply.
My analysis only goes to 38 plies, but I have Qc8 as best:

[d]3qr1k1/pp1bppb1/3p1npB/2r1n2p/3NP2P/1BN2P2/PPPQ2P1/1K1R3R b - - acd 38; acs 1891; bm Qc8; cce -72; ce -29; pm Bh8 {94} Qa5 {54} b5 {37} Nc4 {33} Bxh6 {8} Qb6 {7} Qc7 {3} Qc8 {1}; pv Qc8 Bxg7 Kxg7 Nd5 Nxd5 Bxd5 Nc4 Bxc4 Rxc4 Ne2 Be6 b3 Rc5 Nf4 Rh8 Nd3 Rc7 Rdg1 b6 Nf4 Rc5 c4 f6 Nd3 Rc7 g3 Kf7 Nf4 Rc5 Qb2 Bd7 Rc1 Be6 Rh2 Kg7 Qd2 Bd7 Rhh1 Be6 Rhg1 Kf7; white_wins 123; black_wins 85; draws 25;
Latest Stockfish switches to Nc4:

Code: Select all

info depth 46 seldepth 68 multipv 1 score cp -18 nodes 251064643344 nps 23568804 hashfull 999 tbhits 0 time 10652413 pv e5c4 b3c4 c5c4 h6g7 g8g7 c3d5 e7e5 d4b3 d7e6 d5f6 d8f6 d2d6 e8c8 c2c3 c4c6 d6d3 f6e7 d3e3 b7b5 g2g4 c8h8 g4h5 h8h5 d1g1 b5b4 c3b4 e7b4 g1g5 e6b3 a2b3 b4b6 e3b6 a7b6 b3b4 c6f6 h1h3 f6f4 g5g4 f7f5 e4f5 h5f5 g4f4 f5f4 h4h5 g6g5 h5h6 g7h7 h3h5 f4f3 h5g5 f3e3 b1c2 e3e2 c2d3 e2b2
flok

Re: creating an opening book

Post by flok »

Is using someone else's chess engine (eg stockfish) to create an opening book considered creating?
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: creating an opening book

Post by Ferdy »

flok wrote:Is using someone else's chess engine (eg stockfish) to create an opening book considered creating?
As long as "to create" and "creating" is similar :).
flok

Re: creating an opening book

Post by flok »

Ferdy wrote:
flok wrote:Is using someone else's chess engine (eg stockfish) to create an opening book considered creating?
As long as "to create" and "creating" is similar :).
Damned auto-correct!

What I mean is: Is using someone else's chess engine (eg stockfish) to create an opening book considered cheating?
mvk
Posts: 589
Joined: Tue Jun 04, 2013 10:15 pm

Re: creating an opening book

Post by mvk »

flok wrote:What I mean is: Is using someone else's chess engine (eg stockfish) to create an opening book considered cheating?
The output of an algorithm, for example a compiler's sequence of instructions, the tables of a PST generator or an algorithm's move in some positions, can normally not be protected by intellectual property rights (copyright, patents, trademarks). But there are exceptions, such as artwork in games. The tournament organizer can always make additional rules.

In the CSVN rules for example it is ok, provided the book is legal (of course... that means "not pirated" here), and you mention the book's origin in your tournament application (rule 7).
[Account deleted]
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: creating an opening book

Post by Ferdy »

flok wrote:
Ferdy wrote:
flok wrote:Is using someone else's chess engine (eg stockfish) to create an opening book considered creating?
As long as "to create" and "creating" is similar :).
Damned auto-correct!

What I mean is: Is using someone else's chess engine (eg stockfish) to create an opening book considered cheating?
Stockfish is free, that is not cheating.
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: creating an opening book

Post by syzygy »

flok wrote:What I mean is: Is using someone else's chess engine (eg stockfish) to create an opening book considered cheating?
What do you mean by "cheating"?

If you tell your wife (or husband) that you created an opening book using your own mental analysis, but you secretly used Stockfish, then you are cheating on your wife (or husband). And on yourself.

I don't really see any other way in which creating an opening book by whatever means could be considered "cheating". (OK, copying an existing one and calling it your own would be wrong.)

Selecting moves from GM games and adding them to your book? Completely fine.
Selecting moves from SF games and adding them to your book? Completely fine.
Using any engine to analyse a move and add it to your book? Completely fine.
Ferdy wrote:Stockfish is free, that is not cheating.
I'm not sure what difference it makes that SF is free (whether as in beer or as in GPL).
flok

Re: creating an opening book

Post by flok »

Just to be clear: I'm not using the stockfish book (is there any?) but am using stockfish to create it (as I describer: my own program selects the positions to calculate and stockfish then calcs the score for it)
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: creating an opening book

Post by Ferdy »

syzygy wrote:
Ferdy wrote:Stockfish is free, that is not cheating.
I'm not sure what difference it makes that SF is free (whether as in beer or as in GPL).
Time will come that an engine will be able to determine the result of the position (W/L/D) on most positions including positions in the early phase of the game. If that engine is free, it is all right everybody has access.