[Webkit-unassigned] [Bug 98586] Extend random precision to 53bits

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Oct 7 11:44:15 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=98586





--- Comment #11 from Geoffrey Garen <ggaren at apple.com>  2012-10-07 11:44:48 PST ---
(From update of attachment 167475)
View in context: https://bugs.webkit.org/attachment.cgi?id=167475&action=review

Ollie, this patch looks good to me. What do you think?

I believe the case where 53 bits of randomness was a performance regression was back when we used Windows super crypto random, which boils a pot of tea and measures the molecular temperature before returning.

> LayoutTests/fast/js/script-tests/53bits-random.js:5
> +var MAX = 1000000;

toString(2) will be 55 in length if the last bit is 1. The odds of that are 1/2. If we want the odds of test failure to be 1/1000000, we should only loop about 20 times. Looping 1000000 times will hide errors in the random distribution of the last bit.

> LayoutTests/fast/js/script-tests/53bits-random.js:10
> +    if (Math.random().toString(2).length === (53 + 2)) {
> +        found = true;

You should look *both* for a case where the last bit is 1, *and* the case where the last bit is 0. Otherwise, putting all 1's in the non-random bits will pass this test.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list