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.
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.
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.

Brabo

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.
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.
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.
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.

Brabo

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 chess.com. 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.
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.
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 lc0-v0.22.0-windows-opencl.zip 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.

Brabo