GitHub PushEvent at 2014-12-09 15:30:48
Repository: Stockfish
Actor: glinscott
Payload: {"shas":[["fbb53524efd94c4b227c72c725c628a4aa5f9f72","8d1865a680536adfe93aa9311183e9f99c714e9c@gmail.com","Rename some variables for more clarity.\n\nNo functional change.\n\nResolves #131","hxim",true],["a87da2c4b3dce975fa8642c352c99aed5a1420f8","0da429529a7db13f590db06335220b388ae04581@gmail.com","Add some tablebase positions to bench\n\nThis makes it easier to check for regressions in the tablebase code.\n\nBench: 9489202\n5-man bench: 8943906\n\nResolves #145","Gary Linscott",true],["158864270a055fe20dca4a87f4b7a8aa9cedfeb9","9c8814d8e61e7c5dd5eb679c0bac32929a83965a@gmail.com","Simpler PRNG and faster magics search\n\nThis patch replaces RKISS by a simpler and faster PRNG, xorshift64* proposed\nby S. Vigna (2014). It is extremely simple, has a large enough period for\nStockfish's needs (2^64), requires no warming-up (allowing such code to be\nremoved), and offers slightly better randomness than MT19937.\n\nPaper: http://xorshift.di.unimi.it/\nReference source code (public domain):\nhttp://xorshift.di.unimi.it/xorshift64star.c\n\nThe patch also simplifies how init_magics() searches for magics:\n\n- Old logic: seed the PRNG always with the same seed,\n  then use optimized bit rotations to tailor the RNG sequence per rank.\n\n- New logic: seed the PRNG with an optimized seed per rank.\n\nThis has two advantages:\n1. Less code and less computation to perform during magics search (not ROTL).\n2. More choices for random sequence tuning. The old logic only let us choose\nfrom 4096 bit rotation pairs. With the new one, we can look for the best seeds\namong 2^64 values. Indeed, the set of seeds[][] provided in the patch reduces\nthe effort needed to find the magics:\n\n64-bit SF:\nOld logic -> 5,783,789 rand64() calls needed to find the magics\nNew logic -> 4,420,086 calls\n\n32-bit SF:\nOld logic -> 2,175,518 calls\nNew logic -> 1,895,955 calls\n\nIn the 64-bit case, init_magics() take 25 ms less to complete (Intel Core i5).\n\nFinally, when playing with strength handicap, non-determinism is achieved\nby setting the seed of the static RNG only once. Afterwards, there is no need\nto skip output values.\n\nThe bench only changes because the Zobrist keys are now different (since they\nare random numbers straight out of the PRNG).\n\nThe RNG seed has been carefully chosen so that the\nresulting Zobrist keys are particularly well-behaved:\n\n1. All triplets of XORed keys are unique, implying that it\n   would take at least 7 keys to find a 64-bit collision\n   (test suggested by ceebo)\n\n2. All pairs of XORed keys are unique modulo 2^32\n\n3. The cardinality of { (key1 ^ key2) >> 48 } is as close\n   as possible to the maximum (65536)\n\nPoint 2 aims at ensuring a good distribution among the bits\nthat determine an TT entry's cluster, likewise point 3\namong the bits that form the TT entry's key16 inside a\ncluster.\n\nDetails:\n\n     Bitset   card(key1^key2)\n     ------   ---------------\nRKISS\n     key16     64894   = 99.020% of theoretical maximum\n     low18    180117   = 99.293%\n     low32    305362   = 99.997%\n\nXorshift64*, old seed\n     key16     64918   = 99.057%\n     low18    179994   = 99.225%\n     low32    305350   = 99.993%\n\nXorshift64*, new seed\n     key16     65027   = 99.223%\n     low18    181118   = 99.845%\n     low32    305371   = 100.000%\n\nBench: 9324905\n\nResolves #148","Ernesto Gatti",true]],"size":3,"ref":"refs/heads/master","head":"158864270a055fe20dca4a87f4b7a8aa9cedfeb9"}