Mayhem NNUE - New NN engine

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

Moderators: hgm, Rebel, chrisw

JohnWoe
Posts: 491
Joined: Sat Mar 02, 2013 11:31 pm

Re: Mayhem NNUE - New NN engine

Post by JohnWoe »

supersharp77 wrote: Fri Oct 30, 2020 12:27 am
JohnWoe wrote: Thu Oct 22, 2020 11:40 pm Yes I copy pasted the NNUE from here and there. And what a difference does a good evaluation make. It completely annihilates Sapeli 1.92 Standard/Chess960 games!

Mayhem is Sapeli written in C++14 + SF NNUE evaluation. Thanks to Maksim simplifying off DirtyPiece/etc crap!
Release: https://github.com/SamuraiDangyo/mayhem ... /tag/v0.42
Contains a fast Linux binary.

At least +350 Elo stronger than Sapeli 1.92. This proves that handcrafted evaluations are all crap.

Code: Select all

5s
Score of Mayhem 0.42 NNUE vs Sapeli 1.92: 64 - 5 - 9  [0.878] 78
Elo difference: 343.19 +/- 109.68
Finished match

Score of Mayhem NNUE 0.42 vs Sapeli 1.92: 75 - 13 - 12  [0.810] 100
Elo difference: 251.89 +/- 80.80
Finished match

20s
Score of Mayhem NNUE 0.42 vs Sapeli 1.92: 7 - 1 - 2  [0.800] 10
Elo difference: 240.82 +/- nan
Finished match
I played a few test games on lichess. Mayhem annihilates sachy2 totally! 7½-½. Despite massive lag: https://lichess.org/k6wbI1sF

Mayhem NNUE nice analysis. Look how consistend 1. d4 is!

Code: Select all

info depth 1 nodes 40 time 1 nps 20000 score cp 69 pv d2d4
info depth 2 nodes 269 time 4 nps 53800 score cp 24 pv d2d4
info depth 3 nodes 1552 time 22 nps 67478 score cp 45 pv d2d4
info depth 4 nodes 5933 time 46 nps 126234 score cp 34 pv d2d4
info depth 5 nodes 18196 time 78 nps 230329 score cp 60 pv d2d4
info depth 6 nodes 66327 time 157 nps 419791 score cp 39 pv d2d4
info depth 7 nodes 156246 time 288 nps 540643 score cp 46 pv d2d4
info depth 8 nodes 648186 time 836 nps 774415 score cp 32 pv d2d4
info depth 9 nodes 1803245 time 1892 nps 952585 score cp 51 pv d2d4
info depth 10 nodes 8442083 time 7493 nps 1126512 score cp 32 pv d2d4
info depth 11 nodes 27943335 time 26254 nps 1064305 score cp 46 pv d2d4
Is there going to be a windows binary for any of these Mayhems? Only Linux binaries so far..Thx AR
I tagged 0.48. Contain a fast Windows binary. You need also an EvalFile. Either the one in the source code or by UCI EvalFile option.
There's a new stronger Stockfish net. Haven't tested it yet.

Release: https://github.com/SamuraiDangyo/mayhem ... /tag/v0.48
JohnWoe
Posts: 491
Joined: Sat Mar 02, 2013 11:31 pm

Re: Mayhem NNUE - New NN engine

Post by JohnWoe »

I dropped in the latest Stockfish net and enjoyed these sweet tasty easy Elo points. :lol:
Credits to the SF team!

Added better hashing scheme. Now no space is wasted. 256MB means 128M entries. That's massive. With NNUE Mayhem is searching 1.1Mnps.
2x faster than SF. Tho SF will crush Mayhem pretty easily.

Source code: https://github.com/SamuraiDangyo/mayhem
Release: https://github.com/SamuraiDangyo/mayhem ... /tag/v0.49

Fast static windows + unix compiles. Need the latest 21MB SF net.
Last edited by JohnWoe on Thu Nov 05, 2020 3:48 pm, edited 1 time in total.
jmartus
Posts: 256
Joined: Sun May 16, 2010 2:50 am

Re: Mayhem NNUE - New NN engine

Post by jmartus »

I hope the next tcec is not filled with copy and past nnue stockfish codes.
JohnWoe
Posts: 491
Joined: Sat Mar 02, 2013 11:31 pm

Re: Mayhem NNUE - New NN engine

Post by JohnWoe »

Mayhem 0.49 annihilates Fruit 2.1 in a blitz game!

Couldn't be more proud of my little program. After 21. Ne4 black's king is in crossfire. Good tactics flow from good positions. Mayhem finishes the game pretty nicely. I added 1 more sorting slot for quiet moves. Added to the massive search speed inherited from endless Sapeli cleanups. Means Fruit 2.1 is toast.

I still can't believe my little program beats a heavy weight. 2700 Elo on CCRL. Sapeli gave his life for a good cause.

[pgn][Event "Computer Chess Game"]
[Site "pc"]
[Date "2020.11.06"]
[Round "-"]
[White "Mayhem 0.49"]
[Black "Fruit 2.1"]
[Result "1-0"]
[TimeControl "40/60"]
[Annotator "1. +0,40 1... -0,18"]

1. d4 {+0,40/10} Nf6 {-0,18/11 2,2} 2. c4 {+0,47/10 1,9} e6 {+0,10/11 1,7}
3. Nf3 {+0,36/10 1,9} Bb4+ {+0,01/11 1,7} 4. Nbd2 {+0,56/10 1,8} Nc6
{-0,01/11 1,7} 5. a3 {+1,51/10 1,7} Be7 {-0,02/12 1,6} 6. b4 {+1,60/10 1,7}
O-O {+0,05/9 1,0} 7. e3 {+1,57/10 1,6} d5 {-0,09/10 1,3} 8. Be2
{+1,72/10 1,6} Ng4 {-0,02/9 1,6} 9. O-O {+2,65/9 1,5} Bd7 {-0,20/9 1,6} 10.
b5 {+3,01/9 1,5} Na5 {-0,24/10 1,6} 11. c5 {+2,88/9 1,4} e5 {-0,05/9 0,8}
12. dxe5 {+3,59/9 1,4} Bxc5 {-0,38/10 1,9} 13. h3 {+3,66/9 1,4} Nh6
{-0,39/10 1,6} 14. Bb2 {+3,30/9 1,4} Nf5 {-0,39/9 1,1} 15. Bd3
{+3,93/8 1,4} Bb6 {-0,51/9 1,1} 16. Qc2 {+4,75/9 1,4} g6 {-0,60/8 1,0} 17.
e4 {+4,47/9 1,4} Ne7 {-0,81/9 1,4} 18. Rad1 {+4,09/9 1,4} c6 {-0,65/9 1,1}
19. bxc6 {+3,68/9 1,4} Rc8 {-0,71/9 1,7} 20. exd5 {+3,26/8 1,4} Nxd5
{-0,61/8 0,6} 21. Ne4 {+4,54/8 1,4} Be6 {-1,35/9 5} 22. Qd2 {+7,24/8 1,4}
Kg7 {-1,84/8 2,0} 23. cxb7 {+6,59/8 1,4} Nxb7 {-1,64/8 1,2} 24. Bc1
{+6,93/8 1,4} Kh8 {-2,06/8 1,2} 25. Qh6 {+10,38/8 1,4} f5 {-2,82/8 1,4} 26.
exf6 {+10,35/8 1,4} Rxf6 {-4,33/8 4} 27. Bb2 {+13,45/9 1,4} Qf8
{-6,09/8 1,2} 28. Qh4 {+18,60/8 1,4} Bd8 {-4,33/8 1,1} 29. Nxf6
{+19,40/9 1,4} Bxf6 {-4,60/9 1,1} 30. Bxg6 {+19,60/9 1,4} Qg7 {-4,17/9 0,8}
31. Bxf6 {+18,98/10 1,4} Nxf6 {-4,11/8 0,3} 32. Bb1 {+19,83/9 1,4} Rc4
{-3,85/9 2,0} 33. Qg5 {+23,46/9 1,4} Rc5 {-4,08/9 1,2} 34. Qxg7+
{+20,81/10 1,4} Kxg7 {-3,93/4 0,1} 35. Rfe1 {+20,62/9 1,4} Bd5
{-4,30/9 1,8} 36. Nd4 {+23,31/9 1,4} Kf7 {-4,21/9 0,9} 37. Bf5
{+22,84/8 1,4} Nd6 {-4,21/9 1,1} 38. Be6+ {+25,91/9 1,4} Kg6 {-4,26/11 1,5}
39. Bxd5 {+27,15/9 1,4} Rxd5 {-4,17/11 0,6} 40. Ne2 {+26,46/10 1,4} Rxd1
{-4,04/12 1,5} 41. Rxd1 {+26,44/11 2,0} Nc4 {-4,13/12 1,2} 42. a4
{+26,61/10 1,9} h5 {-4,10/11 2,1} 43. Rb1 {+27,62/10 1,9} Ne4
{-4,29/12 1,9} 44. Rb8 {+27,51/10 1,8} a6 {-4,06/11 1,8} 45. Ra8
{+27,56/10 1,8} a5 {-4,23/12 1,7} 46. h4 {+27,22/9 1,7} Kf5 {-4,50/12 1,8}
47. f3 {+28,28/9 1,6} Nf6 {-4,64/12 1,0} 48. Rc8 {+28,45/10 1,6} Ne3
{-4,98/12 1,6} 49. Rc5+ {+28,61/9 1,5} Nfd5 {-5,14/14 1,5} 50. Kf2
{+28,58/9 1,5} Ke6 {-5,08/13 1,5} 51. Rxa5 {+28,70/9 1,4} Nf5
{-5,32/13 1,4} 52. Ra6+ {+28,82/9 1,4} Nd6 {-5,54/13 1,6} 53. g4
{+28,58/9 1,4} hxg4 {-5,33/12 1,2} 54. fxg4 {+28,26/9 1,4} Ke5
{-5,44/13 1,3} 55. Ra5 {+27,76/10 1,4} Nc4 {-5,43/12 1,4} 56. Rb5
{+27,93/10 1,4} Nd6 {-5,59/12 1,0} 57. Kf3 {+28,50/10 1,4} Nxb5
{-5,58/15 2,6} 58. axb5 {+27,65/12 1,4} Nb6 {-5,80/16 1,1} 59. Kg3
{+28,03/12 1,4} Nc4 {-5,96/16 2,6} 60. g5 {+26,42/11 1,4} Kf5
{-5,85/16 1,4} 61. Kh3 {+25,10/12 1,4} Kg6 {-5,81/15 1,4} 62. Kg4
{+21,32/12 1,4} Ne5+ {-5,94/15 1,3} 63. Kf4 {+25,17/12 1,4} Nc4
{-6,74/16 2,1} 64. Ng3 {+28,33/12 1,4} Kf7 {-11,40/19 12} 65. h5
{+26,86/11 1,4} Ke6 {-13,82/15 2,5} 66. Ne2 {+28,32/11 1,4} Nb6
{-7,41/14 0,7} 67. Nd4+ {+28,13/11 1,4} Kd5 {-15,58/15 5} 68. Nf5
{+27,54/12 1,4} Kc5 {-13,27/12 1,4} 69. Ne7 {+26,35/10 1,4} Kd6
{-10,43/13 0,3} 70. Ng6 {+27,39/11 1,4} Ke6 {-11,86/12 0,4} 71. Nh4
{+28,01/11 1,4} Nd5+ {-7,80/12 0,2} 72. Kg3 {+24,56/12 1,4} Kf7
{-7,73/12 0,4} 73. Nf3 {+24,78/11 1,4} Nb6 {-5,96/12 0,3} 74. Ne5+
{+26,02/11 1,4} Kg7 {-7,47/14 0,2} 75. Kh4 {+26,62/12 1,4} Nd5
{-12,80/16 0,9} 76. h6+ {+24,76/11 1,4} Kg8 {-12,80/13 0,5} 77. Kg4
{+25,91/11 1,4} Kh7 {-7,88/11 0,1} 78. Kf5 {+26,53/12 1,4} Ne7+
{-13,76/13 0,2} 79. Kf6 {+24,53/14 1,4} Nd5+ {-13,80/12 0,1} 80. Kf7
{+27,63/13 1,4} Nf4 {-14,22/12 0,1} 81. b6 {+28,34/13 2,0} Nh3
{-14,40/12 1,9} 82. Kf6 {+26,24/13 1,9} Nf2 {-21,10/12 1,8} 83. Kf5
{+27,99/13 1,9} Nd1 {-1000,06/34 1,1} 84. b7 {+28,30/12 1,8} Ne3+
{-1000,05/47 1,2} 85. Kf4 {+28,22/12 1,7} Nd5+ {-1000,05/49 1,4} 86. Kf3
{+104,85/11 0,8} Nc3 {-1000,04/45 1,1} 87. b8=Q {+104,85/7 0,1} Nb5
{-1000,03/43 1,0} 88. Qb7+ {+104,85/5 0,1} Nc7 {-1000,02/43 1,4} 89. Qxc7+
{+104,85/4 0,1} Kg8 {-1000,01/41 1,1} 90. Qg7# {+104,85/3 0,1}
{Xboard adjudication: Checkmate} 1-0[/pgn]
AndrewGrant
Posts: 1759
Joined: Tue Apr 19, 2016 6:08 am
Location: U.S.A
Full name: Andrew Grant

Re: Mayhem NNUE - New NN engine

Post by AndrewGrant »

jmartus wrote: Thu Nov 05, 2020 3:47 pm I hope the next tcec is not filled with copy and past nnue stockfish codes.
If it makes you feel any better, for many years TCEC had 3 versions of Stockfish, and you, most others, and even myself, were none the wiser.
So even if TCEC allows the influx as expected, it won't hurt the viewer :/
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Mayhem NNUE - New NN engine

Post by mvanthoor »

JohnWoe wrote: Thu Nov 05, 2020 11:37 pm I still can't believe my little program beats a heavy weight. 2700 Elo on CCRL. Sapeli gave his life for a good cause.
So you did take Sapeli off-line in Github to replace it by Mayhem? Pity. I liked Sapeli. It was a nice little engine, quite strong for its size. I made it a target to beat with Rustic. And, to do so by using the least amount of features possible... I'm going to try and see if I can beat TSCP by brute force...by NOT adding pawn knowledge and open files into my evaluation until after. I had a similar goal in mind for Sapeli, but now with Mayhem, it's of no use because your engine gained 500 Elo or thereabout overnight.

If you want to put your efforts into Mayhem, that's up to you; but why would you take Sapeli off-line because of that?
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
carldaman
Posts: 2283
Joined: Sat Jun 02, 2012 2:13 am

Re: Mayhem NNUE - New NN engine

Post by carldaman »

mvanthoor wrote: Fri Nov 06, 2020 2:31 am
JohnWoe wrote: Thu Nov 05, 2020 11:37 pm I still can't believe my little program beats a heavy weight. 2700 Elo on CCRL. Sapeli gave his life for a good cause.
So you did take Sapeli off-line in Github to replace it by Mayhem? Pity. I liked Sapeli. It was a nice little engine, quite strong for its size. I made it a target to beat with Rustic. And, to do so by using the least amount of features possible... I'm going to try and see if I can beat TSCP by brute force...by NOT adding pawn knowledge and open files into my evaluation until after. I had a similar goal in mind for Sapeli, but now with Mayhem, it's of no use because your engine gained 500 Elo or thereabout overnight.

If you want to put your efforts into Mayhem, that's up to you; but why would you take Sapeli off-line because of that?
+1

This copy+paste frenzy is not at all impressive, despite the Elo gains; something to stay away from, imho.
I also liked Sapeli.
Madeleine Birchfield
Posts: 512
Joined: Tue Sep 29, 2020 4:29 pm
Location: Dublin, Ireland
Full name: Madeleine Birchfield

Re: Mayhem NNUE - New NN engine

Post by Madeleine Birchfield »

Instead of copying and pasting somebody else's NNUE code, how about implementing the NNUE algorithm yourself, like what the Komodo, Halogen, and Seer authors did?
AndrewGrant
Posts: 1759
Joined: Tue Apr 19, 2016 6:08 am
Location: U.S.A
Full name: Andrew Grant

Re: Mayhem NNUE - New NN engine

Post by AndrewGrant »

Madeleine Birchfield wrote: Fri Nov 06, 2020 6:06 am Instead of copying and pasting somebody else's NNUE code, how about implementing the NNUE algorithm yourself, like what the Komodo, Halogen, and Seer authors did?
Halogen is not using NNUE.
We do not know how Komodo was trained.
I don't know about Seer.
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
Kieren Pearson
Posts: 70
Joined: Tue Dec 31, 2019 2:52 am
Full name: Kieren Pearson

Re: Mayhem NNUE - New NN engine

Post by Kieren Pearson »

Andrew is correct here. Halogen does not use NNUE. Is uses its own neural network architecture.