Do patches need to be open source?

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

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
mar
Posts: 2002
Joined: Fri Nov 26, 2010 1:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Do patches need to be open source?

Post by mar » Thu Feb 22, 2018 1:42 pm

Fulvio wrote:This is a public forum and you are spreading false information, that's my only concern.
How noble of you.

I missed the option that you can distribute your application with object code (or give a link to the object code and upload it somewhere), and while I consider it too impractical to be useful, I was wrong.

Robert Pope
Posts: 510
Joined: Sat Mar 25, 2006 7:27 pm

Re: Do patches need to be open source?

Post by Robert Pope » Thu Feb 22, 2018 3:35 pm

Ovyron wrote: Disclaimer: Of course, I didn't implement some Learning Algorithm in Stockfish :roll: - this was a hypothetical scenario, but the information gathered was very useful, since in the entire thread I didn't see anyone caring about the actual algorithm, just about if some random licence was violated or not. The licence is the most important thing for people, not what other people that would benefit get or not, I guess this explains the current state of the world. This thread was an eye-opener, I just wish I had posted "Suppose I implement some new Algorithm in Stockfish that makes it 200 elo stronger than it is currently, but I don't want to open the source, because I want to keep my Algorithm secret", certainly the following conversations would have been more interesting...
You made it quite clear in the original post that the learning algorithm was hypothetical, and your question was about whether a certain hypothetical course of action was okay, so of course the discussion is about the license agreement, and not about why you aren't sharing your amazing algorithm.

User avatar
Evert
Posts: 2923
Joined: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Re: Do patches need to be open source?

Post by Evert » Thu Feb 22, 2018 3:52 pm

Ovyron wrote: The problem with open source is that the thing is shared to everyone equally, it doesn't matter if they deserve it or not.
No, that really isn't the problem.

I just wish I had posted "Suppose I implement some new Algorithm in Stockfish that makes it 200 elo stronger than it is currently, but I don't want to open the source, because I want to keep my Algorithm secret", certainly the following conversations would have been more interesting...
So what, you're just trolling around for the fun of it? If you had posted that, I'm sure the conversation would have been essentially the same.
Honestly, there's not much to discuss if you start a conversation with "I have this amazing algorithm that I'm not going to talk about." Why mention it then?

User avatar
hgm
Posts: 23728
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Do patches need to be open source?

Post by hgm » Thu Feb 22, 2018 4:54 pm

mar wrote:The object files are much bigger than the resulting binary, can be 30:1 or more so nobody would do that (for one of my projects it's 70MB on disk vs 1.6MB binary, one platform).
This is not my experience with C programs. Most I have seen is a factor 2.

And that stands to reason. What is needed to make a binary linkable is a list of which memory words in it are (offsetted) addresses of global variables (the word in the binary containing the offset), and the word corresponding to it in the 'relocation section' (say) 16 bits distance to the next referece to a global, and 16 bits specifying the number of the variable. And then the symbol table of the global variables. Usually there are not that many global variables in a program.

Ras
Posts: 1161
Joined: Tue Aug 30, 2016 6:19 pm
Contact:

Re: Do patches need to be open source?

Post by Ras » Thu Feb 22, 2018 5:49 pm

syzygy wrote:So you are saying that distributing a library that contains no GPL'd material from Stockfish whatsoever could not be distributed under another license than the GPL? That is of course false.
The question is not just whether GPL'ed code is contained because that is only one of several mechanisms how the GPL can kick in, albeit the most frequent case.

However, this scenario is not about code inheritance. It's about the concept of a whole work, and that in turn is in place to prevent people from using dynamic linkage as a way how to circumvent the GPL and making it useless.

The dynamic linkage option holds for LGPL'ed software only and not for GPL'ed. That's why LPGL exists in the first place, to allow an option that GPL doesn't allow.

Of course, it would yet have to be tested in court whether the "whole work" concept would uphold in this scenario, but the intent of the GPL is pretty clear: Don't use any GPL'ed software to make a resulting program that is not entirely free (as in free speech).

On the other hand, if the coupling is as loose as in GUI vs. engine, then it is not one "whole work", but two programs.

User avatar
Ovyron
Posts: 2750
Joined: Tue Jul 03, 2007 2:30 am

Re: Do patches need to be open source?

Post by Ovyron » Thu Feb 22, 2018 6:08 pm

Robert Pope wrote:You made it quite clear in the original post that the learning algorithm was hypothetical, and your question was about whether a certain hypothetical course of action was okay, so of course the discussion is about the license agreement, and not about why you aren't sharing your amazing algorithm.
Yeah, but the main answer from people was "if you had such an algorithm, either share it open source or keep it private, we don't care as either one is fine".

Anyway, I know of people that have implemented stuff and kept it private, I was interested in a way for them to share their work without having to open their source, but what I got doesn't make one eager to go through all the hassle, to share stuff with people that don't care.

I'd now go and tell them "you're doing it right keeping it private!", and think more people could have more nice things if Stockfish had a different Licence, since currently people are building nice things at home but keeping them private because they don't want to go open source, but sharing the thing (for USERS that would benefit, not for other programmers!) closed would be fine.
Great spirits have always encountered violent opposition from mediocre minds.

Ras
Posts: 1161
Joined: Tue Aug 30, 2016 6:19 pm
Contact:

Re: Do patches need to be open source?

Post by Ras » Thu Feb 22, 2018 6:12 pm

Ovyron wrote:I was interested in a way for them to share their work without having to open their source
And why? If the SF authors had gone the same way as these people, they would not even have SF sources to tinker around with. The point of the GPL is to give the people later in the chain the same options that those earlier in the chain had.

mar
Posts: 2002
Joined: Fri Nov 26, 2010 1:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Do patches need to be open source?

Post by mar » Thu Feb 22, 2018 6:21 pm

hgm wrote: This is not my experience with C programs. Most I have seen is a factor 2.

And that stands to reason. What is needed to make a binary linkable is a list of which memory words in it are (offsetted) addresses of global variables (the word in the binary containing the offset), and the word corresponding to it in the 'relocation section' (say) 16 bits distance to the next referece to a global, and 16 bits specifying the number of the variable. And then the symbol table of the global variables. Usually there are not that many global variables in a program.
That's interesting (my experience with C++ and Microsoft compiler is quite a different story).

I'd actually expect most of the symbols in object files being imported/exported functions.

What bothers me is that I have a single cpp file exporting 3 simple functions worth at most 0.5kB of machine code, but I get a 200kB object file! While I understand it's 2018, still it seems a bit too much to me.

I need to investigate to find out what's going on, perhaps something gets inlined and exported.

I've also noticed that the files that msc produces contain a lot of redundant symbols, but that doesn't explain the large amount of code it generates in the above case.

Ras
Posts: 1161
Joined: Tue Aug 30, 2016 6:19 pm
Contact:

Re: Do patches need to be open source?

Post by Ras » Thu Feb 22, 2018 6:32 pm

mar wrote:What bothers me is that I have a single cpp file exporting 3 simple functions worth at most 0.5kB of machine code, but I get a 200kB object file!
Looks like that proves two things:
a) C++ is insanely convoluted.
b) but if done right, there is no runtime cost.
8-)

User avatar
Ovyron
Posts: 2750
Joined: Tue Jul 03, 2007 2:30 am

Re: Do patches need to be open source?

Post by Ovyron » Thu Feb 22, 2018 6:37 pm

Ras wrote:And why? If the SF authors had gone the same way as these people, they would not even have SF sources to tinker around with. The point of the GPL is to give the people later in the chain the same options that those earlier in the chain had.
Because sharing closed source is a compromise:

The users get something they didn't have before, allowing them to do things previously unavailable.
The programmers get to share their work, without revealing their secrets.

You're not going to have those secrets, the thread is full of programmers that only care about having the open source of those secrets, but hopefully there's users out there that would appreciate closed sharing, because for them open source makes no difference, as they're not programmers.

So the problem is the Licence itself that doesn't allow this compromise.

And no, if Stockfish had a different Licence it wouldn't be any weaker, what would happen is something like this:

Suppose I make a closed source Stockfish patch that detects certain pawn formations of the enemy King, and when they happen it checks for stuff, and if that stuff is in effect, Stockfish launches all their pieces against the enemy king. It works 2/3 of the time and makes Stockfish 20 elo stronger.

I release the patch (in, eh, an alternaste reality where this is legal?) for the benefits of users that can patch their Stockfish and have this option (1/3 of the time this doesn't work and default is better, so an user can be stronger by using the best SF in the board's situation.)

Would you say that it's damaging the open source project as SF had it missing?

No, Stockfish has already a team full of people that dedicate their life to improve it, so now they can see how the patched one behaves, and replicate its behavior with code on their own, probably better than me so actually they didn't need my patch and only needed to see the idea in action.

And I know because I have done stuff like this over the years, not only for Stockfish but for Rybka back when I beta tested it. You don't need to apply some closed source patch for this, it suffices to explain some concept to people, some wanted behavior, an they can produce code quickly that produces that behavior. And that behavior or something close makes it into the engine and it improves.

So if Stockfish had a different Licence that allowed people to provide closed source patches for it, the ideas would stop being private, people can take a look at the behavior and produce open source that does it.

This "open your source or don't share anything" philosophy is damaging.
Great spirits have always encountered violent opposition from mediocre minds.

Post Reply