RKISS copyright?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: RKISS copyright?

Post by mcostalba »

mcostalba wrote:
wgarvin wrote: Maybe the Stockfish team should add a comment giving attribution to the original source?
I have asked Heinz to give a look at this thread and please write me his comments...

As soon as we have more news I will post here.
Heinz was very kind to quickly reply to my request and gave me the permission to repost here his answer:

"When I remember right I took an obviously free and quite raw C-snippet
from a random-related newsgroup long time ago. When turning this to a
functional C++-class years later, I tried to find this again and failed
happily: Googling „random number generator“ & kiss throws out ~226.000
links. Not sure on the mentioned „Bob Jenkins“. There are countless
Kiss-variants out there. The honor to invent the RNG-Kiss-family belongs
to George Marsaglia for sure, who came up with this in the early 90's.
When somebody should be mentioned, then Marsaglia in my point of view.
I did nothing else but to check my C++-implementation for „true“
randomness, repeatability, thread safety... That's a lot for a concrete
RNG, but I won't even had emphasized to be mentioned as author. But
Stockfish needs this...
"

Header in rkiss.h will be changed accordingly...
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: RKISS copyright?

Post by mcostalba »

mcostalba wrote: Header in rkiss.h will be changed accordingly...
Here is the proposed change:

Code: Select all

 ** George Marsiglia invented the RNG-Kiss-family in the early 90's.
 ** This is a specific version that Heinz van Saanen derived and
 ** tested from some public domain code by Bob Jenkins:
 **
 ** Quite platform independent
 ** Passes ALL dieharder tests! Here *nix sys-rand() e.g. fails miserably:-)
 ** ~12 times faster than my *nix sys-rand()
 ** ~4 times faster than SSE2-version of Mersenne twister
 ** Average cycle length: ~2^126
 ** 64 bit seed
 ** Return doubles with a full 53 bit mantissa
 ** Thread safe
wgarvin
Posts: 838
Joined: Thu Jul 05, 2007 5:03 pm
Location: British Columbia, Canada

Re: RKISS copyright?

Post by wgarvin »

Thanks Marco! Obviously there's no legal problem with using code derived from a public domain source, or with putting it under the GPL.

Heinz probably owns the copyright on parts of it, but maybe not all of it? The new comment makes it clear where the code came from.
User avatar
Giorgio Medeot
Posts: 52
Joined: Fri Jan 29, 2010 2:01 pm
Location: Ivrea, Italy

Re: RKISS copyright?

Post by Giorgio Medeot »

Hi Marco,
I really appreciate your prompt response and the clarification from you and Heinz, thanks!
With this new comment there seems to be no ambiguity (you know, those are hard times... ;)).

Cheers,
  • Giorgio
Gerd Isenberg
Posts: 2250
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: RKISS copyright?

Post by Gerd Isenberg »

Thanks to Heinz van Saanen also for the prompt clarification. It is fine to mention Bob Jenkins and George Marsaglia, who passed away February 15, 2011.

However, I didn't recognize that particular RKISS pattern with "-^+" of prime-rotates within the KISS approaches I found so far by Marsaglia:
https://groups.google.com/group/sci.sta ... 8f07f5b2dc
https://groups.google.com/group/sci.mat ... a4658a124d

This was the latest KISS 32-bit PRNG by Marsaglia I found from 2007:
https://groups.google.com/group/comp.la ... 705a18c0f1

Code: Select all

/* C version */
static unsigned long t,x=123456789,y=362436069,z=21288629,w=14921776,c=0;
unsigned long KISS() {
  x+=545925293;
  y^=&#40;y<<13&#41;; y^=&#40;y>>17&#41;; y^=&#40;y<<5&#41;;
  t=z+w+c; z=w; c=&#40;t>>31&#41;; w=t&2147483647;
  return&#40;x+y+w&#41;;
&#125;
Gerd
Dann Corbit
Posts: 12542
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: RKISS copyright?

Post by Dann Corbit »

Gerd Isenberg wrote:Thanks to Heinz van Saanen also for the prompt clarification. It is fine to mention Bob Jenkins and George Marsaglia, who passed away February 15, 2011.

However, I didn't recognize that particular RKISS pattern with "-^+" of prime-rotates within the KISS approaches I found so far by Marsaglia:
https://groups.google.com/group/sci.sta ... 8f07f5b2dc
https://groups.google.com/group/sci.mat ... a4658a124d

This was the latest KISS 32-bit PRNG by Marsaglia I found from 2007:
https://groups.google.com/group/comp.la ... 705a18c0f1

Code: Select all

/* C version */
static unsigned long t,x=123456789,y=362436069,z=21288629,w=14921776,c=0;
unsigned long KISS&#40;) &#123;
  x+=545925293;
  y^=&#40;y<<13&#41;; y^=&#40;y>>17&#41;; y^=&#40;y<<5&#41;;
  t=z+w+c; z=w; c=&#40;t>>31&#41;; w=t&2147483647;
  return&#40;x+y+w&#41;;
&#125;
Gerd
George posted a couple more of them this year on news:comp.lang.c

Tragic that he died. A really nice guy and an interesting fellow.
User avatar
Giorgio Medeot
Posts: 52
Joined: Fri Jan 29, 2010 2:01 pm
Location: Ivrea, Italy

Re: RKISS copyright?

Post by Giorgio Medeot »

I was not aware of his death.
Really sad, indeed. :(
  • Giorgio