Mayhem NNUE - New NN engine

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

Moderators: hgm, Rebel, chrisw

AndrewGrant
Posts: 1754
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 »

jorose wrote: Thu Oct 29, 2020 2:46 pm Perhaps it makes most sense to start with copy pasting the author list.
That would be a unique engine! Houdart and Norman never thought to copy the author list! Maybe that was what was needed to edge out SF?
#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 »

jorose wrote: Thu Oct 29, 2020 2:46 pm I feel like the logical next step for programmers to consider is copy pasting Stockfish's search into their program as well. I am sure that is also worth a couple hundred Elo! Also why not the board representation, move generation, uci options etc, since those are all just boilerplate anyways?

Perhaps it makes most sense to start with copy pasting the author list.
Whehehe.... that made me laugh :lol:
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Mayhem NNUE - New NN engine

Post by maksimKorzh »

I feel like that the next author who incorporates NNUE into his engine would get banned from this forum forever.

Why do you hate these engines so much?
Why not just ignore these threads?

People are free to do what they want and post what fits the forum principals.


Everyone already knows who hates using sf nnue and why, so why to say again the same?
JohnWoe
Posts: 491
Joined: Sat Mar 02, 2013 11:31 pm

Re: Mayhem NNUE - New NN engine

Post by JohnWoe »

I've pushed (not tagged yet) Mayhem 0.48. I replaced 3fold -> 2fold reps. That's the dumbest rule in chess anyway. So it shuffles less in won endgames and is a bit stronger/faster.
jorose wrote: Thu Oct 29, 2020 2:46 pm
BrendanJNorman wrote: Fri Oct 23, 2020 5:26 am
JohnWoe wrote: Thu Oct 22, 2020 11:40 pm This proves that handcrafted evaluations are all crap.
This will cause enough heads here to shake that it'll cause an earthquake. :lol:

Maybe a better way to express yourself is "this proves that copy and pasting Stockfish's evaluation into other engines is superior to using your own".

Something we already knew haha.

But even doing this is only sufficient if the goal is strength.

As an end-user, I'm getting more and more bored of the wave of Stockfish NNUEs being plugged into other engines.

And even Frank Q has switched to testing for style rather than strength.

I feel like if the trend for programmers is to copy/pasting SF NNUE, most of the end-users will also move in another direction and test older or different engines.

Or perhaps I'm misunderstanding what exactly NNUE is...I dunno.
I feel like the logical next step for programmers to consider is copy pasting Stockfish's search into their program as well. I am sure that is also worth a couple hundred Elo! Also why not the board representation, move generation, uci options etc, since those are all just boilerplate anyways?

Perhaps it makes most sense to start with copy pasting the author list.
I agree.
Mayhem isn't 100% my code so it shouldn't appear on rating lists!
Once I have my own EvalFile + nuue evaluation then maybe!
I take lots of pride of my work!

It's kinda sad see NNUE beating my old engine 10-0 Blitz games. All my efforts in tuning Sapeli's HCE were all in vain. Shows how important good evaluation is.
[pgn][Event "Computer Chess Game"]
[Site "pc"]
[Date "2020.10.29"]
[Round "-"]
[White "Mayhem NNUE 0.48"]
[Black "Sapeli 1.92"]
[Result "1-0"]
[TimeControl "40/60"]
[Annotator "1. +0,32 1... -0,06"]

1. d4 {+0,32/10} d5 {-0,06/10 2,0} 2. c4 {+0,41/10 1,9} dxc4 {+0,22/11 1,9}
3. Nf3 {+0,31/10 1,9} Qd6 {+0,35/10 1,9} 4. e4 {+2,31/9 1,8} Qb4+
{+0,34/10 1,8} 5. Bd2 {+4,61/11 1,7} Qxb2 {+0,08/11 1,7} 6. Nc3
{+4,78/9 1,7} Nf6 {+0,13/9 1,7} 7. Rb1 {+7,67/9 1,6} Qa3 {-2,51/11 1,6} 8.
Nb5 {+9,06/10 1,6} Qxa2 {-2,51/11 1,6} 9. Nxc7+ {+9,06/9 1,5} Kd8
{-2,51/11 1,5} 10. Ra1 {+9,48/10 1,5} Qxa1 {-1,72/11 1,5} 11. Qxa1
{+12,84/11 1,4} Kxc7 {-1,94/10 1,4} 12. Ng5 {+13,38/10 1,4} Be6
{-1,97/10 1,4} 13. d5 {+13,88/9 1,4} Bg4 {-2,31/9 1,4} 14. Bxc4
{+15,71/8 1,4} Bh5 {-1,75/9 1,4} 15. Be2 {+15,00/8 1,4} Bg6 {-1,76/9 1,4}
16. O-O {+14,58/8 1,4} b6 {-1,63/8 1,4} 17. Rc1+ {+15,83/7 1,4} Kd8
{-4,75/10 1,4} 18. Qc3 {+19,24/8 1,4} Na6 {-4,83/10 1,4} 19. Bxa6
{+20,52/8 1,4} Nxd5 {-104,85/9 0,3} 20. exd5 {+104,85/8 0,9} Bc2
{-104,85/7 0,1} 21. Qxc2 {+104,85/6 0,1} f6 {-104,85/5 0,1} 22. Qc7+
{+104,85/4 0,1} Ke8 23. Bb5# {+104,85/3 0,1}
{Xboard adjudication: Checkmate} 1-0[/pgn]
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Mayhem NNUE - New NN engine

Post by maksimKorzh »

JohnWoe wrote: Thu Oct 29, 2020 9:59 pm I've pushed (not tagged yet) Mayhem 0.48. I replaced 3fold -> 2fold reps. That's the dumbest rule in chess anyway. So it shuffles less in won endgames and is a bit stronger/faster.
jorose wrote: Thu Oct 29, 2020 2:46 pm
BrendanJNorman wrote: Fri Oct 23, 2020 5:26 am
JohnWoe wrote: Thu Oct 22, 2020 11:40 pm This proves that handcrafted evaluations are all crap.
This will cause enough heads here to shake that it'll cause an earthquake. :lol:

Maybe a better way to express yourself is "this proves that copy and pasting Stockfish's evaluation into other engines is superior to using your own".

Something we already knew haha.

But even doing this is only sufficient if the goal is strength.

As an end-user, I'm getting more and more bored of the wave of Stockfish NNUEs being plugged into other engines.

And even Frank Q has switched to testing for style rather than strength.

I feel like if the trend for programmers is to copy/pasting SF NNUE, most of the end-users will also move in another direction and test older or different engines.

Or perhaps I'm misunderstanding what exactly NNUE is...I dunno.
I feel like the logical next step for programmers to consider is copy pasting Stockfish's search into their program as well. I am sure that is also worth a couple hundred Elo! Also why not the board representation, move generation, uci options etc, since those are all just boilerplate anyways?

Perhaps it makes most sense to start with copy pasting the author list.
I agree.
Mayhem isn't 100% my code so it shouldn't appear on rating lists!
Once I have my own EvalFile + nuue evaluation then maybe!
I take lots of pride of my work!

It's kinda sad see NNUE beating my old engine 10-0 Blitz games. All my efforts in tuning Sapeli's HCE were all in vain. Shows how important good evaluation is.
[pgn][Event "Computer Chess Game"]
[Site "pc"]
[Date "2020.10.29"]
[Round "-"]
[White "Mayhem NNUE 0.48"]
[Black "Sapeli 1.92"]
[Result "1-0"]
[TimeControl "40/60"]
[Annotator "1. +0,32 1... -0,06"]

1. d4 {+0,32/10} d5 {-0,06/10 2,0} 2. c4 {+0,41/10 1,9} dxc4 {+0,22/11 1,9}
3. Nf3 {+0,31/10 1,9} Qd6 {+0,35/10 1,9} 4. e4 {+2,31/9 1,8} Qb4+
{+0,34/10 1,8} 5. Bd2 {+4,61/11 1,7} Qxb2 {+0,08/11 1,7} 6. Nc3
{+4,78/9 1,7} Nf6 {+0,13/9 1,7} 7. Rb1 {+7,67/9 1,6} Qa3 {-2,51/11 1,6} 8.
Nb5 {+9,06/10 1,6} Qxa2 {-2,51/11 1,6} 9. Nxc7+ {+9,06/9 1,5} Kd8
{-2,51/11 1,5} 10. Ra1 {+9,48/10 1,5} Qxa1 {-1,72/11 1,5} 11. Qxa1
{+12,84/11 1,4} Kxc7 {-1,94/10 1,4} 12. Ng5 {+13,38/10 1,4} Be6
{-1,97/10 1,4} 13. d5 {+13,88/9 1,4} Bg4 {-2,31/9 1,4} 14. Bxc4
{+15,71/8 1,4} Bh5 {-1,75/9 1,4} 15. Be2 {+15,00/8 1,4} Bg6 {-1,76/9 1,4}
16. O-O {+14,58/8 1,4} b6 {-1,63/8 1,4} 17. Rc1+ {+15,83/7 1,4} Kd8
{-4,75/10 1,4} 18. Qc3 {+19,24/8 1,4} Na6 {-4,83/10 1,4} 19. Bxa6
{+20,52/8 1,4} Nxd5 {-104,85/9 0,3} 20. exd5 {+104,85/8 0,9} Bc2
{-104,85/7 0,1} 21. Qxc2 {+104,85/6 0,1} f6 {-104,85/5 0,1} 22. Qc7+
{+104,85/4 0,1} Ke8 23. Bb5# {+104,85/3 0,1}
{Xboard adjudication: Checkmate} 1-0[/pgn]
Hmmm... it's a bit confusing that you've removed 3 fold reps - when I've tried that my engine started drawing winning positions...
JohnWoe
Posts: 491
Joined: Sat Mar 02, 2013 11:31 pm

Re: Mayhem NNUE - New NN engine

Post by JohnWoe »

maksimKorzh wrote: Thu Oct 29, 2020 10:05 pm
JohnWoe wrote: Thu Oct 29, 2020 9:59 pm I've pushed (not tagged yet) Mayhem 0.48. I replaced 3fold -> 2fold reps. That's the dumbest rule in chess anyway. So it shuffles less in won endgames and is a bit stronger/faster.
jorose wrote: Thu Oct 29, 2020 2:46 pm
BrendanJNorman wrote: Fri Oct 23, 2020 5:26 am
JohnWoe wrote: Thu Oct 22, 2020 11:40 pm This proves that handcrafted evaluations are all crap.
This will cause enough heads here to shake that it'll cause an earthquake. :lol:

Maybe a better way to express yourself is "this proves that copy and pasting Stockfish's evaluation into other engines is superior to using your own".

Something we already knew haha.

But even doing this is only sufficient if the goal is strength.

As an end-user, I'm getting more and more bored of the wave of Stockfish NNUEs being plugged into other engines.

And even Frank Q has switched to testing for style rather than strength.

I feel like if the trend for programmers is to copy/pasting SF NNUE, most of the end-users will also move in another direction and test older or different engines.

Or perhaps I'm misunderstanding what exactly NNUE is...I dunno.
I feel like the logical next step for programmers to consider is copy pasting Stockfish's search into their program as well. I am sure that is also worth a couple hundred Elo! Also why not the board representation, move generation, uci options etc, since those are all just boilerplate anyways?

Perhaps it makes most sense to start with copy pasting the author list.
I agree.
Mayhem isn't 100% my code so it shouldn't appear on rating lists!
Once I have my own EvalFile + nuue evaluation then maybe!
I take lots of pride of my work!

It's kinda sad see NNUE beating my old engine 10-0 Blitz games. All my efforts in tuning Sapeli's HCE were all in vain. Shows how important good evaluation is.
Hmmm... it's a bit confusing that you've removed 3 fold reps - when I've tried that my engine started drawing winning positions...
Different programs, different behaviours. In Mayhem I see more straightforward play now. I see no reason repeat a position once. Then choose the right path. Why not to go for the right path right away? Maybe 2fold is against FIDE rules. Then so be it.
AndrewGrant
Posts: 1754
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 »

maksimKorzh wrote: Thu Oct 29, 2020 9:50 pm I feel like that the next author who incorporates NNUE into his engine would get banned from this forum forever.

Why do you hate these engines so much?
Why not just ignore these threads?

People are free to do what they want and post what fits the forum principals.


Everyone already knows who hates using sf nnue and why, so why to say again the same?
I'll assume this is to me? I don't hate NNUE. I wrote my own NN/NNUE trainer the other weekend and included some others on the project.

I don't even hate SF NNUE. I hate people pretending that copy pasting SF NNUE makes them original. Sorry to say to you, but BBC (that acronym was a poor choice) was original before you added NNUE, and now is nothing special at all.
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
supersharp77
Posts: 1242
Joined: Sat Jul 05, 2014 7:54 am
Location: Southwest USA

Re: Mayhem NNUE - New NN engine

Post by supersharp77 »

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
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Mayhem NNUE - New NN engine

Post by maksimKorzh »

AndrewGrant wrote: Thu Oct 29, 2020 10:49 pm
maksimKorzh wrote: Thu Oct 29, 2020 9:50 pm I feel like that the next author who incorporates NNUE into his engine would get banned from this forum forever.

Why do you hate these engines so much?
Why not just ignore these threads?

People are free to do what they want and post what fits the forum principals.


Everyone already knows who hates using sf nnue and why, so why to say again the same?
I'll assume this is to me? I don't hate NNUE. I wrote my own NN/NNUE trainer the other weekend and included some others on the project.

I don't even hate SF NNUE. I hate people pretending that copy pasting SF NNUE makes them original. Sorry to say to you, but BBC (that acronym was a poor choice) was original before you added NNUE, and now is nothing special at all.
No Andy, it wasn't to you. You've shown tolerance instead. You respect other's work even if you don't understand it's purpose.

BBC is the name chosen to get more views on youtube. Btw I'm now heavily working out neural networks now to create leela type engine tutorial one day and guess the name for that project - CNN (chess neural network)

You judge people's work only from competition perspective IMO and from that perspective embedding sf nnue doesn't make sense indeed. I judge people's work from self growing perspective, e.g. for me connecting sf nnue wasn't that trivial. I wouldn't manage to do it without Daniel's library. And probably same for these new authors - they are happy to share their small win but getting criticism and almost insults in return - that is unfair. I understand that for man of your skills this nnue copypasting how you call it is totally poiintless. But in this world noobs like me also exists and my work is dedicated for them. You just try to understand that to get use and insights from Ethereal man needs to become damn good programmer first, e.g. I can understand probably 10% of your code hence in practice no matter how damn cool Ethereal is for noob like me it's totally pointless. Actually all engines stronger then 2500 doesn't help me to understand something.

Now for comparison if man comes across my youtube series he might end up with writing an engine from scratch even if has just started learning to code! And this is how BBC unique. Say why is it better than VICE? Not because it's faster or has bitboards - it's better because it's written in so damn simple C that you can't simplify it more. It's unique because it has every single line of code commented. It describes every data structure that one can have doubts of it's structure. BBC is like CPW on youtube but not the CPW for smart guys like you but a CPW for noobs like me making it possible for everyone to touch the chess programming regardless of skill level.

Ethereal made chess programming god-level unreachable.
BBC made chess programming for everyone.

Maybe one day people understand the difference in goals.
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Mayhem NNUE - New NN engine

Post by maksimKorzh »

JohnWoe wrote: Thu Oct 29, 2020 10:39 pm
maksimKorzh wrote: Thu Oct 29, 2020 10:05 pm
JohnWoe wrote: Thu Oct 29, 2020 9:59 pm I've pushed (not tagged yet) Mayhem 0.48. I replaced 3fold -> 2fold reps. That's the dumbest rule in chess anyway. So it shuffles less in won endgames and is a bit stronger/faster.
jorose wrote: Thu Oct 29, 2020 2:46 pm
BrendanJNorman wrote: Fri Oct 23, 2020 5:26 am
JohnWoe wrote: Thu Oct 22, 2020 11:40 pm This proves that handcrafted evaluations are all crap.
This will cause enough heads here to shake that it'll cause an earthquake. :lol:

Maybe a better way to express yourself is "this proves that copy and pasting Stockfish's evaluation into other engines is superior to using your own".

Something we already knew haha.

But even doing this is only sufficient if the goal is strength.

As an end-user, I'm getting more and more bored of the wave of Stockfish NNUEs being plugged into other engines.

And even Frank Q has switched to testing for style rather than strength.

I feel like if the trend for programmers is to copy/pasting SF NNUE, most of the end-users will also move in another direction and test older or different engines.

Or perhaps I'm misunderstanding what exactly NNUE is...I dunno.
I feel like the logical next step for programmers to consider is copy pasting Stockfish's search into their program as well. I am sure that is also worth a couple hundred Elo! Also why not the board representation, move generation, uci options etc, since those are all just boilerplate anyways?

Perhaps it makes most sense to start with copy pasting the author list.
I agree.
Mayhem isn't 100% my code so it shouldn't appear on rating lists!
Once I have my own EvalFile + nuue evaluation then maybe!
I take lots of pride of my work!

It's kinda sad see NNUE beating my old engine 10-0 Blitz games. All my efforts in tuning Sapeli's HCE were all in vain. Shows how important good evaluation is.
Hmmm... it's a bit confusing that you've removed 3 fold reps - when I've tried that my engine started drawing winning positions...
Different programs, different behaviours. In Mayhem I see more straightforward play now. I see no reason repeat a position once. Then choose the right path. Why not to go for the right path right away? Maybe 2fold is against FIDE rules. Then so be it.
I see your point. Well, if it works for you like this then I'm happy)