Programmer code of honor

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
Rebel
Posts: 7376
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Programmer code of honor

Post by Rebel »

Subject: Programmer code of honor

Hello all,

This email is meant for all chess programmers and can be freely distributed. It concerns the current state of ongoing confusion among chess programmers about what is allowed and what is not regarding taking code | taking ideas | reverse engineering binaries from competitors.

I believe the chess programmers community is in need for a "Programmer code", a code of honor to keep.

To establish that I created an entry form at:

http://www.top-5000.nl/programmer_code.htm

The success of this initiative will be in the support it receives. When the list is long and impressive the wish to be on it will increase. So there is a bit of emotional blackmail involved. But then again you are basically asked to keep the law of your country except for point 3 which is new but common in the academic and scientific world but nevertheless could be a bridge too far for some.

Thanks for listening and good luck,

Ed
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Programmer code of honor

Post by zullil »

Shouldn't the entry form have a box for engine name(s)?
lucasart
Posts: 3241
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Programmer code of honor

Post by lucasart »

Let's take a concrete example, my program DiscoCheck.

The PRNG I use is based on public domain code by Bob Jenkins. This is clearly stated at the source code level, at the header level (just after the GNU GPL legal stuff).

General purpose code, like UCI option parsing or C standard "extensions" (functions like strdup a customized printf etc.), are based on Fruit. This is clearly stated in the source code too. When it comes to tedious operations like string parsing in C, I don't want to reinvent the wheel, and I don't see the crime there.

PST is a bit of a long story. I first used the PST from the simplified eval function described in the chess programming wiki. Then I wanted to reduce massively the numbers of param to optimize them later, so I wrote from scratch my parametric PST. Then I looked at Fruit, and noticed that Fabien had done the same, but in a way that looked so much nicer. So I rewrote all from scratch following the idea of Fruit, and then found siome simplifications, and did some finetuning of some of the weights. Again this is documented in the code at header level.

magic bitboards generation code is a (almost) verbatim copy of Umko. Clearly stated in the source code too. I spent countless hours writing from scratch rotated bitboards, based solely on a conceptual description of it. So I didn't want to reinvent the wheel of magic bitboards. I just needed an implementation of it that was not legally incumbered (Umko is GPL and so is DiscoCheck so it's all acording to the book).

A trick in the qsearch about check evasions was taken from Stockfish. This is stated in the code.

All the rest is genuine.

So in what category does that put DiscoCheck:
* it cannot be 100% original work because of what I say above, right ?
* some things are based on idea but code is entirely original with a mix of my own ideas + other program's idea. This is the case of the PST.
* it is not a derivated engine from another engine. This is because I wrote all from scratch, starting from bitboards, board representation, move play/undo generation, legal move filtering, perft debugging, etc. And I can say that this is a *lot* of work.
* however some parts are verbatim copies of other programs: magic bitboards generation from Umko, some trivial functions (like a customized printf) from Fruit.

The derivative category is clear. But the 3 others aren't: I trhink no non derivative program is either of the 3. Some portions can be verbatim, some portions can be based on ideas. So every independant portion of code could fall into a different category.

PS: I am not dishonest and I have nothing to hide, and nothing to prove either. My source code is made available, which isn't the case of most unfortunately. And all that is taken (to any degree from verbatim to idea) is mentionned clearly.
User avatar
Rebel
Posts: 7376
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: Programmer code of honor

Post by Rebel »

zullil wrote:Shouldn't the entry form have a box for engine name(s)?
Silent update :wink:
User avatar
Rebel
Posts: 7376
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: Programmer code of honor

Post by Rebel »

lucasart wrote:Let's take a concrete example, my program DiscoCheck.
I would say, "inspired by" as your code is original. Then in comments name a few inspiration sources and give a link to your open source code. The latter is the best programmer-code possible.
The PRNG I use is based on public domain code by Bob Jenkins. This is clearly stated at the source code level, at the header level (just after the GNU GPL legal stuff).

General purpose code, like UCI option parsing or C standard "extensions" (functions like strdup a customized printf etc.), are based on Fruit. This is clearly stated in the source code too. When it comes to tedious operations like string parsing in C, I don't want to reinvent the wheel, and I don't see the crime there.

PST is a bit of a long story. I first used the PST from the simplified eval function described in the chess programming wiki. Then I wanted to reduce massively the numbers of param to optimize them later, so I wrote from scratch my parametric PST. Then I looked at Fruit, and noticed that Fabien had done the same, but in a way that looked so much nicer. So I rewrote all from scratch following the idea of Fruit, and then found siome simplifications, and did some finetuning of some of the weights. Again this is documented in the code at header level.

magic bitboards generation code is a (almost) verbatim copy of Umko. Clearly stated in the source code too. I spent countless hours writing from scratch rotated bitboards, based solely on a conceptual description of it. So I didn't want to reinvent the wheel of magic bitboards. I just needed an implementation of it that was not legally incumbered (Umko is GPL and so is DiscoCheck so it's all acording to the book).

A trick in the qsearch about check evasions was taken from Stockfish. This is stated in the code.

All the rest is genuine.

So in what category does that put DiscoCheck:
* it cannot be 100% original work because of what I say above, right ?
* some things are based on idea but code is entirely original with a mix of my own ideas + other program's idea. This is the case of the PST.
* it is not a derivated engine from another engine. This is because I wrote all from scratch, starting from bitboards, board representation, move play/undo generation, legal move filtering, perft debugging, etc. And I can say that this is a *lot* of work.
* however some parts are verbatim copies of other programs: magic bitboards generation from Umko, some trivial functions (like a customized printf) from Fruit.

The derivative category is clear. But the 3 others aren't: I trhink no non derivative program is either of the 3. Some portions can be verbatim, some portions can be based on ideas. So every independant portion of code could fall into a different category.

PS: I am not dishonest and I have nothing to hide, and nothing to prove either. My source code is made available, which isn't the case of most unfortunately. And all that is taken (to any degree from verbatim to idea) is mentionned clearly.
I think this is a fine example how modern chess programming can be, learning from internet resources and then building your own work.
User avatar
Dan Honeycutt
Posts: 5258
Joined: Mon Feb 27, 2006 4:31 pm
Location: Atlanta, Georgia

Re: Programmer code of honor

Post by Dan Honeycutt »

Hi Ed,

I signed and hit submit but I didn't show up in the list.

Best
Dan H.
lucasart
Posts: 3241
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Programmer code of honor

Post by lucasart »

Dan Honeycutt wrote:Hi Ed,

I signed and hit submit but I didn't show up in the list.

Best
Dan H.
Same here :roll:
User avatar
Rebel
Posts: 7376
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: Programmer code of honor

Post by Rebel »

You are both on now. I have to do things manually.
yl84
Posts: 21
Joined: Tue Sep 07, 2010 6:37 pm

Re: Programmer code of honor

Post by yl84 »

Hi Ed,
I also do not appear in the list
yves (Milady)
User avatar
Rebel
Posts: 7376
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: Programmer code of honor

Post by Rebel »

yl84 wrote:Hi Ed,
I also do not appear in the list
yves (Milady)
But "Sir", you are :wink: