Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #29426

Re: Primality sieve challenge

From Stefan Weiss <krewecherl@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Primality sieve challenge
Date 2016-01-24 01:26 +0100
Organization albasani.net
Message-ID <n815og$a4q$1@news.albasani.net> (permalink)
References (11 earlier) <dfc4d40c-d9ef-4dab-a0b4-16d0f55776a1@googlegroups.com> <n7k49m$54l$1@news.albasani.net> <jlCBcrLGfWoWFwkC@invalid.uk.co.demon.merlyn.invalid> <n7ttan$3o3$1@news.albasani.net> <dHgu03kOW$oWFwQa@invalid.uk.co.demon.merlyn.invalid>

Show all headers | View raw


On 01/23/2016 22:50, Dr J R Stockton wrote:
> In comp.lang.javascript message <n7ttan$3o3$1@news.albasani.net>, Fri,
> 22 Jan 2016 19:44:38, Stefan Weiss <krewecherl@gmail.com> posted:
> 
>> Pixel plots are often used to visually examine the randomness of series
>> of numbers. For example, here's the output of V8's Math.random()
>> function before and after the PRNG fix in December:
>>
>>  http://goo.gl/8M4kuk
> 
> Can you say more about the V8 PRNG fix, including what (I suppose) it is
> V8 of?  Or is that VB, in which case in which system(s)?
> 
> I still maintain the master of
> <http://web.archive.org/web/20150905080518/http://www.merlyn.demon.co.uk
> /js-randm.htm>.

I was referring to V8, Google's JavaScript engine used in Chrome,
Node.js and other projects. I was about to write that it's oddly named,
but when the other engines have names like SpiderMonkey or ChakraCore,
it fits right in. The name was taken in reference to the 8-cylinder
V-shaped automobile engine, by the way, not version 8.

Last year, a problem was discovered in V8's PRNG. They were using a
rather obscure generator function for a long time, and an early/buggy
version of it, too. The awful distribution of the pseudo-random output
of that function went undetected for years, until somebody encountered
unexplainabled hash collisions and pinned V8 as the culprit. They found
a comment along the lines of "we should have used a Mersenne Twister
instead" from a code reviewer in the commit log, but the PRNG was
committed like that anyway.

After they were notified of the bug, it was quickly fixed by exchanging
the generator for something more suitable... I can't remember the name,
but it wasn't MT.

As bad as that pixel plot looks, the consequences weren't that grave
(except maybe for the company with the hash collision). Math.random()
was never intended or specified as a cryptographically secure PRNG.
These days we have the Web Crypto API for that. It's still in the draft
stage, but at least partially implemented in most current browsers.


- stefan

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-17 01:40 -0800
  Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-17 02:20 -0800
  Re: Primality sieve challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-17 16:24 +0000
    Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-17 09:03 -0800
      Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-17 09:17 -0800
        Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-17 09:22 -0800
          Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-17 11:32 -0800
          Re: Primality sieve challenge Stefan Weiss <krewecherl@gmail.com> - 2016-01-18 00:13 +0100
            Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-18 04:10 -0800
          Re: Primality sieve challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-18 01:20 +0000
            Re: Primality sieve challenge "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-18 12:16 +0100
              Re: Primality sieve challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-18 11:25 +0000
                Re: Primality sieve challenge "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-18 12:43 +0100
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-18 04:18 -0800
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-18 04:25 -0800
              Re: Primality sieve challenge Gene Wirchenko <genew@telus.net> - 2016-01-18 09:52 -0800
                Re: Primality sieve challenge "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-18 19:23 +0100
                Re: Primality sieve challenge "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-01-18 10:48 -0800
                Re: Primality sieve challenge Gene Wirchenko <genew@telus.net> - 2016-01-18 13:09 -0800
                Re: Primality sieve challenge Scott Sauyet <scott.sauyet@gmail.com> - 2016-01-18 13:14 -0800
                Re: Primality sieve challenge "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-18 22:45 +0100
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-18 14:23 -0800
                Re: Primality sieve challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-18 22:56 +0000
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-18 15:02 -0800
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-18 16:04 -0800
                Re: Primality sieve challenge Stefan Weiss <krewecherl@gmail.com> - 2016-01-19 02:42 +0100
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-18 23:34 -0800
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-19 01:34 -0800
                Re: Primality sieve challenge "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-01-19 06:23 -0800
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-19 07:10 -0800
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-19 07:15 -0800
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-19 08:34 -0800
                Re: Primality sieve challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-19 16:54 +0000
                Re: Primality sieve challenge "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-01-19 08:57 -0800
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-19 10:18 -0800
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-19 10:59 -0800
                Re: Primality sieve challenge Stefan Weiss <krewecherl@gmail.com> - 2016-01-20 01:33 +0100
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-20 02:10 -0800
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-20 02:21 -0800
                Re: Primality sieve challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-20 10:45 +0000
                Re: Primality sieve challenge "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-01-20 06:43 -0800
                Re: Primality sieve challenge Scott Sauyet <scott.sauyet@gmail.com> - 2016-01-20 15:21 -0800
                Re: Primality sieve challenge Stefan Weiss <krewecherl@gmail.com> - 2016-01-21 03:18 +0100
                Re: Primality sieve challenge Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-01-21 12:12 +0000
                Re: Primality sieve challenge Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-01-21 23:20 +0000
                Re: Primality sieve challenge Stefan Weiss <krewecherl@gmail.com> - 2016-01-22 19:44 +0100
                Re: Primality sieve challenge Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-01-23 21:50 +0000
                Re: Primality sieve challenge Stefan Weiss <krewecherl@gmail.com> - 2016-01-24 01:26 +0100
                Re: Primality sieve challenge "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-01-23 17:54 -0800
                Re: Primality sieve challenge "Chris M. Thomasson" <nospam@no-spam.ws> - 2016-01-24 13:34 -0800
                Re: Primality sieve challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-25 00:21 +0000
                Re: Primality sieve challenge Stefan Weiss <krewecherl@gmail.com> - 2016-01-25 03:08 +0100
                Re: Primality sieve challenge "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-01-24 19:35 -0800
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-25 03:53 -0800
                Re: Primality sieve challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-18 19:32 +0000
        Re: Primality sieve challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-17 19:51 +0000
          Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-17 13:43 -0800
  Re: Primality sieve challenge "Chris M. Thomasson" <nospam@nospam.nospam> - 2016-01-17 12:46 -0800
    Re: Primality sieve challenge Gene Wirchenko <genew@telus.net> - 2016-01-18 09:50 -0800
      Re: Primality sieve challenge Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-01-18 20:09 +0100
        Re: Primality sieve challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-18 19:28 +0000
          Re: Primality sieve challenge Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-01-18 21:37 +0100
            Re: Primality sieve challenge Scott Sauyet <scott.sauyet@gmail.com> - 2016-01-18 13:12 -0800
              Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-18 13:46 -0800
                Re: Primality sieve challenge jonas.thornvall@gmail.com - 2016-01-18 14:00 -0800
              Re: Primality sieve challenge Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-01-19 13:47 +0100
                Re: Primality sieve challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-19 14:04 +0000
                Re: Primality sieve challenge Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-01-19 19:59 +0100
                Re: Primality sieve challenge Scott Sauyet <scott.sauyet@gmail.com> - 2016-01-19 10:55 -0800
                Re: Primality sieve challenge Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-01-19 20:04 +0100
                Re: Primality sieve challenge Scott Sauyet <scott.sauyet@gmail.com> - 2016-01-19 13:42 -0800
                Re: Primality sieve challenge Erwin Moller <erwinmollerusenet@xs4all.nl> - 2016-01-21 17:21 +0100
                Re: Primality sieve challenge Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-02-03 19:52 +0100
        Re: Primality sieve challenge Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-01-19 19:43 +0000

csiph-web