I may stand corrected, but a lot of engines seem to incorporate other people's code. Not saying chess specific code as that is what makes it "100% the author" but things like random number generators, compression code, egtb support (gaviota and nalimov), common data structures.
I'm just guessing that Heinz van Saanen was the one who integrated that code into Stockfish. He is mentioned on the Stockfish blog on Jul 5, 2009. I doubt there was any intention to claim that code as his own.
Since the PRNG code was released into the public domain by its author, using it in Stockfish (or any other engine) should be perfectly fine.
[Edit]: Okay, the comment in the rkiss.h file may be misleading. Here it is:
/*
Stockfish, a UCI chess playing engine derived from Glaurung 2.1
Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
Copyright (C) 2008-2010 Marco Costalba, Joona Kiiski, Tord Romstad
Stockfish is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Stockfish is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
This file is based on original code by Heinz van Saanen and is
available under the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
** A small "keep it simple and stupid" RNG with some fancy merits:
**
** 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
**
** (c) Heinz van Saanen
*/
I will however, point out that the Bob Jenkins code is for a 32-bit number and Heinz van Saanen's version is for 64-bit numbers, and the rotate amounts are different. The operations themselves may be dictated by the math behind the PRNG construction (I'm not an expert in this; ask a cryptographer I guess).
wgarvin wrote:I will however, point out that the Bob Jenkins code is for a 32-bit number and Heinz van Saanen's version is for 64-bit numbers, and the rotate amounts are different. The operations themselves may be dictated by the math behind the PRNG construction (I'm not an expert in this; ask a cryptographer I guess).
Nope. In the page I quoted in the OP it is also presented a 64 bit version, that is the same as the Stockfish one (even same rotate amounts and seed values); try to scroll down until half the page.
I would clearly prefer such stuff (like bitscan, popcount, etc.) in the public domain. Looks like Heinz van Saanen took this public domain snippet from 2009, obfuscated the ror and put it under GPL?
Depends on the application. RKISS is much faster and has shorter code, and keeps its state in a 256 bit variable and is thread safe. For some Zobrist keys certainly good enough.