Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Issue 10830318: Use a different algorithm with the low entropy source for field trials. (Closed)

Created:
8 years, 4 months ago by Alexei Svitkine (slow)
Modified:
8 years, 3 months ago
CC:
chromium-reviews, MAD, jar (doing other things), jam, joi+watch-content_chromium.org, darin-cc_chromium.org, brettw-cc_chromium.org, erikwright+watch_chromium.org, hfung, Mark P
Visibility:
Public.

Description

Use a different algorithm with the low entropy source for field trials. The new algorithm maps the original 13-bit low entropy source to a new 13-bit entropy value using a mapping that is shuffled using the trial name as a seed. The algorithm is roughly as follows: Take the low entropy source as an integer between 0-8191. Generate an identity mapping of size 8192 where mapping[i] == i. Seed a Mersenne Twister random number generator with the hash of the field trial name. Use the seeded random number generator to shuffle the mapping array. Map the low entropy source using the mapping array, i.e. entropy' = mapping[entropy]. Divide the resulting entropy' by 8192 to produce a double in the range of [0, 1) that will be used for bucketing in field_trial.cc. The above algorithm improves uniformity over the existing entropy provider when the 13-bit entropy source is used while still providing very little overlaps of buckets between different field trials. Adds third_party library mt19937ar, an implementation of Mersenne Twister, for the seeded random number generation. This is needed until C++11 becomes available for use in Chromium, at which point C++11's <random> could be used. BUG=143239 TEST=Unit tests. Additionally, verified that the new algorithm produces uniform results with very little overlap of buckets between different field trials. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=153322

Patch Set 1 : #

Total comments: 19

Patch Set 2 : #

Total comments: 17

Patch Set 3 : #

Patch Set 4 : #

Total comments: 62

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Total comments: 10

Patch Set 9 : #

Patch Set 10 : #

Total comments: 12

Patch Set 11 : #

Patch Set 12 : #

Patch Set 13 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1038 lines, -206 lines) Patch
M .gitignore View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M base/metrics/field_trial.h View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +29 lines, -23 lines 0 comments Download
M base/metrics/field_trial.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +28 lines, -43 lines 0 comments Download
M base/metrics/field_trial_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +1 line, -96 lines 0 comments Download
M chrome/browser/chrome_browser_main.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chrome_browser_main_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +26 lines, -20 lines 0 comments Download
M chrome/browser/metrics/metrics_service.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +15 lines, -9 lines 0 comments Download
M chrome/browser/metrics/metrics_service.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +14 lines, -7 lines 0 comments Download
M chrome/chrome_common.gypi View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/DEPS View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
A chrome/common/metrics/entropy_provider.h View 1 2 3 4 5 6 7 8 1 chunk +95 lines, -0 lines 0 comments Download
A chrome/common/metrics/entropy_provider.cc View 1 2 3 4 5 6 7 8 1 chunk +124 lines, -0 lines 0 comments Download
A chrome/common/metrics/entropy_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +337 lines, -0 lines 0 comments Download
M chrome/common/metrics/variations/variations_util_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -1 line 0 comments Download
M chrome_frame/chrome_tab.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -1 line 0 comments Download
M chrome_frame/test/run_all_unittests.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -1 line 0 comments Download
M content/renderer/renderer_main.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -4 lines 0 comments Download
A third_party/mt19937ar/LICENSE View 1 chunk +35 lines, -0 lines 0 comments Download
A third_party/mt19937ar/README.chromium View 1 chunk +19 lines, -0 lines 0 comments Download
A third_party/mt19937ar/mt19937ar.h View 1 chunk +65 lines, -0 lines 0 comments Download
A third_party/mt19937ar/mt19937ar.cc View 1 chunk +140 lines, -0 lines 0 comments Download
A third_party/mt19937ar/mt19937ar.gyp View 1 chunk +19 lines, -0 lines 0 comments Download
A third_party/mt19937ar/readme-mt.txt View 1 chunk +74 lines, -0 lines 0 comments Download

Messages

Total messages: 35 (0 generated)
Alexei Svitkine (slow)
Primary reviewers: Steve and Ilya chrome/ and content/ OWNERS approval: Brett chrome_frame/ OWNERS approval: Robert ...
8 years, 4 months ago (2012-08-16 20:12:57 UTC) #1
SteveT
Looking good. Mostly questions and a few nits inline. http://codereview.chromium.org/10830318/diff/5042/base/metrics/field_trial.cc File base/metrics/field_trial.cc (right): http://codereview.chromium.org/10830318/diff/5042/base/metrics/field_trial.cc#newcode88 base/metrics/field_trial.cc:88: ...
8 years, 4 months ago (2012-08-16 20:55:42 UTC) #2
robertshield
Chrome Frame stuff LGTM http://codereview.chromium.org/10830318/diff/5042/chrome_frame/test/run_all_unittests.cc File chrome_frame/test/run_all_unittests.cc (right): http://codereview.chromium.org/10830318/diff/5042/chrome_frame/test/run_all_unittests.cc#newcode57 chrome_frame/test/run_all_unittests.cc:57: base::FieldTrialList field_trial_list(NULL); I disapprove of ...
8 years, 4 months ago (2012-08-16 21:18:01 UTC) #3
Alexei Svitkine (slow)
Replying to some of the comments. Will address the others tomorrow. Also, fixed an issue ...
8 years, 4 months ago (2012-08-16 21:27:11 UTC) #4
Ilya Sherman
lg (other than the concerns about the test code). Jim should definitely take a look ...
8 years, 4 months ago (2012-08-17 07:34:28 UTC) #5
Ilya Sherman
Also, I think it might be best to have the Mersenne Twister library reviewed in ...
8 years, 4 months ago (2012-08-17 07:35:15 UTC) #6
Alexei Svitkine (slow)
http://codereview.chromium.org/10830318/diff/5042/chrome/common/metrics/entropy_provider.h File chrome/common/metrics/entropy_provider.h (right): http://codereview.chromium.org/10830318/diff/5042/chrome/common/metrics/entropy_provider.h#newcode46 chrome/common/metrics/entropy_provider.h:46: // should contain a large amount of entropy - ...
8 years, 4 months ago (2012-08-17 14:08:59 UTC) #7
Alexei Svitkine (slow)
Ilya: Regarding the test you have some concerns about - it's actually just an existing ...
8 years, 4 months ago (2012-08-17 14:11:10 UTC) #8
SteveT
LGTM. Thanks for answering those questions and addressing those nits. Curious to see what the ...
8 years, 4 months ago (2012-08-17 14:26:57 UTC) #9
Alexei Svitkine (slow)
http://codereview.chromium.org/10830318/diff/5042/chrome_frame/test/run_all_unittests.cc File chrome_frame/test/run_all_unittests.cc (right): http://codereview.chromium.org/10830318/diff/5042/chrome_frame/test/run_all_unittests.cc#newcode57 chrome_frame/test/run_all_unittests.cc:57: base::FieldTrialList field_trial_list(NULL); On 2012/08/16 21:18:01, robertshield wrote: > I ...
8 years, 4 months ago (2012-08-17 16:42:16 UTC) #10
hfung
http://codereview.chromium.org/10830318/diff/4096/chrome/browser/metrics/metrics_service.cc File chrome/browser/metrics/metrics_service.cc (right): http://codereview.chromium.org/10830318/diff/4096/chrome/browser/metrics/metrics_service.cc#newcode562 chrome/browser/metrics/metrics_service.cc:562: entropy_provider.reset(new PermutedEntropyProvider(GetLowEntropySource(), GetLowEntropySource() -> low_entropy_source? http://codereview.chromium.org/10830318/diff/4096/chrome/common/metrics/entropy_provider.cc File chrome/common/metrics/entropy_provider.cc (right): ...
8 years, 4 months ago (2012-08-17 17:35:40 UTC) #11
Ilya Sherman
On 2012/08/17 14:11:10, Alexei Svitkine wrote: > Ilya: Regarding the test you have some concerns ...
8 years, 4 months ago (2012-08-17 17:53:11 UTC) #12
Ilya Sherman
http://codereview.chromium.org/10830318/diff/5042/third_party/mt19937ar/mt19937ar.h File third_party/mt19937ar/mt19937ar.h (right): http://codereview.chromium.org/10830318/diff/5042/third_party/mt19937ar/mt19937ar.h#newcode50 third_party/mt19937ar/mt19937ar.h:50: On 2012/08/17 14:08:59, Alexei Svitkine wrote: > On 2012/08/16 ...
8 years, 4 months ago (2012-08-17 17:53:20 UTC) #13
Alexei Svitkine (slow)
http://codereview.chromium.org/10830318/diff/4096/chrome/browser/metrics/metrics_service.cc File chrome/browser/metrics/metrics_service.cc (right): http://codereview.chromium.org/10830318/diff/4096/chrome/browser/metrics/metrics_service.cc#newcode562 chrome/browser/metrics/metrics_service.cc:562: entropy_provider.reset(new PermutedEntropyProvider(GetLowEntropySource(), On 2012/08/17 17:35:40, hfung wrote: > GetLowEntropySource() ...
8 years, 4 months ago (2012-08-17 17:57:40 UTC) #14
Alexei Svitkine (slow)
http://codereview.chromium.org/10830318/diff/4096/base/metrics/field_trial.h File base/metrics/field_trial.h (right): http://codereview.chromium.org/10830318/diff/4096/base/metrics/field_trial.h#newcode295 base/metrics/field_trial.h:295: explicit FieldTrialList(FieldTrial::EntropyProvider* entropy_provider); On 2012/08/17 17:53:20, Ilya Sherman wrote: ...
8 years, 4 months ago (2012-08-17 17:58:58 UTC) #15
Ilya Sherman
http://codereview.chromium.org/10830318/diff/4096/base/metrics/field_trial.h File base/metrics/field_trial.h (right): http://codereview.chromium.org/10830318/diff/4096/base/metrics/field_trial.h#newcode295 base/metrics/field_trial.h:295: explicit FieldTrialList(FieldTrial::EntropyProvider* entropy_provider); On 2012/08/17 17:58:58, Alexei Svitkine wrote: ...
8 years, 4 months ago (2012-08-17 18:16:55 UTC) #16
jar (doing other things)
Per comment by Isherman... I looked through the code. I didn't see any problems, other ...
8 years, 4 months ago (2012-08-17 19:06:19 UTC) #17
Ilya Sherman
http://codereview.chromium.org/10830318/diff/4096/chrome/browser/metrics/metrics_service.h File chrome/browser/metrics/metrics_service.h (right): http://codereview.chromium.org/10830318/diff/4096/chrome/browser/metrics/metrics_service.h#newcode103 chrome/browser/metrics/metrics_service.h:103: scoped_ptr<base::FieldTrial::EntropyProvider> GetEntropyProvider( On 2012/08/17 19:06:19, jar wrote: > nit: ...
8 years, 4 months ago (2012-08-17 19:14:00 UTC) #18
Alexei Svitkine (slow)
Thanks Jim, I've addressed your comments below. http://codereview.chromium.org/10830318/diff/4096/base/metrics/field_trial.cc File base/metrics/field_trial.cc (right): http://codereview.chromium.org/10830318/diff/4096/base/metrics/field_trial.cc#newcode60 base/metrics/field_trial.cc:60: : entropy_provider_(entropy_provider), ...
8 years, 4 months ago (2012-08-20 15:57:40 UTC) #19
Alexei Svitkine (slow)
https://chromiumcodereview.appspot.com/10830318/diff/5044/chrome/common/metrics/entropy_provider_unittest.cc File chrome/common/metrics/entropy_provider_unittest.cc (right): https://chromiumcodereview.appspot.com/10830318/diff/5044/chrome/common/metrics/entropy_provider_unittest.cc#newcode143 chrome/common/metrics/entropy_provider_unittest.cc:143: // range (i.e. the test would start timing out ...
8 years, 4 months ago (2012-08-20 16:02:55 UTC) #20
Ilya Sherman
Thanks for writing the distribution-based tests, Alexei :) I think the most appropriate pass/fail conditions ...
8 years, 4 months ago (2012-08-21 03:42:27 UTC) #21
Alexei Svitkine (slow)
http://codereview.chromium.org/10830318/diff/6116/base/metrics/field_trial.cc File base/metrics/field_trial.cc (right): http://codereview.chromium.org/10830318/diff/6116/base/metrics/field_trial.cc#newcode218 base/metrics/field_trial.cc:218: FieldTrialList::FieldTrialList(const FieldTrial::EntropyProvider* provider) On 2012/08/21 03:42:27, Ilya Sherman wrote: ...
8 years, 4 months ago (2012-08-21 14:25:48 UTC) #22
Alexei Svitkine (slow)
I've updated the uniformity test to use the Chi-Square Goodness of Fit test, which is ...
8 years, 4 months ago (2012-08-21 17:53:58 UTC) #23
Alexei Svitkine (slow)
On 2012/08/21 17:53:58, Alexei Svitkine wrote: > I've updated the uniformity test to use the ...
8 years, 4 months ago (2012-08-21 19:47:48 UTC) #24
Ilya Sherman
LGTM, though I don't know enough of the statistics to know whether the chi-squared test ...
8 years, 4 months ago (2012-08-22 04:07:41 UTC) #25
Alexei Svitkine (slow)
Hi Ilya, I've addressed your latest nits. See below for responses to your comments. "Based ...
8 years, 4 months ago (2012-08-22 16:53:27 UTC) #26
Ilya Sherman
On 2012/08/22 16:53:27, Alexei Svitkine wrote: > Ok now, that that's out of the way... ...
8 years, 4 months ago (2012-08-22 22:20:02 UTC) #27
Alexei Svitkine (slow)
On Wed, Aug 22, 2012 at 6:20 PM, <isherman@chromium.org> wrote: > On 2012/08/22 16:53:27, Alexei ...
8 years, 4 months ago (2012-08-22 22:39:11 UTC) #28
jar (doing other things)
Please fix the one nit below.... and then LGTM. http://codereview.chromium.org/10830318/diff/4096/chrome/common/metrics/entropy_provider_unittest.cc File chrome/common/metrics/entropy_provider_unittest.cc (right): http://codereview.chromium.org/10830318/diff/4096/chrome/common/metrics/entropy_provider_unittest.cc#newcode48 chrome/common/metrics/entropy_provider_unittest.cc:48: ...
8 years, 4 months ago (2012-08-23 01:38:29 UTC) #29
Alexei Svitkine (slow)
http://codereview.chromium.org/10830318/diff/4096/chrome/common/metrics/entropy_provider_unittest.cc File chrome/common/metrics/entropy_provider_unittest.cc (right): http://codereview.chromium.org/10830318/diff/4096/chrome/common/metrics/entropy_provider_unittest.cc#newcode48 chrome/common/metrics/entropy_provider_unittest.cc:48: }; On 2012/08/23 01:38:30, jar wrote: > I checked ...
8 years, 4 months ago (2012-08-23 15:10:42 UTC) #30
Alexei Svitkine (slow)
Brett: Ping for OWNERS approval for chrome/ and content/ directories. Thanks!
8 years, 4 months ago (2012-08-23 19:28:14 UTC) #31
brettw
owners lgtm
8 years, 3 months ago (2012-08-24 17:40:28 UTC) #32
Daniel Berlin
lgtm
8 years, 3 months ago (2012-08-24 20:10:47 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asvitkine@chromium.org/10830318/18027
8 years, 3 months ago (2012-08-24 20:12:27 UTC) #34
commit-bot: I haz the power
8 years, 3 months ago (2012-08-24 22:33:04 UTC) #35
Change committed as 153322

Powered by Google App Engine
This is Rietveld 408576698