SlowChess Blitz Classic 2.0

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

Moderators: hgm, Rebel, chrisw

jonkr
Posts: 178
Joined: Wed Nov 13, 2019 1:36 am
Full name: Jonathan Kreuzer

Re: SlowChess Blitz Classic 2.0

Post by jonkr »

I am planning to continue experiment with chess, just given slower rate of progress (making the time spent-per-elo equation not very exciting), and plans to try stuff that will initially make it weaker, I can't be sure if anything better we come from it.

I think the initial Blitz Classic 1.0 public release was June 2019, but started working on it again almost 2 years ago. Still I made way more progress than I initially expected, I was just hoping to clearly beat Fruit 2.1 when I started, and for a short time it dropped to just a bit above fairyMax level because I was converting a lot of stuff. (Bitboards for MoveGen and eval, computing evaluation symetrically for either color, "fixing" the old horrible code, and there were a lot of bugs. One of the bugs I remember from this time is I wasn't clearing my movelist, and each generation stage would just add more moves on the end.)

Figuring out how to code and train a simple Neural Net for Pawn Structure is the current item on my list. Then see if I have it output multiple values that represent human readable concepts for the structure and use it in the evaluation. Then maybe try some specific endgame training to see if it improves in a smaller game space, like rook endgames. (And could very easily use these instead of normal eval when appropriate.) Also my random hope is to train for mate-finding and see obvious improvements there, since I find that interesting and many engines settle for trolling type close outs especially neural net ones.

Also just training and experimenting with the best training process like I mentioned before. Trying without lichess.epd, from all 0 positional values, I got Dev up to 40 elo weaker than 2.3, but I had to manually set initial values for some of the complicated terms/multipliers to get them moving, and I left the piece sq tables at the 2.3 values, which is something prone to overfitting without enough varied data. So I want to try making it so it can be fully automated. It was interesting how some values got pretty different, but may have fit together about the same.

I saw the Ethereal tuning post, like most posts/articles I skim it, but unless I sit down to work on something related I usually miss/forget key points. Is the Ethereal method scoring positions by search or by game result? I think it said it performed a search, but don't know if that was used for scoring. I've been suspicious of game results for super fast games, some can be pretty wrong.
karger
Posts: 218
Joined: Tue Feb 02, 2010 2:27 am
Full name: John Karger

Re: SlowChess Blitz Classic 2.0

Post by karger »

This engines style of play is amazing. It plays combos & positions no other engines , AB or NN or NN/AB hybrid , use or even consider making. Bravo ... Most unique engine ever.
User avatar
AdminX
Posts: 6340
Joined: Mon Mar 13, 2006 2:34 pm
Location: Acworth, GA

Re: SlowChess Blitz Classic 2.0

Post by AdminX »

I have only played / viewed to games using this engine, but I very much enjoy it's style of play. Here is a game that just finished with SlowChess using only 2 threads of my laptop i7-8550U vs LC0 running on a RTX 2070 Super,

[pgn]
[Event "Banksia game"]
[Date "2020.09.08"]
[White "SlowChess Blitz 2.3"]
[Black "LC0 J92-100"]
[Result "1/2-1/2"]
[TimeControl "40/1800+3"]
[Time "13:27:01"]
[Termination "repetition"]
[ECO "C53"]
[Opening "Giuoco Piano"]

1. e4 e5 {-0.10/12 27.4 185984 309/309/382} 2. Nf3 Nc6 {-0.11/16 27.1 323452 300/320/380}
3. Bc4 Bc5 {-0.06/10 43.3 445366 319/315/366} 4. c3 Nf6 {-0.06/11 40.1 489323 319/315/366; C53: Giuoco Piano}
5. d3 d6 {-0.07/10 76.2 1220378 320/310/370} 6. Bb3 a5 {-0.05/9 69.6 741237 315/331/354}
7. O-O {+0.16/25 54.2 37550353} O-O {-0.04/11 14.3 546872 309/348/343} 8. Nbd2 Be6 {+0.00/10 72.8 718068 313/368/319}
9. Re1 Bxb3 {-0.01/11 62.9 661149 303/386/311} 10. Qxb3 a4 {+0.01/11 22.2 307822 303/405/292}
11. Qc2 d5 {+0.03/11 34.7 554776 303/416/281} 12. Nf1 h6 {+0.02/10 33.5 543920 296/426/278}
13. Be3 {+0.20/27 63.4 71138698} Bd6 {+0.03/11 57.9 1224711 291/442/267} 14. h3 {+0.08/26 84.0 112969156} Qd7 {+0.04/11 42.0 665529 295/443/262}
15. Bd2 {+0.01/25 45.5 62713354} dxe4 {+0.06/10 59.9 686273 289/466/245} 16. dxe4 {+0.16/26 62.9 85681654} Ne7 {+0.07/10 14.0 1122519 293/468/239}
17. Rad1 {+0.01/27 63.3 68814974} Qc6 {+0.11/9 98.3 1204601 300/479/221} 18. Rc1 {+0.00/28 63.3 70655084} Ng6 {+0.12/9 49.2 656863 307/477/216}
19. c4 {-0.01/30 63.3 36952708} Bc5 {+0.10/10 63.2 1183827 300/474/226} 20. Bc3 {+0.00/30 63.3 80638327} Bd6 {+0.12/10 46.1 497482 298/494/208}
21. Bd2 {+0.00/33 63.3 78903046} Bc5 {+0.10/10 39.0 1090404 300/478/222} 22. Bc3 {+0.00/31 63.3 38231508} Rfe8 {+0.10/10 54.9 687160 288/496/216}
23. Ng3 {+0.00/31 63.3 71963528} Bf8 {+0.09/9 43.0 1229732 271/522/207} 24. b3 {+0.00/32 63.3 64577796} axb3 {+0.08/9 24.1 1083005 256/547/197}
25. axb3 {+0.00/32 63.3 36561450} Rab8 {+0.08/9 74.9 1501522 240/578/182} 26. Bd2 {+0.08/28 63.3 64944366} b6 {+0.08/8 39.9 653201 245/568/187}
27. Ra1 {+0.02/28 102.9 121709679} Ra8 {+0.06/8 64.7 768781 236/577/187} 28. Red1 {+0.02/30 60.6 52050595} Bd6 {+0.08/8 47.9 573188 242/572/186}
29. Kh2 {-0.02/30 60.6 81616523} Rxa1 {+0.08/9 23.6 402861 237/584/179} 30. Rxa1 {-0.01/29 38.8 61062030} Nf8 {+0.07/10 44.3 958189 243/569/188}
31. Bc3 {+0.20/30 62.5 78211546} g6 {+0.07/9 40.2 440479 240/576/184} 32. Ra7 {+0.40/29 62.5 70051869} h5 {+0.09/11 44.2 352236 263/545/192}
33. Qd3 {+0.00/29 62.5 71884462} Qd7 {+0.09/13 0.5 637302 256/556/188} 34. Qb1 {+0.00/27 62.5 84285430} Qd8 {+0.08/15 115.5 1004940 264/534/202}
35. Kg1 {+0.01/28 62.5 91506597} Ne6 {+0.06/23 0.4 827653 250/544/206} 36. b4 {-0.01/28 62.5 85122849} Qe7 {+0.09/13 103.5 752463 258/553/189}
37. Qb2 {+0.02/29 62.5 76665959} Nh7 {+0.12/13 26.1 242421 282/524/194} 38. Nf1 {-0.01/30 62.5 83934810} Nhg5 {+0.08/17 27.1 635409 243/571/186}
39. Nxg5 {-0.02/32 62.5 89411685} Qxg5 {+0.07/16 0.5 872006 227/597/176} 40. Ne3 {-0.01/32 62.5 53423077} Rd8 {+0.07/17 0.5 1199924 218/616/166}
41. Ra2 {+0.00/31 48.5 61451688} Qh4 {+0.07/8 1.3 1142381 191/670/139} 42. Bxe5 {+0.00/32 48.5 59158718} Qxe4 {+0.07/15 44.5 1600333 176/699/125}
43. Bxd6 {+0.00/32 26.4 50735160} Rxd6 {+0.06/13 50.4 2169593 166/716/118} 44. Nd5 {+0.00/35 49.1 91248628} Qxc4 {+0.04/15 209.6 7075694 78/878/44}
45. Nf6+ {+0.00/36 49.1 56871256} Kf8 {+0.03/12 55.5 10795617 77/872/51} 46. Nh7+ {+0.00/39 49.1 69494169} Ke7 {+0.02/10 402.4 28793092 71/872/57}
47. Qf6+ {+0.00/38 49.1 29485885} Ke8 {+0.02/9 0.3 15923626 44/926/30} 48. Qh8+ {+0.00/38 49.1 96467886} Kd7 {+0.01/19 0.3 13050424 35/941/24}
49. Nf6+ {+0.00/38 46.9 77775632} Ke7 {+0.00/5 119.0 38998957 28/949/23} 50. Ng8+ {+0.00/42 49.2 86384346} Kd7 {+0.00/5 345.0 99274356 100/803/97}
51. Nf6+ {+0.00/41 49.2 44628314} Ke7 {+0.02/5 37.6 3719354 110/799/91} 52. Ng8+ {+0.00/44 35.2 64306417} Kd7 {+0.00/3 99.1 32856524 11/980/9}
53. Nf6+ {+0.00/54 49.6 84885895} 1/2-1/2
[/pgn]
"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers
jonkr
Posts: 178
Joined: Wed Nov 13, 2019 1:36 am
Full name: Jonathan Kreuzer

Re: SlowChess Blitz Classic 2.0

Post by jonkr »

Thanks, style can be hit or miss depending on opponent and what positions show up in a particular game, but in my biased opinion Slow can play some interesting chess. Sometimes I like watching it dismantle older engines in FRC (eg. Fruit 2.2, Slow Chess Classic 1.5, etc.) to remind myself of how it plays if the opposition isn't thwarting its plans. Engines like Stockfish or LC0 can seem to scare it into making bad moves and ruining its position, although I know I'm just not following the intricacies of that level of game.

I did make my own Neural Network class to play with, I found that understanding the value calculation of neural networks was more straightforward and way quicker to implement than I expected. The actual training is much much harder, so far I managed have a net learn a PieceSquareTable (slowly, even more slowly with a 3-layer network.) To implement neural net learning and training that can improve play seems daunting.
User avatar
pohl4711
Posts: 2435
Joined: Sat Sep 03, 2011 7:25 am
Location: Berlin, Germany
Full name: Stefan Pohl

Re: SlowChess Blitz Classic 2.0

Post by pohl4711 »

7000 games testrun of Slow Chess 2.3 finished. +11 Elo to Slow Chess 2.2

https://www.sp-cc.de

(Perhaps you have to clear your browsercache or reload the website)
jonkr
Posts: 178
Joined: Wed Nov 13, 2019 1:36 am
Full name: Jonathan Kreuzer

Re: SlowChess Blitz Classic 2.0

Post by jonkr »

I have released a SlowChess 2.4 on the SlowChess webpage.
It scored +20 elo in the 8-moves book versus SlowChess 2.3.
From the update notes:

Version 2.4 (+20 elo)
- Endgame neural nets for one piece endgames (King/Rook/pawns, KQps, KBps, KNps, KBps v KNps, KRps v KBps, KRps v KNps)
- A general endgame network for up to 2 pieces.
- Some general eval tuning
Notes :
The rook one the most trained, the least trained is probably the general but it was still a bit better than the handcrafted eval.
The material hash stores the index of which neural net if any to use when evaluating.
All the data files are in same directory as the exe now, and the nets/bitbases are packed into single files.
slow64 is AVX, there is noAvx, and noPop(/noAvx)

This is the first version with endgame neural nets. They can can provide pretty impressive play sometimes, but don't expect crazy strong endgame yet. I didn't finish training, it was still -37 elo to Stockfish 11 in the overall endgame test. I think up to -10 elo with only more training and bit more experimenting for how to arrange/generalize the nets would be easily possible (based on results of smaller subsets that I spent more time on.) However the computer time taken to train/test eventually started to seem less exciting since I don't have much resources and I stopped trying to keep my second computer running chess all the time, so after a while I figured should release what I have.

I do see some human-like qualities in the late endgame play and eval with neural nets now that I've been watching. How it will confidently keep a sure win, press its advantage and trade down when needed. Or recognize some sure draws to save itself that I expected would be too complicated for just board input. Also noticed connected passed pawns esp. with friendly king are even more important in rook + pawns endgames than I expected. One downside is sometimes might take a few more moves to win. I think I've mostly avoided endgame trolling that I really don't care for, but if I had time would try harder to make sure eval always a clear progression to win.

Anyway, the main reason releasing the moderate improvement is while I'm not abandoning chess or anything, working on something else sounds more interesting at this point. With the neural nets I wanted to experiment with a repeatable process that while not strictly "from zero", since it uses skilled opponents to reduce training time, was close enough that I could apply the same technique (and some of my same code) to other things. As I was figuring it out and just slowly training, trying out machine learning in other areas started to seem a more interesting experiment, since chess already has the NNUE code and nets for evaluating and learning and would take a long time for me to even start to get competitive with that. (Also eval I think is probably biggest and most chess specific part of strength and style, and it's possible that chess engines start to become all NNUE engines, and then maybe some search code starts to be considered as plugin library, since that's the other main part after eval, and I think I read here that in Shogi they use the SF search. It's not a big deal or unexpected, but is another reminder that at this point I'm making slow progress for relatively a lot of effort.) I do still want to try out stuff like adding midgame pawn structure NN and king safety related NN sometime.
User avatar
CMCanavessi
Posts: 1142
Joined: Thu Dec 28, 2017 4:06 pm
Location: Argentina

Re: SlowChess Blitz Classic 2.0

Post by CMCanavessi »

Nice !!! Awesome job!
Follow my tournament and some Leela gauntlets live at http://twitch.tv/ccls
AndrewGrant
Posts: 1754
Joined: Tue Apr 19, 2016 6:08 am
Location: U.S.A
Full name: Andrew Grant

Re: SlowChess Blitz Classic 2.0

Post by AndrewGrant »

jonkr wrote: Mon Nov 02, 2020 7:26 pm Version 2.4 (+20 elo)
- Endgame neural nets for one piece endgames (King/Rook/pawns, KQps, KBps, KNps, KBps v KNps, KRps v KBps, KRps v KNps)
What exactly was the structure of these Networks?

I tried very hard to do King+Rooks+Pawns, and found _maybe_ 2 elo.
I tried very hard to do King+Knight+Pawns, and found 0 elo.
I tried very hard to do King+Bishop+Pawns, and found 0 elo.
I tried very hard to do King+Queen+Pawns, and found 0 elo.

I had planned on doing a small NN for all of these endgames, but gave up in the end.
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
jonkr
Posts: 178
Joined: Wed Nov 13, 2019 1:36 am
Full name: Jonathan Kreuzer

Re: SlowChess Blitz Classic 2.0

Post by jonkr »

AndrewGrant wrote: Mon Nov 02, 2020 11:44 pm What exactly was the structure of these Networks?
For the one piece :

Code: Select all

	whiteInputCount = 64 + 48 + 32;// white uses horizontal symettry for king, 48 pawn squares, 64 squares for piece type
	blackInputCount = 64 + 48 + 64;

	network.SetInputCount(whiteInputCount + blackInputCount + 1); // +1 for side-to-move
	network.AddLayer(192, AT_RELU, LT_INPUT_TO_OUTPUTS);
	network.AddLayer(32, AT_RELU);
	network.AddLayer(32, AT_RELU);
	network.AddLayer(1, AT_LINEAR);
	network.Build();
The inputs are all 0 or 1 for PieceType on Square. The weights are all converted to int16 fixed point after training.
They are trained on the results of games played from endgame start positions that fit the type of endgame and positions from those games.
Rook endgames are by far the most common I found (even more so than I thought) and found the most elo there.
The general endgame is 224 first layer and for inputs has 64 squares for ROOK, 64 for BISHOP, and 64 for KNIGHT, in addition to King and Pawns. (But doesn't include queens.)
I just posted some more info in the technical discussion forum too.
AndrewGrant
Posts: 1754
Joined: Tue Apr 19, 2016 6:08 am
Location: U.S.A
Full name: Andrew Grant

Re: SlowChess Blitz Classic 2.0

Post by AndrewGrant »

jonkr wrote: Mon Nov 02, 2020 11:56 pm
AndrewGrant wrote: Mon Nov 02, 2020 11:44 pm What exactly was the structure of these Networks?
For the one piece :

Code: Select all

	whiteInputCount = 64 + 48 + 32;// white uses horizontal symettry for king, 48 pawn squares, 64 squares for piece type
	blackInputCount = 64 + 48 + 64;

	network.SetInputCount(whiteInputCount + blackInputCount + 1); // +1 for side-to-move
	network.AddLayer(192, AT_RELU, LT_INPUT_TO_OUTPUTS);
	network.AddLayer(32, AT_RELU);
	network.AddLayer(32, AT_RELU);
	network.AddLayer(1, AT_LINEAR);
	network.Build();
The inputs are all 0 or 1 for PieceType on Square. The weights are all converted to int16 fixed point after training.
They are trained on the results of games played from endgame start positions that fit the type of endgame and positions from those games.
Rook endgames are by far the most common I found (even more so than I thought) and found the most elo there.
The general endgame is 224 first layer and for inputs has 64 squares for ROOK, 64 for BISHOP, and 64 for KNIGHT, in addition to King and Pawns. (But doesn't include queens.)
I just posted some more info in the technical discussion forum too.
We both did the same thing then, mirroring in the dataset as well, except I never converted to int16_ts.
Would you be willing to run a test with all NNs enabled vs all NNs disabled, to get the cumulative impact?

I _had_ planned to go down this route exhaustively, but gave up, and then quite chess altogether.
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )