Andscacs nnue 0.1

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: Andscacs nnue 0.1

Post by AndrewGrant »

connor_mcmonigle wrote: Thu Jan 21, 2021 8:02 pm
Engin wrote: Thu Jan 21, 2021 5:31 pm
i don't mean you werner with you testing a lot of engines very good, i meant the GPL rules that not allows closed source engines to using SF NNUE's with shawuls probing code because it is under the rules of GPL 3.0 that means you must open your source if you using the source of the probing code.

so i mean it is also not allowed to using the nalimov table probing code either then..... nor opening books too.
If you want to use a neural network for position evaluation while keeping your source closed, why not implement it yourself?
A large number of strong engines use neural networks for position evaluation without taking any code from Stockfish/other engines (Ethereal, Slowchess, Winter, Halogen, Seer, Orion, tomitankChess etc.).

I don't understand your thinking here, though possibly there are reasons for keeping your source closed that I am not considering. Why not open source your engine if you want to use other people's GPL'd code so badly?
If you want to play in the GPL sandbox, you have to give back to the GPL sandbox. Its a fair paradigm.

Nothing about NNUE is prohibitive. Using a Stockfish network is not even a GPL issue; its using the implementation code. Coding up a system to read the weights and apply them is an exercise in 1. looking through SF's source to get the format, and 2. Vector programming. I had never used AVX/AVX2 sintructions, and I managed a system similar to Stockfish, and a fork that actually can run SF-esque networks.

-----

On another topic of sorts: I'm not actually convinced that if Andscacs, a private sourced engine, were to use Stockfish code verbatim for the NNUE that it would constitute a violation of the GPL, if the NNUE code was public. There is a sort of idea of being fully separable. Andscacs runs perfectly fine as a stand alone program without the use of Stockfish's GPL'ed code. Andscacs also runs with the use of Stockfish's GPL'ed code. One can consider the NNUE evaluation and updates as a seperate program being used by Andscacs.

I'm generally pretty staunch in my interpretation of the GPL, but I do think this is a nuance that matters. I also imagine no one (with standing) would raise an issue if Andscacs were closed source, but packaged with a few .c and .h NNUE files, as well as a copy of the GPLv3.
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
connor_mcmonigle
Posts: 530
Joined: Sun Sep 06, 2020 4:40 am
Full name: Connor McMonigle

Re: Andscacs nnue 0.1

Post by connor_mcmonigle »

AndrewGrant wrote: Thu Jan 21, 2021 11:53 pm On another topic of sorts: I'm not actually convinced that if Andscacs, a private sourced engine, were to use Stockfish code verbatim for the NNUE that it would constitute a violation of the GPL, if the NNUE code was public. There is a sort of idea of being fully separable. Andscacs runs perfectly fine as a stand alone program without the use of Stockfish's GPL'ed code. Andscacs also runs with the use of Stockfish's GPL'ed code. One can consider the NNUE evaluation and updates as a seperate program being used by Andscacs.

I'm generally pretty staunch in my interpretation of the GPL, but I do think this is a nuance that matters. I also imagine no one (with standing) would raise an issue if Andscacs were closed source, but packaged with a few .c and .h NNUE files, as well as a copy of the GPLv3.

I'm no legal expert, obviously. The existence of less prohibitive licenses such as L-GPL which allow closed source programs to link against/use open source libraries would lead me to believe that "being fully separable" isn't important in the context of GPLv3.

All of this is purely hypothetical as you point out. No one with legal standing is going to raise issue with a free closed source engine using GPL'd code in practice. In general, I think respecting the wishes of whoever wrote and licensed the code is the only respectful thing to do though.
User avatar
pedrox
Posts: 1056
Joined: Fri Mar 10, 2006 6:07 am
Location: Basque Country (Spain)

Re: Andscacs nnue 0.1

Post by pedrox »

Daniel and Engin could use SF NNUE if instead of integrating Daniel Shawul's GPL code into their engine they would use his dll. This has happened before, e.g. GUIs (code closed) accessing bitbase dll. You can use the dll and distribute the source code for it and you comply with the GPL and your engine can be closed source.

Using the dll is as easy or even easier than integrating the code into your engine. The good thing about the integration is that it allows the programmer to distribute for his engine only an exe file instead of exe + dll which complicates the user's life. In addition in case of using multiple platforms it facilitates the work.

I have a test code to access the dll, it is only a few lines of code. The code accesses the dll and the NNUE file, with FEN allows to check the eval and also shows an example how my engine does the board conversion to access directly without FEN.

File: nnueprobe.c --> code source
nnueprobe.bat --> exe for console (use nnueprobe.exe)
Folder: libnnueprobe contains the code GPL of Daniel Shawul

https://www.mediafire.com/file/j5v42uyx ... ue.7z/file
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Andscacs nnue 0.1

Post by Michel »

pedrox wrote: Fri Jan 22, 2021 9:15 am Daniel and Engin could use SF NNUE if instead of integrating Daniel Shawul's GPL code into their engine they would use his dll. This has happened before, e.g. GUIs (code closed) accessing bitbase dll. You can use the dll and distribute the source code for it and you comply with the GPL and your engine can be closed source.

Using the dll is as easy or even easier than integrating the code into your engine. The good thing about the integration is that it allows the programmer to distribute for his engine only an exe file instead of exe + dll which complicates the user's life. In addition in case of using multiple platforms it facilitates the work.

I have a test code to access the dll, it is only a few lines of code. The code accesses the dll and the NNUE file, with FEN allows to check the eval and also shows an example how my engine does the board conversion to access directly without FEN.

File: nnueprobe.c --> code source
nnueprobe.bat --> exe for console (use nnueprobe.exe)
Folder: libnnueprobe contains the code GPL of Daniel Shawul

https://www.mediafire.com/file/j5v42uyx ... ue.7z/file
This false. Dlls execute in the same process. They fall still under the GPL.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
User avatar
pedrox
Posts: 1056
Joined: Fri Mar 10, 2006 6:07 am
Location: Basque Country (Spain)

Re: Andscacs nnue 0.1

Post by pedrox »

Michel wrote: Fri Jan 22, 2021 10:03 am
pedrox wrote: Fri Jan 22, 2021 9:15 am Daniel and Engin could use SF NNUE if instead of integrating Daniel Shawul's GPL code into their engine they would use his dll. This has happened before, e.g. GUIs (code closed) accessing bitbase dll. You can use the dll and distribute the source code for it and you comply with the GPL and your engine can be closed source.

Using the dll is as easy or even easier than integrating the code into your engine. The good thing about the integration is that it allows the programmer to distribute for his engine only an exe file instead of exe + dll which complicates the user's life. In addition in case of using multiple platforms it facilitates the work.

I have a test code to access the dll, it is only a few lines of code. The code accesses the dll and the NNUE file, with FEN allows to check the eval and also shows an example how my engine does the board conversion to access directly without FEN.

File: nnueprobe.c --> code source
nnueprobe.bat --> exe for console (use nnueprobe.exe)
Folder: libnnueprobe contains the code GPL of Daniel Shawul

https://www.mediafire.com/file/j5v42uyx ... ue.7z/file
This false. Dlls execute in the same process. They fall still under the GPL.
This is not false. This has happened before. Especially with GUI code closed accessing GPL dll. That the dll runs in the same process has nothing to do with it.

I seem to remember it was used by Fritz Pocket PC Version already several years ago and others. For example Fritz Pocket PC used the Fruit engine as a dll and you do not have the Fritz Pocket PC code. Besides Fritz Pocket PC other Pocket PC GUIs used the same technique. CEBoard another ...
Last edited by pedrox on Fri Jan 22, 2021 10:34 am, edited 1 time in total.
Frank Quisinsky
Posts: 6808
Joined: Wed Nov 18, 2009 7:16 pm
Location: Gutweiler, Germany
Full name: Frank Quisinsky

Re: Andscacs nnue 0.1

Post by Frank Quisinsky »

Programmers await for a fair comparsion more "Originality".
The opposition!!

Win-lose situation with free but closed sources:

Win:
More originality with closed sources!

Lose:
Longer time for further development from new ideas!

Lose-Win situation with open sources:

Lose:
Originality lost with open-sources.
NNUE is the perfect example!

Win:
Faster development with open sources!

For myself are all the discussion with the "Copyright virus" home-made by the programmers itself.

That's really a problem from users view!
We await more "originality" and a "faster" development!

I am more the freeware supporter (can be see in the red letters from my 20 years old logo, Frank's Chess Page).
End of the day both solution are not perfect.

If I am looking how many jobs we lost with open-source software and the possibilties today for programmers to make money with works in programming. For some years programmers can make more money for his works in commercial area's. So many other things we lost with open-sources and the 100% open-source supporting people will not see all the disadvantages because they like to share.

Again, if NNUE are closed ... sources are never public ... the situation today in computer chess will be a complete other!
One program can be use the NN idea only!

The "copyright-virus" made this situation and so many other situation around it not better!

A programmer, used a part of open-sources, and have many own things included, have to give his complete sources.
And all that what programmer develops in over 40 years goes in open-sources with the final result:

Programmers, develops a closed-source program are "cloner" for the open-source community.
How often I read such things!

And the good-will idea from open source are lost.
An ambivalent situation!

Best
Frank
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Andscacs nnue 0.1

Post by Michel »

pedrox wrote: Fri Jan 22, 2021 10:28 am
Michel wrote: Fri Jan 22, 2021 10:03 am
pedrox wrote: Fri Jan 22, 2021 9:15 am Daniel and Engin could use SF NNUE if instead of integrating Daniel Shawul's GPL code into their engine they would use his dll. This has happened before, e.g. GUIs (code closed) accessing bitbase dll. You can use the dll and distribute the source code for it and you comply with the GPL and your engine can be closed source.

Using the dll is as easy or even easier than integrating the code into your engine. The good thing about the integration is that it allows the programmer to distribute for his engine only an exe file instead of exe + dll which complicates the user's life. In addition in case of using multiple platforms it facilitates the work.

I have a test code to access the dll, it is only a few lines of code. The code accesses the dll and the NNUE file, with FEN allows to check the eval and also shows an example how my engine does the board conversion to access directly without FEN.

File: nnueprobe.c --> code source
nnueprobe.bat --> exe for console (use nnueprobe.exe)
Folder: libnnueprobe contains the code GPL of Daniel Shawul

https://www.mediafire.com/file/j5v42uyx ... ue.7z/file
This false. Dlls execute in the same process. They fall still under the GPL.
This is not false. This has happened before. Especially with GUI code closed accessing GPL dll. That the dll runs in the same process has nothing to do with it.

I seem to remember it was used by Fritz Pocket PC Version already several years ago and others. For example Fritz Pocket PC used the Fruit engine as a dll and you do not have the Fritz Pocket PC code. Besides Fritz Pocket PC other Pocket PC GUIs used the same technique. CEBoard another ...
You are arguing that white is black. Google for "LGPL". Or the "GPL linking exception".

About the specific example you quote: it is up to the copyright holder to allow this (it basically amounts to relicensing the code). Maybe they did ask Fabien Letouzey for permission?

Note that there is also a moral dimension. If an author releases code under the GPL then he does it with the specific intention that said code will not be used in a closed source program. Otherwise he would have chosen a more permissive licence. Why then trying to look for ways to circumvent the author's intention?
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
User avatar
pedrox
Posts: 1056
Joined: Fri Mar 10, 2006 6:07 am
Location: Basque Country (Spain)

Re: Andscacs nnue 0.1

Post by pedrox »

Michel wrote: Fri Jan 22, 2021 10:53 am
pedrox wrote: Fri Jan 22, 2021 10:28 am
Michel wrote: Fri Jan 22, 2021 10:03 am
pedrox wrote: Fri Jan 22, 2021 9:15 am Daniel and Engin could use SF NNUE if instead of integrating Daniel Shawul's GPL code into their engine they would use his dll. This has happened before, e.g. GUIs (code closed) accessing bitbase dll. You can use the dll and distribute the source code for it and you comply with the GPL and your engine can be closed source.

Using the dll is as easy or even easier than integrating the code into your engine. The good thing about the integration is that it allows the programmer to distribute for his engine only an exe file instead of exe + dll which complicates the user's life. In addition in case of using multiple platforms it facilitates the work.

I have a test code to access the dll, it is only a few lines of code. The code accesses the dll and the NNUE file, with FEN allows to check the eval and also shows an example how my engine does the board conversion to access directly without FEN.

File: nnueprobe.c --> code source
nnueprobe.bat --> exe for console (use nnueprobe.exe)
Folder: libnnueprobe contains the code GPL of Daniel Shawul

https://www.mediafire.com/file/j5v42uyx ... ue.7z/file
This false. Dlls execute in the same process. They fall still under the GPL.
This is not false. This has happened before. Especially with GUI code closed accessing GPL dll. That the dll runs in the same process has nothing to do with it.

I seem to remember it was used by Fritz Pocket PC Version already several years ago and others. For example Fritz Pocket PC used the Fruit engine as a dll and you do not have the Fritz Pocket PC code. Besides Fritz Pocket PC other Pocket PC GUIs used the same technique. CEBoard another ...
You are arguing that white is black. Google for "LGPL". Or the "GPL linking exception".

About the specific example you quote: it is up to the copyright holder to allow this (it basically amounts to relicensing the code). Maybe they did ask Fabien Letouzey for permission?

But there is also a moral issue. If an author releases code under the GPL then he does it with the specific intention that said code will not be used in a closed source program. Otherwise he would have chosen a more permissive licence. Why then trying to look for ways to circumvent the author's intention?
If a programmer uses the dll created by Daniel Shawul, he is not modifying the NNUE access source code. Therefore he has no obligation other than to provide Daniel's source code (if he distributes the dll) since he did not make any modifications. Easier, they can modify their engine and ask the user to download Daniel's dll. So it is clear that they don't have to give any source code to the user of his engine, right? I think the GPL is clear on this when it states the need to distribute the new source code if you modify it.

Chessbase and others did not ask Fabien for permission since they consider that they did not need it. At the time there was controversy over this, but I think everyone assumed in the end that it was correct.
Frank Quisinsky
Posts: 6808
Joined: Wed Nov 18, 2009 7:16 pm
Location: Gutweiler, Germany
Full name: Frank Quisinsky

Re: Andscacs nnue 0.1

Post by Frank Quisinsky »

Hello Daniel,

Gull is IPP with a lot of very own ideas ... after all I know!
Most interesting IPP engine for myself.
Programmer of Gull must have a lot of programming knowledge!

Interesting what you wrote here, thank you!

I hope of newer versions from Andscacs.
To public a newer release version (for the moment without NNUE) will be interesting.

Andscacs 1.0 ... soon available?!
Better is to develops an own net.

At the moment each example with NNUE is very interesting!
For yourself and of course for other programmers to support the "shared" idea.

My biggest wish if you do that:
Try to hold the aggressive playing style ... more important as Elo.

Best
Frank

Like what an other wrote here ...
aNNdscacs 2.0 (if later NN support added).

:-)
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Andscacs nnue 0.1

Post by Michel »

pedrox wrote: Fri Jan 22, 2021 11:32 am
Michel wrote: Fri Jan 22, 2021 10:53 am
pedrox wrote: Fri Jan 22, 2021 10:28 am
Michel wrote: Fri Jan 22, 2021 10:03 am
pedrox wrote: Fri Jan 22, 2021 9:15 am Daniel and Engin could use SF NNUE if instead of integrating Daniel Shawul's GPL code into their engine they would use his dll. This has happened before, e.g. GUIs (code closed) accessing bitbase dll. You can use the dll and distribute the source code for it and you comply with the GPL and your engine can be closed source.

Using the dll is as easy or even easier than integrating the code into your engine. The good thing about the integration is that it allows the programmer to distribute for his engine only an exe file instead of exe + dll which complicates the user's life. In addition in case of using multiple platforms it facilitates the work.

I have a test code to access the dll, it is only a few lines of code. The code accesses the dll and the NNUE file, with FEN allows to check the eval and also shows an example how my engine does the board conversion to access directly without FEN.

File: nnueprobe.c --> code source
nnueprobe.bat --> exe for console (use nnueprobe.exe)
Folder: libnnueprobe contains the code GPL of Daniel Shawul

https://www.mediafire.com/file/j5v42uyx ... ue.7z/file
This false. Dlls execute in the same process. They fall still under the GPL.
This is not false. This has happened before. Especially with GUI code closed accessing GPL dll. That the dll runs in the same process has nothing to do with it.

I seem to remember it was used by Fritz Pocket PC Version already several years ago and others. For example Fritz Pocket PC used the Fruit engine as a dll and you do not have the Fritz Pocket PC code. Besides Fritz Pocket PC other Pocket PC GUIs used the same technique. CEBoard another ...
You are arguing that white is black. Google for "LGPL". Or the "GPL linking exception".

About the specific example you quote: it is up to the copyright holder to allow this (it basically amounts to relicensing the code). Maybe they did ask Fabien Letouzey for permission?

But there is also a moral issue. If an author releases code under the GPL then he does it with the specific intention that said code will not be used in a closed source program. Otherwise he would have chosen a more permissive licence. Why then trying to look for ways to circumvent the author's intention?
If a programmer uses the dll created by Daniel Shawul, he is not modifying the NNUE access source code. Therefore he has no obligation other than to provide Daniel's source code (if he distributes the dll) since he did not make any modifications. Easier, they can modify their engine and ask the user to download Daniel's dll. So it is clear that they don't have to give any source code to the user of his engine, right? I think the GPL is clear on this when it states the need to distribute the new source code if you modify it.

Chessbase and others did not ask Fabien for permission since they consider that they did not need it. At the time there was controversy over this, but I think everyone assumed in the end that it was correct.
What you are saying makes no sense. What you are saying is that I can create a shared library "stockfish.dll" and then release a closed source chess engine that links against stockfish.dll. After all: I am not modifying the Stockfish source code so I have obligations towards the Stockfish authors.

Have you followed my advice and Googled for LGPL?
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.