Wednesday, December 30, 2015

New books published

http://www.fam-petzke.de/cp_download_en.shtml

The mentioned new books for iCE version 1, 2 and the soon coming version 3 are now online. They can be downloaded from my website.




Tuesday, December 29, 2015

New books for iCE

I finally extended my book building framework to include iCE performance data for certain lines. In the past the database just consisted of lines played by strong programs. Lines that were played successfully more often received a higher chance to be selected in game play.

I now added win/draw/loss statistics that I collected when two similar versions of iCE played each other. For the starting position it now looks like this


FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
EndGame Id: UNKNOWN

Played moves :

DataBase Content:

No    Move      Prob     Played     Perf %    Wins      Draws     Losses
------------------------------------------------------------------------
 1    e2e4      44       38.031     51.59    25.021    41.387    22.208
 2    d2d4      41       36.392     53.22    24.494    40.629    19.076
 3    c2c4       8        7.283     53.06     8.104    13.541     6.388
 4    g1f3       6        5.019     52.99     8.173    13.948     6.463
 5    g2g3       1          487     51.69       989     1.543       874
 6    b2b3       0          298     51.93       250       417       216
 7    b2b4       0          281     45.18        18        39        26
 8    f2f4       0          275     45.80       116       259       161
 9    b1c3       0          201     50.78       105       182        99
10    c2c3       0          132     75.00         7         4         1
11    e2e3       0          124     56.00        25        34        16
12    g2g4       0           13      0.00         0         0         0
13    d2d3       0           12     56.82         7        11         4
14    a2a3       0            3     42.65         6        17        11
15    h2h3       0            2      0.00         0         0         0
16    f2f3       0            1      0.00         0         0         0
17    a2a4       0            1      0.00         0         0         0

Book Content:

No    Move      Prob
--------------------
 1    e2e4      44
 2    d2d4      41
 3    c2c4       8
 4    g1f3       6
 5    g2g3       1


When we dive into one line, eg the sicilian after 1. e4 c5 we come to

FEN: rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2
EndGame Id: UNKNOWN

Played moves : e2e4 c7c5

DataBase Content:

No    Move      Prob     Played     Perf %    Wins      Draws     Losses
------------------------------------------------------------------------
 1    g1f3      86       12.764     51.21     9.042    14.326     8.279
 2    b1c3       6          981     48.10       925     1.713     1.066
 3    c2c3       6          935     52.21       678     1.295       566
 4    g1e2       1          184     49.87        97       181        98
 5    g2g3       1           88     45.18        27        49        38
 6    f2f4       0           74     46.33       108       239       144
 7    b2b3       0           71     46.18        63       116        83
 8    d2d4       0           53     43.94        29        58        45
 9    d2d3       0           51     46.33        92       157       119
10    c2c4       0           33     38.10         2        12         7
11    a2a3       0           17     44.64         8         9        11
12    b2b4       0           15     37.50         1         4         3
13    f1c4       0           10     25.00         0         1         1
14    b1a3       0            9     55.92        23        39        14

Book Content:

No    Move      Prob
--------------------
 1    g1f3      93
 2    c2c3       7


The database shows that the move 2. Nc3 is a common variation but iCE scores less than 50% with it, which is a bad score for white. So this move is now no longer copied into the book. If however iCE is playing black and the opponent selects this move it still knows how to continue

FEN: rnbqkbnr/pp1ppppp/8/2p5/4P3/2N5/PPPP1PPP/R1BQKBNR b KQkq - 1 2
EndGame Id: UNKNOWN

Played moves : e2e4 c7c5 b1c3

DataBase Content:

No    Move      Prob     Played     Perf %    Wins      Draws     Losses
------------------------------------------------------------------------
 1    b8c6      65          566     51.30       555       862       505
 2    d7d6      22          192     52.18       383       601       326
 3    e7e6       9           77     52.51       145       253       119
 4    a7a6       2           18     48.60        40        93        45
 5    g7g6       2           17     50.00        18        37        18
 6    b7b6       0            2      0.00         0         0         0
 7    g8f6       0            1      0.00         0         0         0

Book Content:

No    Move      Prob
--------------------
 1    b8c6      65
 2    d7d6      22
 3    e7e6       9
 4    a7a6       2
 5    g7g6       2


 I think it makes sense to build the books this way, it probably does make a difference ELO wise but anyway as a human I try to avoid lines I don't feel comfortably with also.


Monday, December 14, 2015

Oh, very clever, Worf. Eat any good books lately?

Problematic position from the two knights defence - the book lists two correct moves again

As the YAT tournament revealed some problems with the old opening books of iCE I put opening books at the top of my todo list. The code is very old, more than 3 years and goes back to version 0.3. iCE was here available only as 32 bit program with an estimated strength of 2460 ELO.

So it was time to modernize that anyway.

I decided not only to fix the illegal moves (related to changes in en passent handling between version 0.3 and 2.0) but to rebuild the books. I also want to tailor the books towards iCE's playing style.

What does this mean?

A human chess player will play openings that lead to positions that he is comfortable with, like positions full of tactics if he is skilled tactical player or quiet ones if he is not. He will avoid openings were he struggles. The books of iCE don't handle that. The probability that a move is selected from the list of possible moves only depends on the probability that with this move a game played by strong engines later was won. It ignores the playing style of iCE as this information currently is just not present.

I plan to extend the data structure of the book building framework to store move performance data of iCE and use this performance data in the book building process.


I don't expect a huge impact on playing strength but it seems like the proper way to do it and is much more interesting than tuning values to death.
And as holidays are coming I will find some time to do it, hopefully.



Monday, December 7, 2015

Opening Book Struggle



In Ed Schroders YAT tournament iCE experienced an unexpected program termination, which is the euphemistic way of saying it damn crashed. First I though it might be related to my implementation of the permanent brain protocol which contains a known bug in version 2  release 2240. But it wasn't.

iCE did crash while playing book moves in the Two knights defence, which is an opening that I know to a certain extent as I recently taught my sons the Lolli Attack lines (which I prefer over the Fried Liver attack). At the 11th move the only book move (100%) was the en passent capture 11... exd3 and here it crashed.

Problem was that the book was build for version 0.3 of iCE and never changed. However I did change the internal structure how iCE stores chess moves later on. The bit positions that indicate an en passent capture and those that indicate a promotion were changed. Now the move that iCE finds in the book has an invalid structure if it is an en passent capture or promotion. Fortunately promotions are not so common in the opening but ep captures seem at least to be common enough to show up.

So I have to change my book building code and rebuild the books to fix that which is not a quick fix. I have to live with the problem for the YAT tournament and hope that iCE will not chose a lot of erroneous lines.

But fixing the book code made it at the top of my todo list. I'm happy to have learned about this problem before I release version 3 of iCE which I intend to do early next year.