Rybka/ Fruit - answering the "GPL breach or not" q

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

Moderators: hgm, Rebel, chrisw

Ant_Gugdin
Posts: 60
Joined: Sun Dec 26, 2010 9:13 pm

Rybka/ Fruit - answering the "GPL breach or not" q

Post by Ant_Gugdin »

There have already been detailed discussions of the similarities between Fruit and Rybka. However, I haven’t seen any detailed attempts to interpret the GPL and determine whether or not Vas R has breached it. I’ve read the GPL and had a first go. However, this is only a starting point for discussion – comments/ corrections welcome. Two large caveats: (i) although I am a qualified lawyer, I don’t specialise in or know anything about copyright law and reviewing licence agreements is not part of my job, (ii) I am wholly ignorant of computer programming.

I think the applicable version of the GPL is v 2, which can be found at http://www.gnu.org/licenses/gpl-2.0.html. It raises several issues but the most important issue by far is whether Rybka 1.0 Beta is a “work based on” Fruit 2.1. If it is, then Vas is almost certainly in breach of the GPL.

The GPL contains the following definition of “work based on”:

...a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language.

The words “under copyright law” seem a little unclear – the copyright law of which jurisdiction? However, there is a specific definition of “derivative work.” Applying that definition, the key issues are whether Rybka 1.0 Beta contains any of the following:

1 a verbatim “portion” of Fruit 2.1;

2 a verbatim “portion” of Fruit which has been translated into another language

3 a “portion” of Fruit “with modifications”

4 a “portion” of Fruit “with modifications” which has been translated into another language

I’ll focus on (1) and (3), principally because I’m too ignorant to know whether Fruit and Rybka are written in the same programming language. There are two key grey areas here:

1 First, how much code (or modified code) qualifies as a “portion”?

2 Secondly, when does amended code cease to be “[a portion of] the Program...with modifications” and become something new (i.e. so fundamentally changed that it is outside the scope of the GPL)?

If anyone can point me to any guidance on the meaning of the terms “portion” and “modification” in the context of the GPL, this would be helpful, particularly if it’s written by the authors of the GPL.

Subject to any such guidance, I’d say that:

- There must be an implied de minimis to the word “portion.” For example, I would use the word when I order from the staff canteen. A portion of chips would be a helping of chips. A single chip would not be a “portion” of chips. So a “portion” here means a chunk of code. The tipping point at which a chunk of code is too small to count as a “portion” is a question of fact and degree (this is where published guidance would be helpful).

- I struggle with (2). Let’s start with a dictionary definition of “modify” (from www.dictionary.com) – “to change somewhat the form or qualities of; alter partially; amend.” “Modify” clearly involves some form of change. However, there must be a point at which changes to code are so far-reaching that the code ceases to be the original code “with modifications” and becomes something new. The difficult question is: where is the tipping point? The term should be read in the context of the licence agreement. I’ll attempt a working definition in this context (and this is by no means guaranteed to be right). (i) If someone changes the form but not the substance of code, the amended code will be the original code “with modifications.” In other words, if someone takes code and rewords it entirely but the new code means exactly the same thing as the original code (in fact, this may well simply be viewed as “verbatim” copying, even though it is not strictly “word for word”). (ii) When someone makes changes of more than 49% to the substance of a portion of code, the amended code is new code for the purposes of the licence rather than the original code “with modifications.” Changes of 49% or less to the substance, and the code is the original code “with modifications” for the purposes of the GPL. It is not clear at all where the line should be drawn and my 49% is arbitrary. However, it is very clear that original code with minor changes or “tweaks” will be on the wrong side of the line.

The terms of the GPL are very strict. You could have a program which looks radically different from Fruit using the similarity detector but still constitutes a violation of the GPL.

Does Rybka 1 Beta include a verbatim “portion” or a “modified” “portion” of Fruit 2.1? Not having reviewed any decompiled Rybka code, or the Fruit source code (or even having the capacity to understand the code), I don't think I'm competent to answer this. However, having reviewed the following document - http://www.open-chess.org/download/file.php?id=219 - from a position of ignorance, it seems likely that it does.

What do the programmers think – in particular, those who have examined the Rybka 1 Beta executable?

If there has been a breach of the GPL, the next question is: what are the consequences? The GPL is permissive rather than restrictive. The GPL v 2 contains the following:

5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License.

No idea whether this is right or not – the GPL authors surely can’t have verified this across a number of jurisdictions.

However, the website tells us what we should do in the event of a violation – tell the Free Software Foundation (who, as I recall, own the copyright): see http://www.gnu.org/licenses/gpl-violation.html. It seems to me that there is already more than enough material in the public domain to justify reporting Vas to the FSF, after first giving him a fair chance to explain himself, although I think this should be Fabien’s call.
Gian-Carlo Pascutto
Posts: 1243
Joined: Sat Dec 13, 2008 7:00 pm

Re: Rybka/ Fruit - answering the "GPL breach or not&

Post by Gian-Carlo Pascutto »

Ant_Gugdin wrote: If anyone can point me to any guidance on the meaning of the terms “portion” and “modification” in the context of the GPL, this would be helpful, particularly if it’s written by the authors of the GPL.
What the GPL says is irrelevant on that subject. The relevant issue is copyright law of the applicable jurisdiction. (Which indeed will vary depending on the involved parties)
However, there is a specific definition of “derivative work.”
I posted in the other thread a link to a document explaining how the US courts currently interpret this in the context of computer software.
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License.

No idea whether this is right or not – the GPL authors surely can’t have verified this across a number of jurisdictions.
It applies everywhere where copyright law exists, in other words, all the civilized world, if not simply worldwide.
Ant_Gugdin
Posts: 60
Joined: Sun Dec 26, 2010 9:13 pm

Re: Rybka/ Fruit - answering the "GPL breach or not&

Post by Ant_Gugdin »

Gian-Carlo

Thanks for your reply.
Gian-Carlo Pascutto wrote:What the GPL says is irrelevant on that subject. The relevant issue is copyright law of the applicable jurisdiction. (Which indeed will vary depending on the involved parties)
Are you sure about this? "Irrelevant" is a big word.

The GPL is not well drafted at all.

...a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language.

The bolded words assume that the GPL's definition of "derivative work" is identical to the definition in every single jurisdiction worldwide. Which, of course, cannot be right. Or do you think I'm putting too much weight on them? The words "that is to say," to my mind, give a specific definition.

But let's take a practical example. Let's suppose I (a UK national and resident) decide that I want to use some ideas from source code written by a French author, covered by the GPL, and use those ideas in my commercial, closed-source program. I read the GPL and realise that I must avoid creating a "derivative work." However, I have no idea what it means when it says "derivative work under copyright law". Which law are we talking about here - UK law or France law? However, I note that they have helpfully included their own specific definition of "derivative work" and I make sure that I remain outside it. This saves me having to spend money on UK and/or French lawyers.

If it turns out that the UK/ French law definition of "derivative work" is different from the GPL's own definition, and I have fallen foul of it (despite being careful to stay outside the GPL's own definition) would a court really find that I have breached the GPL? I think a court would struggle with this question, given the bad drafting of the licence agreement (effectively, the agreement contains two or even three conflicting definitions of "derivative work").

I don't think a UK court would find against me (no doubt someone will produce a UK law case to prove me wrong!) In addition, I can't believe the FSF would even go after me in the first place in this situation - whatever the strict legal position.

So I do think that Vas is likely to be OK if Rybka is outside the GPL's definition of "derivative work."

Edit: I would say, however, that there is a possible defence for Vas if Rybka is outside the definition of "derivative work" under applicable law (either French law or Russian law, presumably) - although this is a question for a French or a Russian lawyer.
Last edited by Ant_Gugdin on Thu Jan 27, 2011 9:35 am, edited 1 time in total.
Ant_Gugdin
Posts: 60
Joined: Sun Dec 26, 2010 9:13 pm

Re: Rybka/ Fruit - answering the "GPL breach or not&quo

Post by Ant_Gugdin »

Since I’m not competent to answer questions on whether portions (or modified portions) of Fruit are included in Rybka, here are some posts from people who are:
Ryan Benitez wrote:
Xann wrote:
SuneF wrote:I took a brief at look at Fruit v2.1.2 and compared it to Strelka 2.0, there are many differences though.

* Strelka is all bitboard Fruit is not.
* Strelka has multiple specialized search routines for check and null windows, Fruit does not.
* Evaluation and move selection looks quite different.
Looks are not so important.

Several experts that possibly don't want to be mentioned plus myself concluded that Strelka contains a large amount of Fruit algorithms.
Ryan, however, did not see Fruit in Strelka.
Anthony concluded that it was perhaps a modified version of Fritz 5.
Anthony is most certainly an expert.

How are these differences possible?
It's because I, and I assume some others as well, look "through" the code all the way to what it computes (the mathematical function that the code implements).
And we compare what Strelka computes with what Fruit computes.
"What", not "how".
And we find a match.

Bob, does this makes sense to you?

Fabien.
I only cared about GPL violations. That is the only thing that the FSF can do anything about.
We are talking about Strelka here rather than Rybka. Fabien’s view appears to be that Strelka contains Fruit code which, although differently worded, is functionally the same. I’m not sure what Ryan’s reply means:

- That Strelka does not contain any code copied from Fruit and, therefore, there is no GPL breach?

- That Strelka didn’t breach the GPL because it was free and the source code was distributed?
I would say:

- If Strelka contains a “portion” of Fruit code translated into a different language, that is clearly within the scope of the GPL

- We are also within the scope of the GPL if it contains Fruit code “with modifications.” I would say this includes code which has been reworded but is functionally identical.

Here are some of Robert Hyatt’s posts:
bob wrote:We found _lots_ of similarities. Zach created a web page that went into great detail with the analysis. There are some obvious differences between Fruit and Rybka, but there are a _ton_ of similarities. Too many to be pure luck.
When I say "similarities" I mean "identical code". This has been covered ad nauseum. And "identical code" does not follow from "studying algorithms". It follows from cut and pasting source code...
If you look at my previous comments, "similarity" is "identical code". The entire program was not copied. But large chunks were. That _is_ proof of code copying...

Since large chunks were copied, but not everything, I chose to not say "identical" to be accurate. But they are _very_ similar. Moreso when you factor out the bitboard changes...
If these posts are correct, it seems there is a very clear breach of the GPL and that we are well outside the grey areas (subject to the debate about what definition of "derivative work" should be applied). If there has been direct code copying then we do not need to address the potentially difficult question of whether Rybka contains Fruit code “with modifications” (although it is possible for a breach to exist without verbatim code copying). I would expect “large chunks” to count as a “portion” for the purposes of the GPL.
Chan Rasjid
Posts: 588
Joined: Thu Mar 09, 2006 4:47 pm
Location: Singapore

Re: Rybka/ Fruit - answering the "GPL breach or not&

Post by Chan Rasjid »

Ant_Gugdin wrote:Gian-Carlo

Thanks for your reply.
Gian-Carlo Pascutto wrote:What the GPL says is irrelevant on that subject. The relevant issue is copyright law of the applicable jurisdiction. (Which indeed will vary depending on the involved parties)
Are you sure about this? "Irrelevant" is a big word.

The GPL is not well drafted at all.
It should be about correct. What the license says is subject to copyright law and only the courts may adjudicate based on copyright law. If there has not been a precedent yet, then it is up to us to apply copyright law and not what a license defines as a derivative.

A derived work in software has some pertinent differences with other non-software works. A software program under GPL releases the source codes which are text and copyright attaches; whether the executable (binary) is provided is not important as it could be compiled to get the executable program. For a proprietary program, the source code is not released, only the executable is sold or licensed. It is fairly difficult to infringe on the copyright of a binary-only software as extracting portions of it is of no use in general.

Rasjid.
Gian-Carlo Pascutto
Posts: 1243
Joined: Sat Dec 13, 2008 7:00 pm

Re: Rybka/ Fruit - answering the "GPL breach or not&

Post by Gian-Carlo Pascutto »

Ant_Gugdin wrote: Are you sure about this? "Irrelevant" is a big word.
Yes. It's very simple really.

Say I write a program that is not a derivative work of a GPL program (under copyright law). The GPL can now say all it wants about what it considers a derivative, it's meaningless for my program, because the GPL simply has no legal basis at all upon which to claim anything about my work.

The only way the GPL can GET the power it has, is because it's sitting on top of copyright law. Copyright law says you *cannot* distribute derivative works without permission from the rights holder. The GPL says that the rights holder gives you permission, IF...
The GPL is not well drafted at all.
The authors fixed the things they saw as flaws or unclarities in the next version. To say that it's not well drafted - it's one of the most successful "hacks" ever on the copyright system.

It's a bit weird to say the GPL is not well drafted when your main criticism here is about things the GPL has no control over. (Such as what local law considers a derivative work, or which laws apply to your activities)
But let's take a practical example. Let's suppose I (a UK national and resident) decide that I want to use some ideas from source code written by a French author, covered by the GPL, and use those ideas in my commercial, closed-source program. I read the GPL and realise that I must avoid creating a "derivative work." However, I have no idea what it means when it says "derivative work under copyright law". Which law are we talking about here - UK law or France law?
The applicable law is always the local law. Nothing to do with the GPL at all. If you're going to distribute your program in France, you'll have to follow French law. If you aren't, you couldn't care less about what the French can or cannot do.

As an example, I quoted in the other thread the relevant law articles for European Union members. One of these says that you can only use reverse engineering for compatibility reasons, and not to develop a similar competitive product. It's my understanding (but I could be totally wrong) that such a law does not exist in Russia.

This is relevant for example for Ippolit, which was derived by reverse engineering Rybka. This would be illegal in Europe, because it's clearly a competitive product and the reverse engineering was not done for anything that could be considered compatibility.

But if Russian law does not forbid this, then the only relevant question is if there are copyright issues with Ippolit. I'm not firmly decided on that one, but let for the moment assume that it's in the clear for that.

In that case, Ippolit is clearly legal in Russia (no laws broken). The question then is what its status is in the rest of Europe (and the US).

I don't know the definite answer to this one, but at least the US has made it clear in the past they consider doing something in Russia that is legal there but would not be in the US, grounds for prosecuting someone. Google for "Dimitry Skylarov". Whether they are right in that or not I do not know, but I sure hope not!.

My own country also had this funny idea once that it could apply its laws regarding to war crimes everywhere, and some people sued the US president in our local courts. Needless to say, the US very quickly, ahem, "convinced" us that we were stupid.
However, I note that they have helpfully included their own specific definition of "derivative work" and I make sure that I remain outside it. This saves me having to spend money on UK and/or French lawyers.
This is a misunderstanding, see the first point. The GPL cannot derive any power which copyright law doesn't give it. It can attempt to clarify what is generally applicable, which is what it does.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Rybka/ Fruit - answering the "GPL breach or not&

Post by hgm »

I am completely with Gian-Carlo on this.

I can add the following: The 'that is to say' clause is merely an explanation to the layman. It does not really matter what definition the GPL gives of what constitutes a derivative.

* If the GPL definition would encompass more that copyright law, it would be void, because you cannot enforce conditions unless the law says you can.

* If the GPL would leave out cases that are covered by the law, it makes copying in these cases all the more forbidden. Because the GPL is a document that grants the _permission_ to copy. So arguing that you have a case that is not covered by the GPL definition, puts you in a position where unqualified copyright law applies, which by default forbids copying.
Ant_Gugdin
Posts: 60
Joined: Sun Dec 26, 2010 9:13 pm

Re: Rybka/ Fruit - answering the "GPL breach or not&

Post by Ant_Gugdin »

Yes. It's very simple really.

Say I write a program that is not a derivative work of a GPL program (under copyright law). The GPL can now say all it wants about what it considers a derivative, it's meaningless for my program, because the GPL simply has no legal basis at all upon which to claim anything about my work.
I think we’re talking at cross purposes here. As per my previous post, the GPL is permissive, not restrictive. The GPL does not purport to “claim anything” about your work and I haven’t said anywhere that it does. What the GPL does is to grant you permission to do certain things with software whose copyright is owned by someone else. If you fall outside the terms of that permission, you may be in breach of the applicable local law.

Put simply, in determining whether Vas can be sued for what he has done with Fruit, there are two questions:

1 Has he done something with Fruit which (disregarding the GPL) is not permitted by the applicable local law?

2 If so, does he fall within the terms of the GPL, which would grant him permission to do things with Fruit not otherwise permitted by local law?

The thread focuses solely on question 2. It doesn’t address question 1 at all. The reason for this is that I don’t know the first thing about Russian or French copyright law, or even which law applies here. I would leave question 1 to the FSF (who would, presumably, need to take legal advice on it).

Let’s assume, for simplicity, that the applicable local law says it is not permissible to do anything at all with a piece of software code without the permission of the copyright owner.

The GPL sets out the terms on which the copyright owner’s permission is granted. If you don’t comply with those terms, you don’t have the author’s permission and (on the above assumption) will be in breach of local law.

As I’m only addressing the question of whether there has been GPL compliance, the GPL definition of derivative is very much relevant here. The only relevance of the local law definition of “derivative work” to question 2 is that the GPL itself refers to “copyright law” in defining that term. In answering question 2 – which is what the thread is about – it is not correct to say that the GPL definitions are “irrelevant.” The GPL sets out the terms of the copyright owner’s consent to use the software. The authors of the GPL can set out the terms of the permission using whatever language they want to use.

Of course, the local law definition of “derivative work” (if there is one – the concept doesn’t even exist in some jurisdictions) may also be relevant to question 1. However, I wouldn’t drag question 1 into the topic unless you feel competent to talk about French or Russian copyright law. I personally do not. :) However, if you are competent to discuss question 1, I’d be very interested to hear your thoughts, as it is what will determine whether Vas can be successfully sued or not.

If I were the author of Fruit, I would consider whether there has been a GPL breach and, if I think there has, I would follow the recommendation on the GPL website to report the breach to the FSF. It is then for the FSF to take their own legal advice on question 1.
This is a misunderstanding, see the first point. The GPL cannot derive any power which copyright law doesn't give it. It can attempt to clarify what is generally applicable, which is what it does.
It isn’t a misunderstanding. I haven’t said in any of my posts that the GPL can “derive power” from anywhere. As I understand it, the GPL does not restrict the use of software (restrictions are imposed by the applicable local law – not the GPL), it permits the use of software. It sets out the terms of the copyright owner’s permission to use the software. It works on the assumption that if the copyright owner has granted permission to do the act in question, there will be no breach of local law.

Do you agree with all this? In addition, do you agree that all that can realistically be done here (without paying Russian/ French lawyers) is to examine the terms of the GPL, see if there has been compliance and, if not, report this to the FSF? This is why I have focused on the GPL in the thread, not the more fundamental issue of whether there has been a breach of local law.
Ant_Gugdin
Posts: 60
Joined: Sun Dec 26, 2010 9:13 pm

Re: Rybka/ Fruit - answering the "GPL breach or not&

Post by Ant_Gugdin »

Hi Chan
What the license says is subject to copyright law and only the courts may adjudicate based on copyright law.
Yes, correct, and:

- I think it is reasonable to assume that there will be no breach of the applicable copyright law if the copyright owner has granted permission to do the act concerned. This is the assumption on which the GPL is based.

- The GPL sets out the terms on which permission is granted. If you stay within those terms I think you can (with some confidence) assume that there will be no breach of the applicable law.

In setting out the terms of the permission granted under the GPL, it is the GPL definitions which are relevant, because the GPL authors can define the scope/ terms of the permission using whatever language they want. Local law is only relevant in defining “derivative work” as that term is used in the GPL – i.e. to determine whether the copyright owner’s permission has been granted to do certain things with Fruit – because the GPL itself refers to “copyright law.” It would also be relevant in construing any undefined terms in the GPL. As per my previous post, however, the drafting of the GPL is not very good – it contains both a specific definition and a reference to “copyright law.”

I’ve focused on the question of whether there has been GPL compliance here – I’m sorry if that’s caused any confusion. The more fundamental question is whether Vas can be sued under the applicable local law. As I said to Giancarlo, I think the best approach is to leave this question to the FSF.
Of course, if we are lucky enough to have any French or Russian copyright lawyers on the site, it’d be very interesting to hear their views! But unless this is the case I think all we can do is focus on the GPL.
Gian-Carlo Pascutto
Posts: 1243
Joined: Sat Dec 13, 2008 7:00 pm

Re: Rybka/ Fruit - answering the "GPL breach or not&

Post by Gian-Carlo Pascutto »

I think I more or less agree with all you've said, except that I agree with H.G.Muller in that I believe the GPL doesn't attempt to redefine a derived work, but simply attempts to clarify what applicable law is likely to consider one. I'm guessing the "that is to say" has some established meaning in legal writing that makes that clear.

Rybka clearly does not follow the GPL with respect to Fruit, so for me the question is if Rybka is a derivative work from Fruit, and indeed the right thing to do would be to contact the FSF with details why this is the case (or not).