Please, that's enough clones and reclones polemics,

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

Moderators: hgm, Rebel, chrisw

Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Please, that's enough clones and reclones polemics,

Post by Dann Corbit »

bob wrote:While I don't think my old idea of "how much is permissible" is the end-all idea, it is a start.

I have taken the approach to use the following conceptual idea:

If a function that is consistent from input to output, where a move generator is a good example since each position has a fixed number of moves that can be played according to the rules of chess, then perhaps copying that is not a deal-breaker on tournament participation. I can think of other similar pieces of code, such as EGTB probing, where a given position always gives the same answer of mate in N or conversion in N or draw.

Other pieces of code clearly do not follow that concept. An evaluation function is one example. For a given position, there are an infinite number of possible different evaluation outputs. Search also, since one can reduce, extend or prune a move. So those are clearly off-limits. What else?

SEE seems to be the one input one output type of code, with some room for flexibility (do you handle pins, either absolute or not, do you check for legality, etc.) But the options are limited, and one could define, precisely, a SEE() (no pins), or SEEP() (recognizes absolute pins only), SEEAP() which recognizes things like knight pinned on queen by a bishop...

RepetitionCheck()? Rules of chess are quite precise so that might be an ok thing to borrow, although there are quite a few ways to do it (separate hash table, or a repetition list, or something else entirely). But since it is a one input, one output, it seems to fit.

So we are left with the important parts, namely the search (normal and q-search), code that deals with extensions, reductions and pruning, and all the evaluation code. The code that handles time utilization.

What about hashing? Harder case, since this is not a single input -> single output precisely. You can get lots of information from a hash table. A search result. A suggested move. A bound. A hint to avoid doing a null move search. A positional evaluation. Flags such as this was a singular position previously, etc... So maybe hashing is not a one input one output idea, particularly when there are lots of replacement strategies and such.

I think if you apply that question to each function in a chess program, you will find some that are "constant" and some that are "unique". And you might find some one input one output functions inside a non one-input-one-output function. For example, in the evaluation function, you might have a piece of code called HasOpposition(wk, bk, stm). Opposition is well-defined and for any position of the two kings and stm, that function will return T or F. So one might borrow that safely, but not the code where it is used since how you use that could vary all over the place.

One other major point. If you choose to borrow something, which for me would only include the magic move generation stuff (which, by the way does not affect my move generator code at all, I just changed a macro in a very simple way), would be that one must at least provide a proper citation or give credit to the originator of the code that was used. And one would have to abide by the GPL if pieces of a GPL program are borrowed. There is a subtle issue of a GPL program that borrows code from a non-GPL program. That's not supposed to happen, but it does, and it certainly clouds the issue.

The "heart and soul" of a chess engine is the search and evaluation. And copying that code should be a clear no-no. For those one-input-one-output functions, I don't see a problem with them. We already have several common examples. egtb.cpp was originally released as a part of Crafty, written by Eugene Nalimov. Many have used this code. Now MB has released his bitbase stuff and several have used that. Ditto for Pradu's magic move generator idea. Ditto for my rotated bitboard stuff. And we have never seen a program excluded from competition for using those. Nor should we.

There are grey areas such as piece/square tables and others. While there are an infinite number of possible piece/square tables, there are probably fewer than that useful ones. Can someone make a case for any particular piece where there are some obvious numbers and no others make any sense at all? I can't think of one, but that doesn't mean it doesn't exist. Individual scoring numbers? Would two different programmers agree on every scoring term in their evaluation? Can one make a case that fixing one value then dictates the rest if the evaluation is going to be "sane"? Doesn't seem reasonable, but doesn't seem like "impossible" could be proven.

This issue is a very complex one, and it is not going to be a quick and dirty fix I am afraid. It will take some logical/rational discourse and thought to arrive at something that is anywhere near workable.

And now you have answered the question "what is permissible?" That is only the first step, and probably the easiest step although it represents a really significant effort itself. Next is how to validate programs to screen out the bad ones. That is the real can of worms...
I think it is a difficult path, no matter what.

For instance, let's take piece-square tables. I would argue that there is some perfect set of numbers for piece square tables. Of course, it would be very difficult to find it. But it would be based on fundamental ideas like controlling the center, controlling space, and (perhaps) things like the recent statistical analysis by Joshua Shriver.

Eventually, the best programs will converge to similar values, given enough time. Are they now all cheaters if their numbers start to agree?
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Please, that's enough clones and reclones polemics,

Post by Don »

benstoker wrote:Tell me if I'm wrong, but I would wager that 10 or 15 years ago there were very significant differences between the top 10 chess engines in both "Ideas" and code. Contrast that with today; I bet the top 5 or 10 engines all use the same ideas. All use bitboards. All use all of the state of the art ideas in computer chess. If you don't use the state of the art ideas, your engine will simply not be in the top. The differences are but shades of gray compared to 10 years ago.
This same argument comes up over and over again as if it is clear justification for plagiarism.

Trying to turn black and white into gray is a common tactic and often doesn't stop until black is actually turned into white. First, it starts out as the question, "is it really that bad?" and eventually turned into an argument about why it is actually a good thing. The trick is to get people to accept compromise in gradual stages. Usually a little ridicule is thrown in, such as the topic of this thread - ridicule anyone with integrity as being moralistic or imply they are being narrow minded or authoritarian.
Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Please, that's enough clones and reclones polemics,

Post by Dann Corbit »

Don wrote:
benstoker wrote:Tell me if I'm wrong, but I would wager that 10 or 15 years ago there were very significant differences between the top 10 chess engines in both "Ideas" and code. Contrast that with today; I bet the top 5 or 10 engines all use the same ideas. All use bitboards. All use all of the state of the art ideas in computer chess. If you don't use the state of the art ideas, your engine will simply not be in the top. The differences are but shades of gray compared to 10 years ago.
This same argument comes up over and over again as if it is clear justification for plagiarism.

Trying to turn black and white into gray is a common tactic and often doesn't stop until black is actually turned into white. First, it starts out as the question, "is it really that bad?" and eventually turned into an argument about why it is actually a good thing. The trick is to get people to accept compromise in gradual stages. Usually a little ridicule is thrown in, such as the topic of this thread - ridicule anyone with integrity as being moralistic or imply they are being narrow minded or authoritarian.
It's an old problem:
(Isaiah 5:20) 20 Woe to those who are saying that good is bad and bad is good, those who are putting darkness for light and light for darkness, those who are putting bitter for sweet and sweet for bitter!
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Please, that's enough clones and reclones polemics,

Post by Don »

Dann Corbit wrote:
Don wrote:
benstoker wrote:Tell me if I'm wrong, but I would wager that 10 or 15 years ago there were very significant differences between the top 10 chess engines in both "Ideas" and code. Contrast that with today; I bet the top 5 or 10 engines all use the same ideas. All use bitboards. All use all of the state of the art ideas in computer chess. If you don't use the state of the art ideas, your engine will simply not be in the top. The differences are but shades of gray compared to 10 years ago.
This same argument comes up over and over again as if it is clear justification for plagiarism.

Trying to turn black and white into gray is a common tactic and often doesn't stop until black is actually turned into white. First, it starts out as the question, "is it really that bad?" and eventually turned into an argument about why it is actually a good thing. The trick is to get people to accept compromise in gradual stages. Usually a little ridicule is thrown in, such as the topic of this thread - ridicule anyone with integrity as being moralistic or imply they are being narrow minded or authoritarian.
It's an old problem:
(Isaiah 5:20) 20 Woe to those who are saying that good is bad and bad is good, those who are putting darkness for light and light for darkness, those who are putting bitter for sweet and sweet for bitter!
Yes, and in the world today there is no shortage of examples of it.
SuneF
Posts: 127
Joined: Thu Sep 17, 2009 11:19 am

Re: Please, that's enough clones and reclones polemics,

Post by SuneF »

bob wrote:While I don't think my old idea of "how much is permissible" is the end-all idea, it is a start.

I have taken the approach to use the following conceptual idea:

If a function that is consistent from input to output, where a move generator is a good example since each position has a fixed number of moves that can be played according to the rules of chess, then perhaps copying that is not a deal-breaker on tournament participation.
A move generator is bad example. You can have fully legal, pseudo legal, incremental, check evasion, with and without sorting and so forth, it's not trivial at all.
I think the key is to be honest about what you reuse. Ie. there are engines originally derived from TSCP which is now very strong and totally 100% refactured. I'd not have any problem with those entering tournaments or getting officially rated.
bob wrote: One other major point. If you choose to borrow something, which for me would only include the magic move generation stuff (which, by the way does not affect my move generator code at all, I just changed a macro in a very simple way), would be that one must at least provide a proper citation or give credit to the originator of the code that was used.
Funny, not so long ago you claimed the exact opposite, that you had to changed a lot to use support magics?

But I agree, that anytime anything is used, proper credit should be given and much more specifically than "the engine is inspired by Stockfish, Crafty and other open source engines". If anything has been copied it must be stated explicitly which parts have been copied. Most doesn't seem to have a problem with copying for instance the Nalimov probe code and they have no problem with admitting that the book author is this or that guy.
bob wrote: And now you have answered the question "what is permissible?" That is only the first step, and probably the easiest step although it represents a really significant effort itself. Next is how to validate programs to screen out the bad ones. That is the real can of worms...
I think the big question is what to do about those that aren't permissible.
If we cannot sanction them in some way there is no point in the having a discussion about what is and what isn't permissible.