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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Oct 6 10:35:51 PDT 2012


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





--- Comment #3 from Geoffrey Garen <ggaren at apple.com>  2012-10-06 10:36:22 PST ---
(From update of attachment 167443)
View in context: https://bugs.webkit.org/attachment.cgi?id=167443&action=review

> Source/JavaScriptCore/ChangeLog:3
> +        Extend random precision to 53bits

If this creates an observable benefit, you should be able to write a regression test for it.

> Source/JavaScriptCore/runtime/WeakRandom.h:71
> +        uint32_t a = static_cast<uint32_t>(getUint32()) >> 5;

I think this would be clearer as a uint64_t.

> Source/JavaScriptCore/runtime/WeakRandom.h:72
> +        uint32_t b = static_cast<uint32_t>(getUint32()) >> 6;

I think this would be clearer as a uint64_t.

> Source/JavaScriptCore/runtime/WeakRandom.h:73
> +        uint64_t combined = (static_cast<uint64_t>(a) << 26) | b;

I think it would be clearer just to shift 'a' right by 21 and then left by 32. It's not clear what you're trying to accomplish by removing bits from both values. For example, maybe you think that increases the randomness. But if each bit is random, that's not the case.

-- 
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