Monday, September 30, 2019

To study openings part 3

Some people think chess must be doing great in Belgium as the new national champion Daniel Dardha is only 13 years old. However one swallow doesn't make a summer. If we look at other Belgian children below 14 then Daniel is 450 elo higher rated than the second one. We can't expect that Belgium will become a strong chess-county anytime soon based on just one very talented boy.

We lack well organised training-facilities for our Belgium youth to maximize their potential. There are many small initiatives which are mainly around a bunch of lower rated volunteers doing a tremendous job but that is not sufficient at all to fulfill all the requests. Many children live too far or simply are not aware about the existence of the classes. Besides those classes mainly consist of a basic training using the step-method (often only a few of them). It is a nice start but they lack practical knowledge of how to play a competitive game.

Mainly parents of foreign origin question regularly those training-methods. We have a lot of youth in Belgium with such parents (see memory) so naturally they compare between countries. Last I heard a father with Indian roots telling a coach that in his birth-country they start with endgames instead of immediately teaching tactics on a board full of pieces.

I think this is a clever remark from him as there are indeed many advantages to focus first at endgames. As there are less pieces on the board, it becomes much more easy to see the tactics. Also you get immediately a good feeling of how the pieces relate to each other in terms of value. Finally an advantage in an endgame is often more clear so it becomes more simple to distinguish wrong from right. 

However another recurrent critic I often get is that endgames are boring. Here we see the difference in life-philosophy between people of different origin. In Western countries we believe fun should be given absolute priority so we let children play as freely as possible. However in Eastern countries the educative aspect of chess is considered as the prime-goal. I see many immigrants force their children to play chess as they think it is important for their intellectual development. Fun is rather irrelevant which sometimes creates some sad situations in the class when children tell the chess-teacher that they don't like chess at all but are forced to sit and wait till the class has finished.

I think most people agree about openings that it makes no sense to learn streams of moves at beginners. It is enough to know how to develop pieces, occupy the center with one or more pawns and castle to bring the king into safety. You often hear about children spending too much time at openings while other facets of the game still contain big gaps. It would be much more efficient to focus first at those weak aspects of the game. So it makes definitely sense not to teach any openings during the methods of steps.

Therefore sometimes young players till even a rather high level know very little about openings. From which rating onward should we start looking at openings? Is it ok as 2200 elo rated player still not having any theoretical knowledge of the played variations? There exist indeed such type of +2200 elo players which just play openings based on common sense only (I am thinking of e.g. the phenomenon Ashote Draftian is Flemish champion).

In my article how many games should I play published earlier this year I clearly demonstrated with some examples from the chess-literature that studying openings in an important part of reaching masterlevel. Between a beginner and a candidate-master there is easily 1000 elo but from somewhere in middle (+-1800) I think it does make sense to slowly start building a repertoire. By the way I heard something similar recently from the Belgian IM Tom Piceu. Also he advised an ambitious +1800 player to start working at a repertoire when it appeared he was lacking any basic knowledge of the openings he was playing.

Nevertheless I was a couple months ago shocked to find out the repertoire of the British grandmaster Daniel Howard Fernandez. Daniel plays just like Vladimir Epishin a very wide range of openings (see my article jubilee) but there exists a big gap of concrete opening-knowledge between them. I had the impression of Vladimir that he is very familiar with his openings contrary to Daniel seeming to play just something which is often total nonsense. It is a mystery how you can become a grandmaster with such repertoire. Well he is tactically extremely strong so I guess that probably largely compensates it. Still I don't understand why he doesn't want to work more at his openings when you clearly have a lot of talent. In our mutual game of the past Open Gent I decided therefore to avoid as much as possible any murky positions containing lots of tactics.
[Event "Open Gent 5de ronde"] [Site "?"] [Date "2019.??.??"] [Round "?"] [White "Brabo"] [Black "Fernandez, D."] [Result "1/2-1/2"] [ECO "B06"] [WhiteElo "2306"] [BlackElo "2466"] [PlyCount "106"] [EventDate "2019.??.??"] [CurrentPosition "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"] 1. e4 g6 2. d4 Bg7 3. Nf3 d6 4. Nc3 a6 5. Be2 Nd7 6. O-O c5 {(In 2014 I already once got e6 on the board from the German international master Haub Thorsten whom meanwhile became a grandmaster.)} 7. Be3!? {(I was out book but I did recognize that this position looks very similar to a line from the Najdorf. In that variation Be3 is strong which is also the case here. Beside Be3 there are other interesting alternatives to play for an advantage like a4, dxc5 and Bg5.)} 7... b5?! {(I noticed while preparing the game that my opponent has a very creative style of playing the opening. He likes to avoid very quickly the mainlines. I assume Daniel knew cxd4 is here the standard move but preferred to make sure I would have to play a fresh position without help. Anyway b5 is a very risky novelty.)} (7... cxd4! 8. Bxd4 Ngf6!? 9. a4 O-O 10. a5 Qc7) 8. dxc5 Nxc5 9. e5!? {(The engines choose a different path to keep the advantage.)} (9. Bxc5!? Bxc3 10. bxc3 dxc5 11. Qxd8+ Kxd8 12. a4 bxa4 {(The 2 black a-pawn will soon drop. Also whites pieces are much more active.)}) 9... Bb7 10. exd6 Qxd6 11. Qxd6?! {(I couldn't calculate the complications after a4 at the board. After Qxd6 my advantage decreases but I do avoid the tactics in which my opponents excells.)} (11. a4! b4 12. Na2 Bxb2!? 13. Rb1 Nxa4!? 14. c4 Nc3 15. Qc2 Nxb1?! 16. Qxb2 Nc3!? 17. Nxc3 bxc3 18. Qxb7 +-) 11... exd6 12. Rad1 O-O-O 13. Bd4 Bxd4 14. Rxd4 Ne7 15. a3 h6 16. Rfd1?! {(I don't take any risks. I choose only solid moves but this allows black to equalize.)} (16. a4! Nc6!? 17. Rf4 b4 18. Nd5 Rhe8 19. Re1 Nxa4 20. Rxf7! Nxb2 21. Rc7+ Kb8 22. Bxa6 {[%eval 73,38]}) 16... Kc7?! {(The logical defense but black has a more dynamic and stronger possibility.)} (16... Rhe8! 17. Rxd6!? Rxd6 18. Rxd6 Nd5 19. Kf1 Nxc3 20. bxc3 Ne4 21. Rd3) 17. R4d2?! {(I keep playing it safe. Again a4 is sharper.)} 17... Nf5 18. Nd4 Nxd4 19. Rxd4 Rhe8 20. Kf1 Re5 21. f4 Re6 22. g3 g5 23. Kf2 Rf6?! {(Black is a professional and he obviously plays for a win against an amateur rated 200 points lower. With Rf6 black tries to create some tension but this is again very risky.)} 24. Bf3 gxf4 25. gxf4?! {(I captured back automatically but hereby I miss the possibility to show the defect of black's 23rd move.)} (25. g4! Bc6 {(Contrary to the game Ne6 doesn't work now.)} 26. Bxc6 Kxc6 27. Nd5 Re6 28. Rxf4 Rf8 {(Material is equal but the scattered pawns give white definitely the better chances.)}) 25... Ne6 26. Bxb7 Kxb7 27. Rxd6 Rxf4+ {(I saw this intermediate move too late. From now onward I have to defend.)} 28. Ke3 Rxd6 29. Rxd6 Rh4 30. Rd7+ Kc6 31. Rxf7 Rh3+ 32. Rf3 Rxh2 33. Rf6 {(I had almost played the losing blunder which Daniel had tried to provoke with 31...Rh3+.)} (33. Ne2?? Rxe2+ 34. Kxe2 Nd4+ 35. Ke3 Nxf3 36. Kxf3 {(Black's h-pawn decides the game easily.)} 36... Kd5 37. Ke2 h5 38. Kf2 Kd4 39. Ke2 h4 40. Kf3 h3 41. Kf2 h2 42. Kg2 Ke3 43. b3 Kd4 {(Of course not Kd2 as then white would even win with c4.)} 44. c4 bxc4 45. bxc4 Kxc4 46. Kxh2 Kb3 47. Kg3 Kxa3 48. Kf3 Kb2 49. Ke3 a5 50. Kd3 a4 -+) 33... Kd6 34. Ne2 Ke5 35. Rf7 Rh3+ 36. Kf2 Ng5 37. Re7+ Kf5 38. Kg2 Kg4 39. Rd7 Re3 40. Kf2 Rf3+ 41. Kg2 Rf6 42. Rd4+ Kf5 43. Ng3+ Ke5 44. Rd2 Ne4 {(Daniel sees no progress so tries his luck in the rook-endgame. I would've waited still a bit as now it becomes easy to draw.)} 45. Nxe4 Kxe4 46. Re2+ Kd4 47. Rd2+ Kc4 48. Re2 Rd6 49. Kf3 a5 50. Rh2 {(I have achieved the most optimal position. My rook attacks the h-pawn and can also give checks horizontally. It is no surprise that black starts repeating the moves to conclude the draw.)} 50... Rf6+ 51. Ke3 Re6+ 52. Kd2 Rd6+ 53. Ke3 Re6+ 1/2-1/2
I exit the opening with a large advantage but played it a bit too safe to keep it. I did manage to keep the position simple although that almost wasn't sufficient either to achieve the desired draw.

You would expect that such repertoire wouldn't stand a chance against stronger players. I also thought so until he blew our Belgian top-player Bart Michiels from the board with an awful opening. Black extracted a big advantage from the opening but in the middlegame got tactically completely outplayed. This clash eventually decided that Daniel later became the tournament-winner.
[Event "42nd Eastman Open 2019"] [Site "Ghent BEL"] [Date "2019.07.22"] [Round "6.1"] [White "Fernandez, Daniel Howard"] [Black "Michiels, Bart"] [Result "1-0"] [ECO "A03"] [WhiteElo "2466"] [BlackElo "2563"] [PlyCount "63"] [EventDate "2019.07.20"] [CurrentPosition "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"] 1. f4 d5 2. b3 Nf6 3. Bb2 Bf5 4. Nf3 e6 5. e3 h6 6. h3 a5 {(After just 6 moves we already have an unknown position. At least I haven't found any game with this position in any database I possess.} 7. g4 Bh7 8. Bxf6 {(If somebody still was familiar with the position then he surely won't be anymore after this move. This exchange is horrible as white weakens all the black squares. Stockfish shows -1,3 for black.)} 8... Qxf6 9. d4 a4 10. bxa4 g5 11. fxg5 hxg5 12. Bd3 Bd6? {(With this logical development black loses his advantage. Nd7 with the idea of a quick e5 is much stronger.)} 13. Ke2 {(It is unbelievable that white will win from this position in less than 20 moves against a 100 points higher rated colleague-grandmaster while no clear blunder happened.)} 13... Nd7 14. Bxh7 Rxh7 15. c4 dxc4 16. Nbd2 Qg6? {(Bart doesn't play sufficiently active. Searching counterplay with e5 is more appropriate here.)} 17. Nxc4 Ke7 18. Qb1 Qxb1 19. Rhxb1? {(Also Daniel doesn't always play faultless. Here Rab1 is much stronger.)} 19... Rxh3 20. Nxg5 Rh2+? {(Bart must have missed something tactically as after Rh4 the position is still balanced.)} 21. Kd3 Ra7 22. Ne4 Nf6?! {(Stockfish already considers the position lost for black after this move. Daniel has indeed few problems to show black's pieces lack coordination.)} 23. Nxf6 Kxf6 24. a5 Bf8 25. Rb5 Rf2 26. a4 Bh6 27. Rh1 Kg6 28. Rhb1 b6 29. Ne5+ Kh7 30. Rh1 f6 31. Nc6 Ra6 32. Rbh5 {(Mate in 9 is already shown on my screen. It is absurd how black's pieces are positioned especially if you know in which position we started 20 moves ago and black is nonetheless a very experienced and strong player.)} 1-0
If you would like to play like Daniel then think twice before giving up studying openings. Daniel started to play chess at a very young age (in 2004 -9 British champion) and has traveled continuously around the world (Singapore, Australia, Europe, ..) He clearly got hardened by this tough life. So copying his approach to chess successfully seems very unlikely to me.


Thursday, September 19, 2019

Testing chess-engines

Till a couple of months ago I never bothered about testing chess-engines. I didn't see any value in it. I would never be able to achieve the same quality as the results CCRL publishes weekly. Besides such work is not cheap as you need to invest into hardware, electricity, floorspace,... On top most of those games played by engines are pretty boring. You better watch games of humans to see drama and creativity.

However as I mentioned in my last article, I had an open question for Leela. CCRL nor other sites give me an answer about how strong Leela would be in comparison with the classical engines when both use exactly the same type of hardware. That is a problem for me. I can install for free Leela on my PC but I only want to use it for analysis if I know the engine is one of the 2 strongest ones I possess. I am using that rule already for a very long time see my article of 2012 about how I analyze. Maybe some will consider this a bit silly but it assures me that my opponents will likely not have any better analysis.

So in the end I decided to do the testing myself. Then the next question is of course how to do this job quickly, accurately and as cheap as possible. I could use a set of puzzles but that is only one aspect of an engine. I rather prefer the engine to be tested by playing games but I can't/ don't want to miss my hardware for several months. A good compromise was found in a rapidmatch with the rate of 15 minutes + 10 seconds increment over 100 games. That should give a good indication of the playing-strength. At stake was a place in my top 2 engines so logically I chose Komodo 11 as its opponent for the match.

Then the next question is what do we decide about the openings. Do we give the engines full liberty of choice or do we select a number of positions which need to played out once from each side as TCEC does? The free choice is as we humans play our games but there are some disadvantages to that. The engines will likely play openings which are not part of my repertoire. The risk exists that they play very safe and we get an abundance of draws. Finally Leela will without an openingbook play almost exclusively the same moves in the opening so you risk to see several times the same opening/ game.

Therefore I preferred to let the engines start from a pre-defined set of openings. Which openings to choose is then the next logical question. It didn't take me long to find a good answer for it. I created a new database and injected a selection of 50 recently played games of myself. Next I removed in all games the moves beyond the 10th. The few duplicates which I got, were swapped by selecting a few other of my games. The final result was a nice mix of 50 positions in which some of them the balance was already broken. This way I avoided a too high number of draws. Besides the engines will only play openings which have occurred before in my practice which makes it of course more fun to watch the match.

Finally everything was ready. Via Fritz I activated the window to initialize the match as obviously I wanted to automate the whole process. First I selected Leela. Next Komodo11. I selected the right tempo and the last step was linking to my special database of 50 positions. After verification of all parameters I clicked ok and the match got off.
About 3 full days lasted the match. I let my PC run day and night but I did interrupt the process a few times to allow my PC cool down as around that time we were having temperatures around 40 degrees in Belgium. Anyway it was very easy to continue the match from the point where I paused.

The match was a big success which superseded the tests. First it became quickly clear both engines were very close of strength but also had a very different style. Often games got extremely interesting and besides played from openings all part of my repertoire. A number of times, I sometimes even together with my children, watched live 1 or more games. My children also regularly asked about the preliminary score as we all got attached to little Leela which despite the tactical handicap (more about it later) often managed to defeat the giant Komodo .

It made me want to have more of it so I decided to organize twice more such match in the next months with newer releases of Leela. For the 3rd match I decided to replace some of the openings. If in the 2 previous matches 4 times the same color won (so irrespective of the engine) then it seemed more appropriate to select some other opening to use as test.

2 matches were narrowly lost by Leela. The second match Leela tied with Komodo. I considered this a very unexpected and exceptionally good result on my modest computer definitely not optimal for Lc0. On the other hand the matches didn't give an answer on my original question. The scores were too close to know for sure which engine of the 2 was the strongest. Anyway this is not a disaster as now I got to know Leela very well in the 300 games. I got a pretty good idea when to use Leela for the analysis.

In my previous article we already got acquainted with Leela by looking at how the engine reacts in different types of positions but it is only by replaying her games that we fully realize how different the engine is compared with the traditional ones. So to conclude this article I made a selection of 3 games which demonstrate very well the strengths and weaknesses of Leela. This was not so easy as there was a very large number of beautiful games. I start with a fantastic game played from the Chigorin-variation of the Spanish opening (I covered the opening recently in my article statistics). Leela sacrifices very early an exchange and succeeds like a real boa constrictor to slowly suffocate black.
[Event "DESKTOP-VE6O9HB, Rapid 15m+10s"] [Site "DESKTOP-VE6O9HB"] [Date "2019.05.27"] [Round "13"] [White "Lc0 v0.21.0"] [Black "Komodo 11 64-bit"] [Result "1-0"] [ECO "C96"] [PlyCount "163"] [EventDate "2019.??.??"] [Eventtype "rapid"] [CurrentPosition "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"] 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Na5 10. Bc2 c5 {(I play this position with both colors. Leelal shows immediately already an advantage of +0,8. Komodo is more conservative with +0,2)} 11. d4 exd4 12. cxd4 Re8 13. d5 Nd7 14. Nbd2 Bf6 15. Rb1 {(Meanwhile Leela became more optimistic with +1,7. Komodo thinks there are no issues and evaluates the positon as +0,1)} 15... Nf8 16. b3 Ng6 17. Nf1 Bd7 18. Ng3 Ne5 19. Nd2 Ng6 20. Nf3 Ne5 21. Nh2 {(It is typical for Leela to repeat moves before proceeding with her plan.)} 21... Ng6 22. Nh5 Bd4 23. Nf3 Bc3 24. Re3 b4 25. Rxc3 {(After this exchange-sacrifice Leela already gives herself +4. Komodo sees white has full compensation but not much more with +0,5 for white.)} 25... bxc3 26. Qe1 f6 27. Qxc3 Rc8 28. Kh2 Re7 29. Be3 Nb7 30. Nd2 Qa5 31. Qa1 Qc7 32. f4 Rce8 33. Qc3 Qa5 34. Qb2 Qc7 35. g4 Kh8 36. Rg1 Rf8 37. Qc3 Qa5 38. Qa1 Qb5 39. Rg2 Be8 40. Ng3 {(The evaluation of Leela has raised to +8. Komodo now also realizes that his position is not good but +1 is a huge difference of evaluation.)} 40... Qb6 41. Nf5 Ref7 42. h4 Qd8 43. h5 Ne7 44. Nh4 Ng8 45. Qe1 Na5 46. Ndf3 Nb7 47. Bd2 Rc7 {(From here onward Komodo considers the positon lost with a score of +1,7 for white. The score from Leela keeps going up and is now already at +15.)} 48. Bc3 c4 49. b4 a5 50. a3 axb4 51. axb4 Qb8 52. Nd4 Nd8 53. Ndf5 Qb6 54. Bd4 Qa6 55. Qc3 Ra7 56. Bxa7 Qxa7 57. Nxd6 Nf7 58. Nxf7+ Bxf7 59. Nf5 Qc7 60. d6 Qd8 61. Qd4 Be6 62. Ne3 Nh6 63. b5 Nf7 64. b6 Qxd6 65. Qxd6 Nxd6 66. Rd2 Nb7 67. f5 Bg8 68. Rd7 Rb8 69. g5 Nc5 70. Rd6 Nb7 71. Rd1 fxg5 72. e5 {(Leela keeps sacrificing material as it considers activity more important.)} 72... Nc5 73. Rd6 Nb7 74. Rc6 Nd8 75. Rc7 g6 76. hxg6 hxg6 77. e6 Bxe6 78. fxe6 Nxe6 79. Rc6 Nd4 80. Rd6 Nxc2 81. Nxc2 Kg7 82. Nb4 1-0
The extraordinary of this game is that there is no fixed center. The battle rages over the full board but black never gets a change to exploit the extra exchange.

A second game starts from a Dutch stonewall which I encountered in one of my games played end of 2017 against the Dutch IM Xander Wemmers see secret. In the game we see the advance of both rook-pawns which is very typical for the style of Leela. Next we see a magnificent demonstration of activity. Komodo doesn't understand at all what Leela is trying to do.
[Event "DESKTOP-VE6O9HB, Rapid 15m+10s"] [Site "DESKTOP-VE6O9HB"] [Date "2019.07.27"] [Round "20"] [White "Komodo 11 64-bit"] [Black "Lc0 v0.21.2"] [Result "0-1"] [ECO "A90"] [PlyCount "124"] [EventDate "2019.??.??"] [Eventtype "rapid"] [CurrentPosition "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"] 1. d4 f5 2. g3 Nf6 3. Bg2 e6 4. Nf3 d5 5. O-O Bd6 6. c4 c6 7. Nc3 O-O 8. Qc2 Ne4 9. Rb1 a5 10. a3 Nd7 {(I encountered this opening on the board end of 2017 in my game against the Dutch IM Xander Wemmers. Komodo shows +0,3. Leela evaluates it as 0.0.)} 11. Be3 Qe7 12. Rfd1 h6 13. Rbc1 g5 14. Ne1 Ndf6 15. c5 Bc7 16. f3 Nxc3 17. bxc3 b5 18. Nd3 a4 {(Leela starts to like black from here onward with -0,4. Komodo thinks white is ok with +0,2.)} 19. Rf1 Bd7 20. Rb1 Be8 21. f4 g4 22. Ne5 h5 23. Bf2 h4 24. c4 h3 {(Here we see again typically Leela playing chess. On both wings the rook-pawns are advanced as far as possible. On top the white bishop is buried alive. Leela already shows -1,4. Komodo sees no danger with 0.0)} 25. Bh1 bxc4 26. Rb7 Qd8 27. Rfb1 Bxe5 28. fxe5 Nh5 {(The only open file is controlled firmly by white. Black has also a very bad bishop. Still Leela is very optimistic.)} 29. e3 Qg5 30. R1b6 Bg6 31. Qc1 Rac8 32. Rb2 f4 {(With this pawnsacrifice Leela frees the bad bishop. Komodo still considers the position equal with 0.0)} 33. exf4 Qf5 34. R7b6 Qd3 35. Rd2 Qf5 36. Ra2 {(No move-repetition as Komodo starts to realize things are not looking so good anymore.)} 36... Rb8 37. Be1 Qd3 38. Qc3 Rxb6 39. cxb6 {(Only now Komodo evaluates the position as likely lost.)} 39... Rb8 40. Rb2 Ng7 41. Kf2 Rb7 42. Bd2 Kf7 {(The execution of the win by Leela is impressive.)} 43. Ke1 Bh7 44. Rb4 Qxc3 45. Bxc3 Bc2 46. Kd2 Bb3 47. Kc1 Nf5 48. Kd2 Ke8 49. Ke2 Kd7 50. Kd2 Kc8 51. Ke2 Rb8 52. Kd2 Kb7 53. Ba1 Ka6 54. Bc3 Rxb6 55. Rxb6+ Kxb6 56. Kc1 c5 57. dxc5+ Kxc5 58. Bb4+ Kd4 59. Kd2 Ba2 60. Bc3+ Kc5 61. Kc1 Bb3 62. Bb4+ Kc6 {(Komodo shows for some moves already -7 and resigns. It probably detested the cat and mouse-game Leela was playing with him.)} 0-1
Leela plays this game as many others with an understanding of open lines, bad bishops which is much more advanced than Komodo.

If you have replayed the 2 previous games then you probably start to wonder why Leela didn't destroy Komodo in the match. Well tactically things got often completely wrong. A nice example is the next one in which Leela sees the combination 5 moves too late.
[Event "DESKTOP-VE6O9HB, Rapid 15m+10s"] [Site "DESKTOP-VE6O9HB"] [Date "2019.06.27"] [Round "2"] [White "Komodo 11 64-bit"] [Black "Lc0 v0.21.2"] [Result "1-0"] [ECO "C42"] [PlyCount "53"] [EventDate "2019.??.??"] [Eventtype "rapid"] [CurrentPosition "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"] 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Nc6 7. O-O Be7 8. Nc3 Nxc3 9. bxc3 Be6 10. Re1 O-O {(I got this opening on the board in my game against Sven Stange of 2017.)} 11. Rb1 Rb8 12. Bf4 Re8 13. Rxe6 fxe6 14. Ne5 Nxe5 15. Bxe5 Bd6 16. Qh5 h6 17. f4 Bxe5 18. dxe5 Rf8 {(The weakness of Leela is tactics. Komodo shows after this move immediately +2,5 while Leela is blind with only +0,3.)} 19. Qg6 Rxf4 20. Qh7+ Kf8 21. Bg6 Qg5 22. Qh8+ {(Meanwhile Komodo shows +18. Leela still is hanging at +0,3.)} 22... Ke7 23. Qxg7+ Kd8 {(Only now Leela awakens. Her evaluation raises to +3. Leela only took Qxb8 into account.)} 24. Rxb7 Rc8 25. Rxc7 Rf1+ 26. Kxf1 Qf4+ 27. Ke2 {(It is remarkable but all these moves were published in an analysis on my blog before.)} 1-0
Fans of my blog will likely already recognized the link to my article the butterfly-effect. All the moves were already covered in that article so it was definitely a surprise to see them all executed on the board.

I got to enjoy testing of chess-engines via these kind of matches. A new match won't be for immediately as other work needs to done first. Besides Leela is building a new network from scratch and today it is still much weaker than the networks of a couple of months ago. It would also be nice for a next match to have by that time newer and stronger hardware.


Wednesday, September 11, 2019

Leela (Lc0)

At the end of 2017 I mentioned on my blog about the first +50 year old player breaking the 2700 barrier. However most people expect that this record will be smashed very soon by former worldchampion Viswanathan Anand. In December he will be 50 and today he still has a sky-high rating of 2765.

The young Dutch topgrandmaster Anish Giri already expressed his admiration for him in a recent interview at Anand is a fascinating phenomenon. Contrary to his contemporaries he is still young of heart. Most people of his age aren't willing to make changes. They stop downloading the last software or they don't renew the apps like young people do. Anand however is still up to date with the apps on his smartphone. Fact that he still belongs to the world-top is the merit of continuously reinventing oneself.

That motivation is lacking for older players is something I see regularly confirmed around me. In the most recent Vlaanderen Schaakt Digitaal the publisher talks about Fritz. I used that engine 20 years ago to analyze my games. If you use today still Fritz while there exist free and much stronger engines then you definitely aren't ambitious anymore. However worse is when an author whom everybody considers absolute the best in his domain of opening-books, isn't up to date with the latest developments. In a recent interview the Israeli grandmaster Boris Avrukh confessed that he didn't use the best software to check his analysisHis repertoire-books are very popular so it is a shock to hear that he was still using an old version of Stockfish and never had worked with Leela.

It seems this 41 year old player has lost its appetite for chess. Therefore it wasn't a real surprise when he announced at the introduction of this most recent book that he would stop writing any new books. Just like the 44 year old former worldchampion Kramnik whom stopped his professional chesscareer a couple of months ago, he expressed his wish to make a career-change. Many new plans and challenges are already waiting. So there will be no time for being bored and in the end it is of course up to the individual how to live your own life.

I am in the same age-category as them but I am definitely not tired yet of chess. Contrary as this year I will play (much) more. End of this month I will play again chess abroad which has been more than a decade ago. Together with my son Hugo we will play in the same team for Axel Landau in the Dutch interclub. I am also again reading some new opening-books which was even 2 decades ago when I last bought such book (see e.g. statistics). Finally I am also closely following all chess-developments via different chess-sites. About 1 of those new kids in town I want in this article to elaborate a bit.

About the rise of Alphazero and later Lc0 I already wrote a number of times on this blog but I guess this wasn't very interesting for the average amateur. What is the sense to talk about something which you can't use yourself? Well this is not correct (anymore). 4 months ago I managed to install Lc0 on my PC and meanwhile I have become a real fan of it. Since beginning of 2018 I complained that our best engines are too similar which made it doubtful if it still made sense to use something else beside Stockfish see to analyze using a computer part 3. Lc0 is a game changer. It very often gives a totally different view which is definitely valuable.

So Lc0 is available for everybody. Many grandmasters are using it already for some time see e.g. a recent interview of the French grandmaster Iossif Dorfman but I only hear very rarely amateurs do. Nevertheless I think also for them this engine can be very useful. Often classical engines offer very complex and tactical solutions for some opening-questions. On the other hand it is not seldom that Leela chooses for a much more quiet alternative based on solid positional moves which are easier to understand and remember. In my most recent game-preparations of the last edition of Open Brasschaat I used regularly Leela to make some quick choices. A lovely example was below opening which was part of my preparation against  Guy Baete.
[Event "Preparation against Guy Baete"] [Site "?"] [Date "2019.??.??"] [Round "?"] [White "?"] [Black "?"] [Result "*"] [ECO "C41"] [PlyCount "23"] [EventDate "2019.??.??"] [Sourceversiondate "2019.09.08"] [CurrentPosition "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"] 1. e4 e5 2. Nf3 d6 3. d4 Bg4 4. dxe5 Bxf3 5. Qxf3 dxe5 6. Qb3 {(I started recently to use Leela when I want a quick answer in a game-preparation for an early opening-position which I didn't analyze before. In comparison with classical engines like Stockfish, Leela finds Qb3 immediately. Qb3 is slightly more accurate than Bc4 which almost anybody plays.)} 6... b6 7. Bc4 Qf6 8. Nc3 c6 {(In the megadatabase I found 3 games of the same amateur of 1700 elo with this positon. Only in the last game his opponent was clearly prepared for it as it was the only time out of 31 games with this position in the megadatabase that this strong move was played. 9.Nd5 is again a typical invisible move for a human. Finally I also want to warn people that you are never safe for preparations. Some people think wrongly that a low rating protects them for it. We all have engines so expect people to use them.)} 9. Nd5 {(However tactics are still quicker found by the classical engines. Contrary to Leela, Stockfish finds this killer immediately. The conclusion is that we should combine both engines to work efficiently.)} 9... cxd5 (9... Qd8 10. Nxb6 Qxb6 11. Bxf7+ Kd8 12. Bxg8 +-) 10. Bb5+ Nd7 11. Bxd7+ Kxd7 12. Qxd5+ +- *
Openings played by amateurs are often ignored by grandmasters so it is for sure good to have Lc0 around to consult as a backup.

Also in the middlegame Leela performs very well. I checked my analysis made in the most recent years with Leela and Leela found practically all critical moves. Some readers will maybe still remember my article the horizon published in 2014 in which I indicated that engines like Houdini and Stockfish couldn't find the best move f3 even after 1 hour of calculations. Well Leela only needs 19 seconds on my desktop today.
The last release of Stockfish finds f3 now also very fast. It just proofs once more that the strength of the best engines have improved dramatically last couple of years.

Finally the endgame is maybe the phase in which Leela can demonstrate the greatest difference compared to the traditional engines. Especially when engines don't use tablebases I notice that Leela is far more accurate with the evaluation. Time over time this allowed Leela to escape from some very difficult to defend positions. A nice example is an extract from a game out of a match with Komodo against Lc0.
[Event "DESKTOP-VE6O9HB, Rapid 15m+10s"] [Site "DESKTOP-VE6O9HB"] [Date "2019.05.28"] [Round "44"] [White "Komodo 11 64-bit"] [Black "Lc0 v0.21.0"] [Result "1/2-1/2"] [SetUp "1"] [FEN "8/3b4/3P1kp1/3R3p/1r5P/6K1/5P2/3B4 b - - 0 53"] [ECO "A10"] [PlyCount "47"] [EventDate "2019.??.??"] [Eventtype "rapid"] [CurrentPosition "8/3b4/3P1kp1/3R3p/1r5P/6K1/5P2/3B4 b - - 0 53"] 53... Ke6 {(Black is a pawn down but it is no disaster as white's pawns are shattered. However now Leela chooses for a very remarkable road.)} 54. Rg5 Be8 55. Bc2 Kxd6 56. Bxg6 Bxg6 57. Rxg6+ Ke7 58. Rg5 Kf6 59. Rxh5 {(The well-known rookendgame of f and h-pawns. It is theoretically a draw but in practice not so easy to defend.)} 59... Kg6 60. Rg5+ Kh6 61. f4 Rb1 62. Kg4 Ra1 63. Rd5 Kg6 64. h5+ {(None of my engines uses tablebases. Stockfish and Komodo show an evaluation of approximately +2 for white. Leela on the other hand shows surprisingly 0.0. and never deviates from it. With surprisingly I mean not a wrong evaluation but something I don't expect from an engine without tablebases. )} 64... Kg7 65. Rd7+ Kh6 66. Rd6+ Kg7 67. h6+ Kh7 68. f5 Rf1 69. Kg5 Rg1+ 70. Kf6 Rf1 71. Re6 Rf2 72. Re3 Ra2 73. Rh3 Ra1 74. Rh4 Ra2 75. Kg5 Rg2+ 76. Rg4 Rxg4+ {(It struck me that the evaluation of Leela was very often more accurate than the classical engines without tablebases. It allowed Leela to escape from many bad positions with a draw.)} 1/2-1/2
Then the next question is of course: "how strong is Leela exactly". I could refer to the most recent superfinal of TCEC which Leela won from Stockfish with 53,5- 46,5 but that would give on my PC a distorted picture. TCEC uses different hardware which allows Lc0 to play much stronger than on my 2 year old desktop (an AMD FX(tm)-6300 6 core processor 3,5Ghz with a Nvidia Geforce GTX 960 graphic card).  On CCRL it is a similar story as they don't compare the engines on the same hardware. In the end I decided to compare myself the engines on my PC. 1 of the 3 Leela-releases which I tested, managed to score a very nice 50-50 against Komodo (my only commercial engine which I still use today for analysis) in a match of 100 rapid games (more about this in the next article). I believe with a slower tempo Lc0 further gains some strength compared to the competition which is what CCRL also shows in its benchmarks.

So even on my modest hardware Leela performs approximately at the same level as recent releases of Stockfish and Komodo. I expect it would surpass them on faster hardware. Unfortunately I am not rich and unexpected expenses this year are forcing me to put on hold my dream of more powerful hardware.

Ok everybody is convinced that Lc0 is a must but I still need to explain how to install Lc0 on your own PC so we can all start to use it. For people willing to find this out themselves see Getting Started. However I warn that it is not so simple. On my 5 year old portable it didn't even manage. I guess it has to do with missing a good graphic card. Without a Nvidia graphic card it makes little sense.

First you need to download the engine and put it in a directory. You can choose between different versions. I chose as it is the most recent one and it works for my Nvidia graphic card. The cuda-version is stronger but I couldn't get it work on my PC probably because I don't have the right drivers or because my graphic card is too old. If you have stronger hardware then you should definitely try the cuda-version.

Next you need to download a network and put it in the same directory as the engine. You can choose between hundreds of networks. The site recommends network 42700 but I use at this moment 42820. It is possible that another network is still a couple of points stronger but it makes little sense to spend hours of testing to find this out.

Next double click on the Lc0 file after which normally a command prompt should pop up. Type "go nodes 100" and press enter. Wait till the command is executed. If you see on the last line "bestmove ..." then you can close the window.

Now go to Chessbase and start the application "Create UCI Engine" under the tab "Engine". Select Lc0 and click on ok. If everything went ok then you can now choose Lc0 as engine and start to analyze with it. I also want to warn that you need a bit of adjustment with Lc0. Lc0 will only give a first evaluation after some seconds contrary to the classical engines which give instantaneously an answer. Also don't be afraid of the low number of positions Lc0 checks. It is fully normal to see Lc0 calculating 1000 times slower than Stockfish. It won't play worse due to it.

Voila we are again up to date but the developments are not stopping. New neural networks are at the doorstep. Of course Chessbase wants a piece of the pie and has recently proposed fat fritz. More interesting I think are the new engines which are now competing in the mastergroup of TCEC season 16. Some new names like Alliestein, Scorpio and Stoofvlees are already infiltrating at the top. Yes stoofvlees also made me smile. The author is the Belg with Italian roots Gian-Carlo Pascutto preferring to eat stoofvlees instead of pizza.