A random walk down NNUE street ….

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: A random walk down NNUE street ….

Post by MikeB »

Krzysztof Grzelak wrote: Sat Mar 06, 2021 5:57 pm
MikeB wrote: Sat Mar 06, 2021 5:28 pm Quantum computing for chess seems to be a a long way off, if ever. I'm not expecting to see anything with my remaining days on earth, but who knows, maybe I will.
I apologise that I will ask - you can programme - most probably you can programme, you have a head and a mind - I think that yes. Everything in front of you, you do not need any of quantum computers.
I 'm a retired accountant, CPA actually, Certified Public Accountant No formal programming background, but I was one of Bob Hyatt's helpers with Crafty for twenty years and if one hangs around Bob Hyatt for twenty years, you will learn a few things about programming. I would say the two smartest people I have come across on Talk Chess are Bob Hyatt and Ronald De Man. A third one pretty high on my list is HGM. You can learn a lot just from reading their posts. ymmv
Many of the Stockfish developers are high on my list as well. One can learn a lot there as well just reading through the pull requests.
Image
Krzysztof Grzelak
Posts: 1525
Joined: Tue Jul 15, 2014 12:47 pm

Re: A random walk down NNUE street ….

Post by Krzysztof Grzelak »

They forgot only one thing, how to write a better engine than Stockfish. If anyone asked today, could you write a better engine than Stockfish. I would answer without hesitation - yes you can. The whole problem of developers who do not want to think.
jp
Posts: 1470
Joined: Mon Apr 23, 2018 7:54 am

Re: A random walk down NNUE street ….

Post by jp »

MikeB wrote: Sat Mar 06, 2021 5:28 pm Quantum computing for chess seems to be a a long way off, if ever. I'm not expecting to see anything with my remaining days on earth, but who knows, maybe I will.
If you look at that blog post, you'll see that it has nothing to do with chess. The author is just using a bizarre analogy.

As I've said before, there is no quantum algorithm for chess, and there is no reason to believe that one would exist.
DrCliche
Posts: 65
Joined: Sun Aug 19, 2018 10:57 pm
Full name: Nickolas Reynolds

Re: A random walk down NNUE street ….

Post by DrCliche »

RubiChess wrote: Sat Mar 06, 2021 6:23 pmAn NNUE engine with a random net is a random mover.
Surprisingly, no. Searching is a very powerful idea, so powerful, in fact, that to some extent it doesn't even matter if you literally don't understand what it is that you're searching for. In the context of chess, this is called the Beal Effect, and I'm sure there has been much written about it on the internet (probably on the chess programming wiki, as well), if you want to know more.

Assuming MikeB was in hybrid mode in his experiments, I'm personally quite surprised that a random net was a big enough impediment to drop Stockfish to human GM strength. If he was in pure NNUE mode, then I'm even more surprised at the results! (But for the opposite reason.)
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: A random walk down NNUE street ….

Post by MikeB »

Fabian Fichter wrote: Sat Mar 06, 2021 3:38 pm I can imagine that with hybrid evaluation even a random net still can still give good results, because the random eval is just some noise, and the classical evaluation still gives a clear direction. In contrast, 2600+ with pure random evaluation should be close to impossible, I would rather guess around 2000 Elo lower.
A Random Net Download is available for download here and Fabian is correct , it is very weak, I had not realized how quickly the learning process is in the beginning learnings. Quite remarkable actually.
Image
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: A random walk down NNUE street ….

Post by MikeB »

jp wrote: Sun Mar 07, 2021 4:30 am
MikeB wrote: Sat Mar 06, 2021 5:28 pm Quantum computing for chess seems to be a a long way off, if ever. I'm not expecting to see anything with my remaining days on earth, but who knows, maybe I will.
If you look at that blog post, you'll see that it has nothing to do with chess. The author is just using a bizarre analogy.

As I've said before, there is no quantum algorithm for chess, and there is no reason to believe that one would exist.
So we agree, like I said .."...seems to be a long way off ..."
Image
smatovic
Posts: 2645
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: A random walk down NNUE street ….

Post by smatovic »

jp wrote: Sun Mar 07, 2021 4:30 am
MikeB wrote: Sat Mar 06, 2021 5:28 pm Quantum computing for chess seems to be a a long way off, if ever. I'm not expecting to see anything with my remaining days on earth, but who knows, maybe I will.
If you look at that blog post, you'll see that it has nothing to do with chess. The author is just using a bizarre analogy.

As I've said before, there is no quantum algorithm for chess, and there is no reason to believe that one would exist.
Give me a billion qubits and I will do it ;)

--
Srdja
RubiChess
Posts: 584
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: A random walk down NNUE street ….

Post by RubiChess »

Okay, I did a little test grabbing some of the engines in the lower ranks of CCRL blitz. Not easy to find some that are still available and almost stable running in Cutechess. TC: 60+1

Code: Select all

Rank Name                          Elo     +/-   Games   Score    Draw
   0 Rubi-2.0-RandomNet            -70      14    2000   40.0%   14.5%
   1 Baislicka-1.0_2180Elo         inf     nan     200  100.0%    0.0%
   2 Pulse-1.6.1_1600Elo          1040     nan     200   99.8%    0.5%
   3 RubiChess-0.2.1               636     204     200   97.5%    1.0%
   4 Safrad-2.1_1025Elo            449      88     200   93.0%    6.0%
   5 RubiChess-0.1                 430      94     200   92.3%    1.5%
   6 Cassandre-0.21dc_1140Elo?      24      24     200   53.5%   74.0%
   7 NEG-1.2_???Elo                -45      43     200   43.5%   22.0%
   8 LaMoSca-0.1_360Elo           -244      37     200   19.8%   39.5%
   9 Ram-2.0_691Elo               -920     nan     200    0.5%    1.0%
  10 SxRandom_207Elo              -inf     nan     200    0.0%    0.0%
  
So the randomnet is not a random mover but not much stronger. RubiChess-0.1 e.g. is VERY weak.
And some of the games were won by RandomNet by illegal Moves / time forfeits etc. (Cassandre, Ram, RubiChess-0.1, LaMoSca, Safrad) so real score is even worse than in this table. I would guess < 1000 Elo.

Regards, Andreas
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: A random walk down NNUE street ….

Post by MikeB »

Building your net from scratch is very interesting , it becomes part of you , almost like a family , and I have written shell scripts now to automate the process as best as I can. And today , my baby net made poppa proud.
[pgn]
[Event "Computer Chess Game"]
[Site "VM-894787"]
[Date "2021.03.08"]
[Round "-"]
[White "Stockfish 13"]
[Black "Zappa Mexico II"]
[Result "1-0"]
[TimeControl "60+1"]
[Annotator "1. -0.35 1... +0.03"]

1. d3 {-0.35/19} d5 {+0.03/12 9} 2. b3 {+0.39/16 2.9} e5 {+0.54/12 7} 3.
Nf3 {+0.32/16 7} Nc6 {+0.55/12 5} 4. Bb2 {+0.26/15 2.8} Qf6 {+0.48/12 11}
5. Nbd2 {+0.31/16 2.5} Bg4 {+0.46/11 4} 6. e3 {+0.28/17 1.7} O-O-O
{+0.43/10 2.2} 7. a3 {+0.29/17 1.9} Bd6 {+0.37/9 0.9} 8. b4 {+0.36/17 1.7}
Nge7 {+0.11/9 1.9} 9. b5 {+0.35/18 1.0} Nb8 {+0.07/11 2.6} 10. c4
{+0.31/18 4} Nd7 {-0.14/10 1.6} 11. cxd5 {+0.35/17 0.7} Nxd5 {-0.18/10 1.8}
12. Be2 {+0.31/19 2.8} Qg6 {-0.22/9 1.7} 13. O-O {+0.32/18 2.3} h5
{-0.38/9 1.6} 14. Qc2 {+0.35/19 1.5} f6 {-0.14/9 0.9} 15. Ne4
{+0.35/19 1.7} Be7 {-0.16/9 0.8} 16. Rfc1 {+0.31/21 8} h4 {-0.09/10 0.9}
17. a4 {+0.28/20 5} h3 {+0.29/10 1.0} 18. g3 {+0.33/20 0.7} Qh5
{+0.25/9 0.7} 19. Ned2 {+0.35/21 1.0} Nc5 {-0.11/9 1.7} 20. Ba3
{+0.34/19 1.0} Ne6 {-0.37/11 2.0} 21. a5 {+0.33/21 2.7} Bxa3 {-0.30/9 1.4}
22. Rxa3 {+0.34/19 0.9} Kb8 {-0.64/10 3} 23. Ra4 {+0.32/19 3} f5
{-0.14/9 0.8} 24. a6 {+0.32/16 0.8} f4 {-0.31/9 0.8} 25. axb7
{+4.24/18 1.1} fxe3 {-1.09/9 4} 26. Rxa7 {+9.11/20 1.2} c5 {-2.12/8 1.7}
27. bxc6 {+11.39/20 1.1} exf2+ {-2.76/8 1.7} 28. Kxf2 {+11.94/21 1.1} Qh6
{-3.09/9 1.6} 29. Nc4 {+12.86/20 1.6} Nd4 {-3.62/8 2.4} 30. Nxd4
{+15.59/21 1.3} exd4 {-6.11/8 2.0} 31. Bxg4 {+18.40/20 1.5} Rde8
{-12.47/9 3} 32. Bc8 {+35.86/19 1.1} Rxc8 {-17.23/9 2.9} 33. bxc8=Q+
{+1000.09/31 1.1} Kxc8 {-1000.08/12 1.0} 34. Qb2 {+1000.08/44 1.3} Rf8+
{-1000.07/14 0.3} 35. Kg1 {+1000.07/79 1.2} Qxc1+ {-1000.06/13 0.1} 36.
Qxc1 {+1000.06/86 0.5} Nc7 {-1000.05/13 0.1} 37. Qa3 {+1000.05/113 1.2}
Rf1+ {-1000.04/47 0.2} 38. Kxf1 {+1000.04/245 0.5} Kd8 {-1000.03/61 0.1}
39. Qf8+ {+1000.03/245 0.4} Ne8 {-1000.02/63 0.1} 40. Rd7+
{+1000.02/245 0.4} Kc8 {-1000.01/23 0.2} 41. Qxe8# {+1000.01/245 0.4}[/pgn]
{Xboard adjudication: Checkmate} 1-0

[d]1k1r3r/pPp3p1/4n3/1P1np2q/R5b1/3PpNPp/2QNBP1P/2R3K1 w - - 0 26
bm Rxa7

This was the first instance that i have seen make it kind of move like this - for world class engines this is a very easy move , but this is still a baby net, still working on sub depth 10 fens.

Code: Select all

                                    
dep	score	nodes	time	(not shown:  tbhits	knps	seldep)
 32	+18.83!	583.2M	3:55.89	Rxa7!
 31	+18.75 	564.3M	3:48.96	Rxa7 c5 bxc6 exf2+ Kxf2 Qh6 Nc4 Nc5 Qa2 Qxc6 Nfxe5 Nxd3+ Nxd3 Rdf8+ Ke1 Rf1+ Bxf1 Re8+ Kd2 Qh6+ Kc2 Qc6 Ra8+ Kc7 Rxe8 Ne3+ Rxe3 Kxb7 Re7+ Kc8 Rxg7 Qh1 Rxg4 Qxh2+ Nd2
 31	+19.02!	556.7M	3:46.31	Rxa7!
 31	+18.46!	518.8M	3:31.20	Rxa7!
 31	+18.02!	486.3M	3:17.76	Rxa7!
 31	+17.70!	455.6M	3:06.27	Rxa7!
 31	+17.56?	403.6M	2:44.70	Rxa7 c5?
 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qb2 Nxe3
  6	 -0.13 	4443    	0:00.00	Bd1 exd2 Nxd2 Nd4 Bxg4 Qxg4
  5	 -0.12 	2591    	0:00.00	Nc4 Nd4 Nxd4 exd4 Bxg4
  4	+0.14 	974      	0:00.00	Rxa7 c5 bxc6 exd2
  3	+1.75 	445      	0:00.00	Rxa7 Kxa7 fxe3
  2	+0.14 	335      	0:00.00	Rxa7 exf2+ Kxf2
  1	NNUE evaluation using C:\Users\MichaelB7\home\nnue-gui.1.5\reinforce-network\final\nn-5bc138893ae9.nnue enabled
  1	 -0.14 	147      	0:00.00	b6 exf2+ Kxf2 axb6
  0	#

Below is my shell script how i have now automated nnue training. I alternate between pure and combo and between lambda=10.5 and lambda =0.5 and run training sessions repeatedly. I have found the best results for me in reinforcement training is to use a small batch size of 200000. This one script will kick off 80 consecutive learn sessions in a row and takes about 20 minutes to run on 3970x. After which , it will be time to generate new positions with the final nn.bin which is the time consuming part and I have simple script for that as well. With the scripts I am now able to make much better progress, the first week I spent most of time just trying how to figure out how to make progress in period. As my script runs, I will just grab the latest nn.bin abd see how it does against Zappa in Winboard at tc 1 min 1 sec with single thread.

call this by using "source whatyounameit.sh" on mingw

Code: Select all

########################################################################
#                       Reinforcement Training                         #
########################################################################
for p in `seq 1 $bigloop`;
do
########################################################################
#                                                                      #
#                    Cycle Through Pure and Combo                      #

  NT=( "pure" "combo" )                                                #
########################################################################
#                                                                      #
#                    Cycle Through Lammda  1.0 and 0.5                 #

  LA=( "0.5" "1.0"  )                                                  #
########################################################################
## rm outpul directories from previous run
  let ntcycle=2 ## set to zero to skip
  for k in `seq 1 $ntcycle`;
  do
    let lacycle=2 ## set to zero to skip
    for m in `seq 1 $lacycle`;
    do
      let loops=2 ## set to zero to skip
      z=0
      for i in `seq 1 $loops`;
      do
        z=$((z+1))

        echo -e "\n  Cycle:         $p\n  NNUE Value: ${NT[${k}-1]}\n  Lamda:       ${LA[${m}-1]}\n  Round:         $z\n"
        cd "/c/Users/MichaelB7/home/nnue-gui.1.5/reinforce-network/final/"
        nnbin=nn.bin
        name=nn-$(sha256sum ${nnbin} | cut -c1-12).nnue
        echo ${name}
        mv ${nnbin} ${name}
        cp ${name} ../../
        cd ../../
        sleep 3 # to pause

        threads=50
        valfile=M1_D8
        options="uci
        setoption name Use NNUE value ${NT[${k}-1]}
        setoption name Hash value 10240
        setoption name Threads value $threads
        setoption name EvalSaveDir value reinforce-network
        setoption name SkipLoadingEval value false
        setoption name EvalFile value $name
        setoption name SyzygyPath value c:/syzygy
        isready
        learn targetdir training validation_set_file_name validation/$valfile.binpack set_recommended_uci_options use_draw_in_training 1 use_draw_in_validation 1 eval_limit 32000 epochs 1000 lr 1 lambda ${LA[${m}-1]} nn_batch_size 1000 batchsize 200000 eval_save_interval 200000 loss_output_interval 200000 newbob_decay 0.5 newbob_num_trials 4
        quit"

        printf "$options" | ./stockfish
      done
    done
  done
done
Image
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: A random walk down NNUE street ….

Post by MikeB »

first 3 games from the latest net over night created after generating new fens and tuning last night. it is now clearly playing better , and certainly different from nets I have seen- no books of course

[pgn][Event "Computer Chess Game"]
[Site "VM-894787"]
[Date "2021.03.08"]
[Round "-"]
[White "Stockfish 13"]
[Black "Zappa Mexico II"]
[Result "1-0"]
[TimeControl "60+1"]
[Annotator "1. -0.28 1... +0.20"]

1. b4 {-0.28/15} e5 {+0.20/12 5} 2. a3 {+0.21/14 1.8} d5 {+0.47/11 3} 3. d3
{+0.00/19 6} a5 {+0.51/12 7} 4. b5 {+0.21/15 0.7} Nf6 {+0.49/12 7} 5. Bb2
{-0.27/21 8} Bd6 {+0.60/12 4} 6. e3 {-0.01/16 2.1} O-O {+0.74/11 3} 7. c4
{+0.00/15 1.3} Be6 {+0.66/11 2.7} 8. cxd5 {+0.27/17 1.5} Nxd5 {+0.32/12 5}
9. Nf3 {+0.22/20 8} Nd7 {+0.48/11 1.9} 10. Nbd2 {+0.28/16 0.8} a4
{+0.26/11 4} 11. h4 {+0.24/17 1.4} Qe7 {+0.55/9 1.2} 12. Qb1 {+0.30/18 2.9}
Bg4 {+0.49/10 5} 13. Be2 {+0.23/18 5} f6 {+0.46/10 1.6} 14. h5 {+0.23/20 6}
c6 {+0.52/9 0.9} 15. bxc6 {+0.25/16 0.9} bxc6 {+0.42/10 1.3} 16. h6
{+0.29/18 2.4} g6 {+0.39/10 2.8} 17. Qc2 {+0.29/17 1.5} Nc5 {+0.32/9 1.6}
18. Rd1 {+0.25/18 5} Rab8 {+0.31/9 1.2} 19. O-O {+0.25/18 3} Rfc8
{+0.32/9 2.2} 20. g3 {+0.25/18 2.3} Nb3 {+0.54/9 1.3} 21. Nc4
{+0.27/16 0.8} Bc5 {+0.28/10 2.3} 22. Rfe1 {+0.23/18 2.0} Re8
{+0.47/10 1.6} 23. Kg2 {+0.22/19 2.4} Qe6 {+0.46/9 1.1} 24. Rh1
{+0.19/19 1.3} Qe7 {+0.42/9 1.1} 25. Rh4 {+0.27/18 0.8} Bc8 {+0.32/10 1.4}
26. Nfd2 {+0.29/18 1.3} Qc7 {+0.20/9 0.9} 27. Ne4 {+0.28/20 5} Bf8
{+0.15/9 1.0} 28. g4 {+0.17/19 2.9} Ba6 {+0.08/9 0.9} 29. g5 {+0.23/18 2.2}
f5 {+0.30/9 0.7} 30. Nf6+ {+0.25/13 0.2} Nxf6 {+0.23/10 1.3} 31. gxf6
{-0.20/16 1.1} Re6 {+0.12/10 1.9} 32. d4 {+0.17/17 1.6} exd4 {-0.09/10 1.6}
33. Bxd4 {+0.22/17 0.2} c5 {-0.12/10 1.9} 34. Bb2 {+0.27/19 2.0} Bb7+
{-0.04/9 0.7} 35. f3 {+0.29/18 0.3} Bc6 {+0.20/9 0.7} 36. Bd3
{+0.31/16 0.6} Qf7 {-0.62/8 1.7} 37. Ne5 {+1.01/19 0.7} Qxf6 {-0.94/11 2.8}
38. Nxc6 {+1.59/18 0.4} Qg5+ {-1.29/11 1.5} 39. Kh3 {+2.46/19 0.4} Qxe3
{-1.70/11 2.1} 40. Ne5 {+2.38/22 2.8} Na5 {-1.71/10 1.4} 41. Bxf5
{+3.18/22 0.4} Rxe5 {-0.93/10 2.2} 42. Bxe5 {+3.08/23 0.6} Qxe5
{-3.25/11 1.8} 43. Bxg6 {+3.40/21 0.4} Be7 {-3.43/11 2.8} 44. Rh5
{+3.78/21 0.5} Qe6+ {-3.67/10 0.7} 45. Bf5 {+5.35/22 0.5} Qf7
{-5.33/11 1.5} 46. Bxh7+ {+5.61/21 0.4} Kh8 {-5.33/11 0.2} 47. Qf5
{+5.87/21 0.6} Rf8 {-6.77/12 2.4} 48. Qxf7 {+7.85/23 0.6} Rxf7
{-7.12/13 1.0} 49. Be4 {+8.50/23 0.7} Nc4 {-9.55/13 1.9} 50. Rd7
{+9.15/25 0.7} Nd6 {-10.87/13 1.6} 51. Bd5 {+10.71/27 1.1} Rh7
{-10.87/13 1.4} 52. Ra7 {+13.48/24 1.0} Nf7 {-11.23/13 1.3} 53. Be4
{+52.61/24 0.7} Rxh6 {-11.55/14 1.2} 54. Rxh6+ {+62.52/36 0.7} Nxh6
{-11.55/14 0.1} 55. Rxe7 {+67.65/38 0.8} Kg8 {-11.55/14 0.2} 56. Bd5+
{+71.87/38 0.8} Kh8 {-13.54/15 1.2} 57. Rd7 {+1000.12/39 0.7} Ng8
{-1000.09/14 1.6} 58. Rd8 {+1000.11/41 0.8} Kg7 {-16.80/13 1.4} 59. Bxg8
{+1000.10/41 0.9} Kf6 {-16.33/12 0.8} 60. Kg4 {+1000.09/42 0.9} Ke7
{-16.81/12 1.4} 61. Rd1 {+1000.08/43 0.7} c4 {-1000.07/13 1.1} 62. Bxc4
{+1000.07/46 0.8} Kf6 {-1000.06/12 0.2} 63. f4 {+1000.06/52 0.8} Kg6
{-1000.05/10 0.1} 64. Rd7 {+1000.05/85 0.8} Kf6 {-1000.04/12 0.2} 65. Bg8
{+1000.04/245 0.4} Kg6 {-1000.03/12 0.2} 66. Rf7 {+1000.03/245 0.4} Kh6
{-1000.02/63 0.1} 67. Kf5 {+1000.02/245 0.4} Kh5 {-1000.01/62 0.1} 68. Rh7#
{+1000.01/245 0.4}
{Xboard adjudication: Checkmate} 1-0
[Event "Computer Chess Game"]
[Site "VM-894787"]
[Date "2021.03.08"]
[Round "-"]
[White "Zappa Mexico II"]
[Black "Stockfish 13"]
[Result "1-0"]
[TimeControl "60+1"]
[Annotator "1. +0.20 1... -0.08"]

1. d4 {+0.20/12} c5 {-0.08/17 7} 2. d5 {+0.44/12 3} Nf6 {+0.01/15 1.8} 3.
Nc3 {+0.53/12 4} b5 {+0.00/18 9} 4. Nxb5 {+0.51/13 3} Qa5+ {-0.26/17 4} 5.
Nc3 {+0.51/12 0.1} Ne4 {-0.28/16 0.8} 6. Qd3 {+0.83/13 7} Nxc3
{-0.28/16 0.9} 7. Qxc3 {+1.01/14 4} Qxc3+ {+0.23/17 1.1} 8. bxc3
{+1.01/13 0.2} Ba6 {+0.00/23 5} 9. Nf3 {+1.05/13 3} g6 {-0.21/21 1.8} 10.
e4 {+1.03/14 3} Bxf1 {-0.21/22 5} 11. Rxf1 {+0.92/15 5} Bg7 {-0.21/20 1.1}
12. Rb1 {+0.99/14 2.9} Bxc3+ {-0.20/23 7} 13. Bd2 {+0.95/15 7} Bxd2+
{-0.17/20 1.0} 14. Kxd2 {+0.99/14 1.3} d6 {-0.17/21 1.4} 15. e5
{+0.91/13 1.2} dxe5 {+0.00/21 2.8} 16. Nxe5 {+1.14/14 1.6} Nd7
{-0.05/21 1.2} 17. Rfe1 {+1.21/12 1.3} Nxe5 {-0.14/21 1.2} 18. Rxe5
{+1.30/9 0.1} O-O-O {-0.14/23 1.2} 19. Rxe7 {+1.62/12 1.3} Rhe8
{-0.14/24 10} 20. Rxe8 {+2.51/12 1.1} Rxe8 {-0.14/24 3} 21. Re1
{+2.47/13 1.1} Rxe1 {-0.14/23 1.0} 22. Kxe1 {+3.53/8 0.2} Kd7
{-0.14/24 2.1} 23. Ke2 {+4.42/13 1.0} c4 {-0.14/22 1.3} 24. Ke3
{+4.48/14 0.9} c3 {-0.14/24 0.9} 25. Kd4 {+4.64/14 0.9} Kd6 {-0.14/25 0.9}
26. g4 {+5.58/15 1.5} f6 {-0.14/23 1.0} 27. f4 {+5.28/11 0.1} h6
{-7.67/27 9} 28. Kc4 {+9.37/15 1.5} Ke7 {-7.70/25 1.0} 29. Kxc3
{+9.39/10 0.1} Kd7 {-4.67/18 0.2} 30. Kd4 {+9.53/9 0.1} Kd6 {-8.21/24 2.2}
31. c4 {+11.66/14 2.0} Kc7 {-8.49/22 2.3} 32. Kc5 {+13.56/13 1.1} Kc8
{-9.17/22 1.3} 33. Kd6 {+15.59/13 0.9} g5 {-9.90/19 1.1} 34. f5
{+15.65/11 0.1} Kb7 {-12.63/21 0.5} 35. c5 {+16.53/10 0.1} Ka6
{-14.14/23 0.6} 36. Kc7 {+20.41/14 1.4} Kb5 {-11.13/18 0.3} 37. c6
{+20.41/13 0.1} Kb4 {-19.28/21 2.3} 38. d6 {+19.87/7 0.1} Ka3
{-28.46/19 1.3} 39. d7 {+20.22/9 0.1} h5 {-74.88/21 0.4} 40. d8=Q
{+1000.07/12 2.9} Kxa2 {-1000.06/31 0.6} 41. Kb7 {+1000.06/11 0.1} h4
{-1000.05/45 0.2} 42. Qd2+ {+1000.05/9 0.1} Kb3 {-1000.04/201 0.4} 43. c7
{+1000.04/13 0.1} h3 {-1000.03/245 0.4} 44. c8=Q {+1000.03/63 0.1} a6
{-1000.02/245 0.4} 45. Qcc2+ {+1000.02/63 0.1} Ka3 {-1000.01/245 0.4} 46.
Qa2# {+1000.01/63 0.1}
{Xboard adjudication: Checkmate} 1-0

[Event "Computer Chess Game"]
[Site "VM-894787"]
[Date "2021.03.08"]
[Round "-"]
[White "Zappa Mexico II"]
[Black "Stockfish 13"]
[Result "0-1"]
[TimeControl "60+1"]
[Annotator "1. +0.20 1... -0.08"]

1. d4 {+0.20/12} c5 {-0.08/17 7} 2. d5 {+0.44/12 3} Nf6 {+0.01/17 4} 3. Nc3
{+0.45/12 4} d6 {+0.29/15 3} 4. e4 {+0.39/12 3} a6 {+0.31/14 0.7} 5. a4
{+0.42/12 2.8} Qa5 {-0.33/18 10} 6. Bd2 {+0.52/12 6} Qc7 {-0.28/17 5} 7. f4
{+0.71/11 2.7} e6 {+0.16/17 2.3} 8. Bc4 {+0.62/12 4} exd5 {+0.24/19 2.5} 9.
Nxd5 {+0.60/13 2.7} Nxd5 {-0.27/19 2.0} 10. exd5 {+0.60/13 4} Be7
{+0.29/17 0.9} 11. Nf3 {+0.57/13 4} O-O {+0.29/17 1.5} 12. O-O
{+0.27/13 10} Nd7 {+0.29/17 1.1} 13. Ra3 {+0.39/11 1.0} Rb8 {+0.25/21 8}
14. Re1 {+0.73/11 1.4} Bf6 {+0.28/19 1.3} 15. Rb3 {+0.78/11 1.0} b5
{+0.26/21 1.9} 16. axb5 {+1.00/8 0.1} axb5 {+0.26/20 1.2} 17. Rxb5
{+0.51/12 1.4} Ra8 {+0.21/19 1.5} 18. Qe2 {+0.48/11 1.0} h6 {+0.21/23 11}
19. Rb3 {+0.69/11 1.0} Nb6 {+0.20/19 0.7} 20. Bc3 {+0.74/11 1.5} Bxc3
{+0.17/21 0.9} 21. Rxc3 {+0.74/11 0.2} Nxc4 {+0.19/22 6} 22. Qxc4
{+0.81/8 0.2} Ba6 {+0.18/19 0.6} 23. Qe4 {+0.62/11 0.9} Qb7 {-0.16/22 6}
24. Rb3 {+0.93/13 1.5} Qd7 {+0.16/17 0.2} 25. Rbe3 {+0.89/13 1.7} Rae8
{+0.19/17 0.3} 26. Qxe8 {+0.89/11 0.1} Rxe8 {+0.15/18 0.5} 27. Rxe8+
{+0.89/12 0.1} Kh7 {+0.13/19 0.4} 28. Rb8 {+0.90/12 3} Qa7 {+0.20/21 1.3}
29. Ree8 {+1.25/11 1.7} c4+ {+0.16/21 2.2} 30. Kh1 {+1.18/12 1.4} Kg6
{+0.00/24 2.6} 31. Ra8 {+0.92/10 1.2} Qb7 {+0.13/18 0.2} 32. Reb8
{+1.07/11 1.5} Qc7 {+0.00/18 0.3} 33. Rb4 {+1.07/12 1.9} Bc8 {+0.00/18 0.3}
34. c3 {+1.03/11 2.2} Bf5 {+0.00/17 0.5} 35. Ra6 {+1.24/11 1.3} Qe7
{+0.19/18 0.4} 36. Rxc4 {+1.19/11 1.2} Qe2 {+0.19/21 0.6} 37. Rxd6+
{+0.00/11 1.4} Kh5 {+3.81/21 0.6} 38. b3 {-2.23/11 3} Bh3 {+4.14/24 0.5}
39. gxh3 {-5.21/12 2.5} Qxf3+ {+4.38/22 0.6} 40. Kg1 {-5.21/12 0.1} Kh4
{+4.55/23 0.6} 41. Ra4 {-5.34/12 1.4} Kxh3 {+4.86/21 0.6} 42. Ra2
{-6.01/13 2.1} Qxc3 {+4.95/23 0.7} 43. Kf2 {-6.33/12 2.0} Qc5+
{+5.05/21 0.8} 44. Ke2 {-6.33/13 2.2} Qxd6 {+5.21/18 0.7} 45. Rd2
{-6.33/12 0.1} g5 {+5.53/20 1.2} 46. fxg5 {-7.01/12 1.0} hxg5
{+6.98/20 1.2} 47. Kd1 {-7.00/12 2.4} f5 {+7.48/19 0.7} 48. b4 {-7.96/13 3}
f4 {+8.01/20 0.7} 49. Kc2 {-8.29/13 2.1} f3 {+9.01/20 0.7} 50. Rd3
{-9.47/11 1.3} g4 {+12.38/21 1.0} 51. Rd2 {-10.87/11 1.5} Qf4
{+48.64/21 1.0} 52. d6 {-13.18/10 1.9} f2 {+80.32/27 0.7} 53. Rxf2
{-18.23/11 1.6} Qxf2+ {+1000.11/31 0.9} 54. Kd3 {-18.95/11 1.4} Qxh2
{+1000.09/40 0.8} 55. d7 {-19.52/9 1.3} Qd6+ {+1000.08/51 0.8} 56. Kc4
{-1000.08/11 1.2} Qxd7 {+1000.07/60 0.8} 57. b5 {-1000.06/12 0.6} g3
{+1000.06/66 0.8} 58. Kb4 {-1000.05/11 0.1} g2 {+1000.05/125 0.8} 59. Ka4
{-1000.04/13 0.1} g1=Q {+1000.04/245 0.5} 60. Kb4 {-1000.03/37 0.1} Qgd4+
{+1000.03/245 0.4} 61. Ka3 {-1000.02/63 0.2} Q7a7+ {+1000.02/245 0.4} 62.
Kb3 {-1000.01/63 0.2} Qaa4# {+1000.01/245 0.4}
{Xboard adjudication: Checkmate} 0-1



[/pgn]
Image