Friday, December 2, 2022

Fiddling Around With the Lc0 Engine

 
     My Fritz 17 program has a whole gaggle of engines including Komodo 14 and Stockfish 15, but the latter is the only one I use. 
     Back in 2018 I tinkered around with SashChess and considered it interesting. It's based on Stockfish and I recently tested it in a Lechenicher SchachServer tournament where engine use is allowed and there was little difference between SashChess and whatever engines my opponents were using...all of the games were uneventful draws. Conclusion: there was no advantage to using it over SF15. 
     Today I took a quick look at Leela Chess Zero (abbreviated as LCZero, lc0), a free, open-source, deep neural network–based engine. It starts with no chess knowledge other than the basic rules and then learns how to play by learning from playing against itself.
     As of November 2022, it has played over 970 million games against itself and the claim is that it's capable of playing at a level that is comparable with Stockfish. I don't think so because I have seen no evidence to back up the claim.
     On the CCRL 40/15 rating list Lc0 0.28.0 w744204 64-bit 4CPU is ranked 22-24 with a rating of 3372. Against Stockfish 15 it's score is +0 -15 =17 
     On my laptop I ran a test, a 4 minute per game match pitting Lc0 v0.22.0 against Stockfish 15. Both engines had a hash size of 1125 (about half of what was available), but Lc0 v0.22.0 inadvertently was given a handicap of 2 CPUs to 1 CPU. I stopped the match after 18 games. The result: Stockfish scored +15 -0 =3. 
     Again, I see no evidence that Lc0 is to be preferred over Stockfish. After the game was over, stepping through it with Lc0 it seems that the engine does not perform well at fast time limits. However, after being given some time to ponder over it's next move, it changes its mind and will select a better move, but not always one that agrees with Stockfish's selection. 
     Here is an example of Lc0's play. 

A game that I liked (Fritz 17)

[Event "Blitz Match G/4"] [Site "Deep inside my PC"] [Date "2022.12.??"] [Round "?"] [White "Lc0 v0.22.0"] [Black "Stockfish 15"] [Result "0-1"] [ECO "C18"] [Annotator "Stockfish 15"] [PlyCount "46"] {French Defense} 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 {[%mdl 32]} 7. h4 {[%mdl 32] An interesting line that has a high success rate in my database. Much more usual is 7.Qg4} Qc7 8. h5 {aiming for h6.} h6 { Preventing the further advance of the h-Pawn, but black has another interesting alternative.} (8... cxd4 9. cxd4 Qc3+ 10. Bd2 Qxd4 {with equal opportunities.}) 9. Bd2 Nbc6 {White's next move, while not really an error, seems to be heading down the wrong path. Either 10.Nf3, or, perhaps, 10.Bb5+ seem better.} 10. Qg4 Nf5 11. Nf3 cxd4 12. cxd4 O-O (12... Ncxd4 {is inviting, but it allows white to gain a slight advantage.} 13. Nxd4 Qxe5+ 14. Be3 Nxe3 15. Bb5+ Kf8 16. fxe3 Qxe3+ 17. Ne2 e5 18. Bd7 Ke7 (18... Qc5 {is no better.} 19. Rf1 f6 20. Rd1 Qa5+ 21. c3 Bxd7 22. Qxd7 Rd8 23. Qxb7 Kg8 {White is winning. Quesada Perez,Y (2626)-Feng,M (2198) Philadelphia 2019}) 19. Rh3 Qg5 20. Bxc8 Rhxc8 {White is better, but in Yu,Y (2607)-Kotsur,P (2559) Moscow 2011 he was unable to score the point and only drew.}) 13. Bd3 {This results in some interesting tactics! Defending the d-Pawn with either 13.c3 or 13.Rd1 would have resulted in a position that was nearly equal. It's interesting that Lc0 initially thought it was better by about half a P after this move. After being given a couple of minutes to mull things over it decided the position is equal, but 13.Qf4 would have been just a bit better. After actually making the move 13.Bd3 it realized that black stands better by, it thinks, about half a P. Stockfish's evaluation is that the position is 0.00.} Nfxd4 14. Bxh6 {An ingenious counter stroke that is met by an equally clever reply.} (14. Nxd4 { is met by} Qxe5+ 15. Be3 f5 16. Qh4 f4 {with a strong initiative.}) 14... f5 15. exf6 (15. Qg3 {was somewhat better.} Nxf3+ 16. gxf3 (16. Qxf3 Qxe5+ {wins}) 16... Qxe5+ 17. Qxe5 Nxe5 18. Be3 f4 (18... Nxd3+ 19. cxd3 {is only equal because of Bs of opposite color plus black has the bad B.}) 19. Bc5 Rf6 20. O-O-O Nxd3+ 21. Rxd3 {with an equal position.}) 15... Nxf3+ 16. gxf3 (16. Qxf3 {allows black to land a walloping blow with} Rxf6 17. Qd1 Rxh6) 16... Rxf6 ( 16... Qe5+ {is much worse.} 17. Kd2 Qxf6 18. Bg5 {and white has equalized.}) 17. Bxg7 {[%mdl 8192] A serious (and losing) tactical error by Lc0.} (17. Be3 { would have been better, but after} Ne5 {black still has the better of it.}) 17... Qxg7 18. Qh4 Qh6 {Also good was 18...Rxf3} 19. Rg1+ Kh8 20. Qg3 Bd7 21. Rb1 e5 22. Rxb7 {LcO misses the mate, but the game was quite lost anyway.} (22. Qg5 {was the best move available, but after} Nd4 23. Be2 Qxg5 24. Rxg5 Bc6 25. Rxe5 Nxc2+ {black is winning.}) 22... Qc1+ 23. Ke2 Nd4# {Quite poorly played by Lc0} 0-1

No comments:

Post a Comment