There currently are discussions in CCC and RF about copying and it's much confusing what is allowed and what is not.
Here is the deal, provided a programmer already has an engine and he wants to copy code from another engine:
Verbatim copying code does not exists because the variable names, data structure are not compatible, so he will have to rewrite the code anyway to his own variable names, data structures.
Is that own written code ?
Data is another matter of course, this can be done by copy&paste without or minimal changes, thus copying.
Copying code
Moderator: Ras
-
lucasart
- Posts: 3243
- Joined: Mon May 31, 2010 1:29 pm
- Full name: lucasart
Re: Copying code
shouldn't this discussion be held in the engine origin forum ?Rebel wrote:There currently are discussions in CCC and RF about copying and it's much confusing what is allowed and what is not.
Here is the deal, provided a programmer already has an engine and he wants to copy code from another engine:
Verbatim copying code does not exists because the variable names, data structure are not compatible, so he will have to rewrite the code anyway to his own variable names, data structures.
Is that own written code ?
Data is another matter of course, this can be done by copy&paste without or minimal changes, thus copying.
so you're hinting that copying ideas is the same as copying code ? if that is the case then everyone copies everyone else, as everyone copied the idea of minmax, alpha beta pruning, hash tables, null move, search extension/reductions, SEE, move ordering, quiescent search, history and killers etc.
the whole point of free open source software is to allow and encourage this! which is what most people fail to understand. writing an open source engine is a contribution to the computer chess community: you take ideas, and even code from your predecessors, and add your ideas or variations. and your successor does the same, and that's how computer chess has evolved drastically over many years.
the problem begins with *proprietary software*. in my opinion it is unethical, as writing a proprietry (closed source) engine is taking from the open source community, and giving nothing in return. and the cherry on the cake is proprietary software developpers, taking all they can from the community, and not only giving nothing in return (no code nor ideas), but making accusations and organizing smearing campains against the same open source softwares that tought the the whole computer chess thing in the first place. can you guess who I'm thinking about ? I think the first name starts with a V and the surname with an R. IMO he got what he deserves, nothing more.
Last edited by lucasart on Tue Jan 10, 2012 12:29 pm, edited 1 time in total.
-
sje
- Posts: 4675
- Joined: Mon Mar 13, 2006 7:43 pm
Re: Copying code
If the copying is done by cut-and-paste or by a similar mechanical process involving an editor, then the result is a copy and not an original.
For example, If I were to take the C code for initializing a transposition table entry:
And use an editor to make the Pascal code:
Then that's a copy for two reasons:
1) No domain (chess) specific thought was involved in the process, and
2) I didn't understand the code because I copied a typographical error (duplicate line) in the original. (C.f., Crafty -> Rybka bug copying).
For example, If I were to take the C code for initializing a transposition table entry:
Code: Select all
ptr->hash = 0;
ptr->white = 0;
ptr->white = 0;
ptr->score = -32767;
Code: Select all
ptr^.hash := 0;
ptr^.white := 0;
ptr^.white := 0;
ptr^.score := -32767;
1) No domain (chess) specific thought was involved in the process, and
2) I didn't understand the code because I copied a typographical error (duplicate line) in the original. (C.f., Crafty -> Rybka bug copying).
-
hgm
- Posts: 28513
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Copying code
Allowed by what?Rebel wrote:There currently are discussions in CCC and RF about copying and it's much confusing what is allowed and what is not.
Copyright law is quite clear: copyrights extend to a 'transformed' copy as well as a verbatim copy. Translation into an other language does not liberate you of the original copyrights. If the translation could have been done automatically, without significant human effort (e.g. substituting variable names with a global edit command, running it through a Pascal-to-C converter, running gcc -S to create assembly code), you don't earn any copyrights by doing it.
If there is significant effort involved (e.g. translating an English book into Chinese), the translator earns copyrights, but this does not weaken the original copyrights in any way. It is just that you cannot copy the translation without explicit consent from both the original author, and the translator.
Now of course this all has absolutely nothing to do with Chess tournaments. Tournament organizers can apply whatever rules they want, e.g. exclude all programs where the source code contains the letter 'k', or is longer than 5000 characters, or whatever.
ICGA has rules for WCCC that require 'originality', a concept not strictly complementary to 'copied'. Of course it is clear that a verbatim copy cannot be considered original under any circumstances. But there are zillions of things that are not verbatim copies, but are also not fully original by a long stretch of the imagination. E.g. a litteral translation into another programming language, or a renaming of the variables.
The concept of 'originality' can best be understood in the context of the question: "could the creator have done what he did with no more than reasonable doubt if the similar work he is accused of plagiarizing would not have been available to him".
Perhaps some clarification for "similar work" is needed. A Chess engine, for instance, is not a "similar work" as a journal article. If someone publishes a paper on, say, futility pruning, and after reading that paper I apply futility pruning in my engine because I think it is a great idea, that is not plagiarizing the paper. Because an engine is not a paper. It would be plagiarizing if I would write a paper explaining the same thing to another journal, pretending it is my idea.
Does that make it clear?
-
Thomas Mayer
- Posts: 385
- Joined: Thu Mar 09, 2006 6:45 pm
- Location: Nellmersbach, Germany
Re: Copying code
Hi Ed,Rebel wrote:There currently are discussions in CCC and RF about copying and it's much confusing what is allowed and what is not.
Here is the deal, provided a programmer already has an engine and he wants to copy code from another engine:
Verbatim copying code does not exists because the variable names, data structure are not compatible, so he will have to rewrite the code anyway to his own variable names, data structures.
Is that own written code ?
Data is another matter of course, this can be done by copy&paste without or minimal changes, thus copying.
well, you know yourself that there is always a grey area and the answer isn't so easy and might even depend on the country like everything copyright dependant.
Let's try it with some examples transfered to books:
If you translate a book to another language the resulting book is clearly not original. Same with programs, if you translate something from let's say C to Pascal/Java the resulting program isn't original even when you have typed everything by hand.
If you switch the plot from a book to another time period (e.g. you transfer an original historic plot to another time, e.g. to the future) the resulting book isn't original in my opinion. Somehow this is compareable to translate an engine let's say from mailbox to bitboard or vice versa. But things get complicate here, e.g. some methods aren't so easy to transfer between the board representation, so the resulting program wouldn't look the same even when it is more or less the same.
In both cases above it's very likely that the author of the book (or the program) would have typed everything himself but anyway the resulting book (program) isn't original. Anyway, it depends on the chapters but it might be possible that in the second case you can copy complete parts just with some small changes. (In the book maybe parts where just thoughts of the persons are mentioned - in the program maybe the user interface)
In the second case everything depends on the difference. Let's say the Arthus saga - compare the original story, the books from Bernard Cornwell and maybe the interpretation from Marion Zimmer-Bradley. All those books are for sure original even when the acting persons (the pieces) are the same but they all are so different, the persons acting so different that no-one would go to court.
Greets, Thomas
-
Rebel
- Posts: 7564
- Joined: Thu Aug 18, 2011 12:04 pm
- Full name: Ed Schröder
Re: Copying code
I hope not.lucasart wrote: shouldn't this discussion be held in the engine origin forum ?
I am hinting at nothing other then pinning the issue of copying down to a practical example of which I suspect is often practiced and I am asking for serious comments, opinions.so you're hinting that copying ideas is the same as copying code ?
Anno 2012 we are living in a world with a strong freeware open source of 3000 elo and I like to know the rules of the game.
-
hgm
- Posts: 28513
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Copying code
Let's take a hypothetical example:
Suppose I take the Fruit code, and completely rewrite its score-determining algorithm in assembler, using the hitherto unknown technique of incrementally-updated move lists, so that it is 10 times faster than the original. But at a give ply depth, it searches exactly the same tree as Fruit, and it reports exactly the same evaluation score in each node. But because the evaluation is purely incremental, the code to obtain it doesn't resemble Fruit's evaluation in any way.
Would this be a copy in the sense of copyright law? => NO
Would it be a translation in that sense? => NO
Would it be original in the ICGA sense? => NO
Would it play stronger that the Fruit we all know and love? => You bet! (+220 Elo)
The point is that I could not by any realistic probability construct an engine that does all that without having Fruit available.
Of course I could write an engine used on alpha-beta, null move, futility and history pruning, with eval terms for mobility, king safety, piece-square tables, pawn-structure including passers, backward and isolated pawns without having seen Fruit (or in fact the code of any other engine). But the chances it moves fully identical to Fruit in every position are worse than astronomically small.
Suppose I take the Fruit code, and completely rewrite its score-determining algorithm in assembler, using the hitherto unknown technique of incrementally-updated move lists, so that it is 10 times faster than the original. But at a give ply depth, it searches exactly the same tree as Fruit, and it reports exactly the same evaluation score in each node. But because the evaluation is purely incremental, the code to obtain it doesn't resemble Fruit's evaluation in any way.
Would this be a copy in the sense of copyright law? => NO
Would it be a translation in that sense? => NO
Would it be original in the ICGA sense? => NO
Would it play stronger that the Fruit we all know and love? => You bet! (+220 Elo)
The point is that I could not by any realistic probability construct an engine that does all that without having Fruit available.
Of course I could write an engine used on alpha-beta, null move, futility and history pruning, with eval terms for mobility, king safety, piece-square tables, pawn-structure including passers, backward and isolated pawns without having seen Fruit (or in fact the code of any other engine). But the chances it moves fully identical to Fruit in every position are worse than astronomically small.
Last edited by hgm on Tue Jan 10, 2012 1:44 pm, edited 1 time in total.
-
Rebel
- Posts: 7564
- Joined: Thu Aug 18, 2011 12:04 pm
- Full name: Ed Schröder
Re: Copying code
Hi Thomas,
Indeed, the grey area. That's why I pinned the issue down to a practical example. White? Grey? Black?Thomas Mayer wrote: well, you know yourself that there is always a grey area and the answer isn't so easy and might even depend on the country like everything copyright dependant.
-
Rebel
- Posts: 7564
- Joined: Thu Aug 18, 2011 12:04 pm
- Full name: Ed Schröder
Re: Copying code
Nice post, no doubt.hgm wrote:Let's take a hypothetical example:
Suppose I take the Fruit code, and completely rewrite its score-determining algorithm in assembler, using the hitherto unknown technique of incrementally-updated move lists, so that it is 10 times faster than the original. But at a give ply depth, it searches exactly the same tree as Fruit, and it reports exactly the same evaluation score in each node. But because the evaluation is purely incremental, the code to obtain it doesn't resemble Fruit's evaluation in any way.
Would this be a copy in the sense of copyright law? => NO
Would it be a translation in that sense? => NO
Would it be original in the ICGA sense? => NO
Would it play stronger that the Fruit we all know and love? => You bet! (+220 Elo)
The point is that I could not by any realistic probability construct an engine that does all that without having Fruit available.
Of course I could write an engine used on alpha-beta, null move, futility and history pruning, with eval terms for mobility, king safety, piece-square tables, pawn-structure including passers, backward and isolated pawns without having seen Fruit (or in fact the code of any other engine). But the chances it moves fully identical to Fruit in every position are worse than astronomically small.
But it did not answer my question.
-
sje
- Posts: 4675
- Joined: Mon Mar 13, 2006 7:43 pm
No gray area here
If a chess program is produced from the source of another program and the production involves no more skill than that of a first semester coder with little knowledge of the chess domain, then there is no gray area. The result is a copy and is not an original work.