Bug 214093 - Add a fuzzing toggle for LICM
Summary: Add a fuzzing toggle for LICM
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-08 12:21 PDT by Saam Barati
Modified: 2020-07-08 14:34 PDT (History)
16 users (show)

See Also:


Attachments
patch (3.86 KB, patch)
2020-07-08 12:35 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2020-07-08 12:21:34 PDT
Since we have an AI based safety checker for LICM, it's helpful to fuzz that we've implemented our AI safety checker correctly by deciding to randomly not hoist nodes.
Comment 1 Saam Barati 2020-07-08 12:35:11 PDT
Created attachment 403803 [details]
patch
Comment 2 Yusuke Suzuki 2020-07-08 12:42:29 PDT
Comment on attachment 403803 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=403803&action=review

r=me

> Source/JavaScriptCore/dfg/DFGLICMPhase.cpp:185
> +        WeakRandom random { Options::seedForLICMFuzzer() };

Initialize it only when using with useLICMFuzzing. WeakRandom reads random seeds from entropy pool and this is super slow.
Comment 3 Saam Barati 2020-07-08 13:35:29 PDT
Comment on attachment 403803 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=403803&action=review

>> Source/JavaScriptCore/dfg/DFGLICMPhase.cpp:185
>> +        WeakRandom random { Options::seedForLICMFuzzer() };
> 
> Initialize it only when using with useLICMFuzzing. WeakRandom reads random seeds from entropy pool and this is super slow.

Even when it’s seeded?
Comment 4 Saam Barati 2020-07-08 14:13:11 PDT
(In reply to Saam Barati from comment #3)
> Comment on attachment 403803 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=403803&action=review
> 
> >> Source/JavaScriptCore/dfg/DFGLICMPhase.cpp:185
> >> +        WeakRandom random { Options::seedForLICMFuzzer() };
> > 
> > Initialize it only when using with useLICMFuzzing. WeakRandom reads random seeds from entropy pool and this is super slow.
> 
> Even when it’s seeded?

I've verified that this only does simple arithmetic when it's seeded. The default seed is "cryptographicallyRandomNumber()", which is probably what you're thinking about.
Comment 5 EWS 2020-07-08 14:33:58 PDT
Committed r264133: <https://trac.webkit.org/changeset/264133>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 403803 [details].
Comment 6 Radar WebKit Bug Importer 2020-07-08 14:34:13 PDT
<rdar://problem/65241432>