Unreviewed, add JSBench to the skipped list for now since it doesn't
[WebKit-https.git] / PerformanceTests / ChangeLog
1 2016-05-25  Keith Miller  <keith_miller@apple.com>
2
3         Unreviewed, add JSBench to the skipped list for now since it doesn't
4         work currently.
5
6         * Skipped:
7
8 2016-05-17  Keith Miller  <keith_miller@apple.com>
9         We should have JSBench in PerformanceTests
10         https://bugs.webkit.org/show_bug.cgi?id=157952
11
12         Rubber-stamped by Saam Barati.
13
14         There are some slight changes to the layout of the test directory
15         to make it work nicely with run-jsc-benchmarks. Before JSBench
16         had each of the browser specific sub-tests in a sub-directory.
17         These have been flattened e.g. amazon/safari/ has become
18         amazon-safari/.
19
20         * JSBench/amazon-chrome-win/urem.html: Added.
21         * JSBench/amazon-chrome-win/urem.js: Added.
22         * JSBench/amazon-chrome/urem.html: Added.
23         * JSBench/amazon-chrome/urem.js: Added.
24         * JSBench/amazon-firefox-win/urm.html: Added.
25         * JSBench/amazon-firefox-win/urm.js: Added.
26         * JSBench/amazon-firefox/urm.html: Added.
27         * JSBench/amazon-firefox/urm.js: Added.
28         * JSBench/amazon-safari/urem.html: Added.
29         * JSBench/amazon-safari/urem.js: Added.
30         * JSBench/browsercheck.js: Added.
31         * JSBench/facebook-chrome-win/urem.html: Added.
32         * JSBench/facebook-chrome-win/urem.js: Added.
33         * JSBench/facebook-chrome/urem.html: Added.
34         * JSBench/facebook-chrome/urem.js: Added.
35         * JSBench/facebook-firefox-win/urem.html: Added.
36         * JSBench/facebook-firefox-win/urem.js: Added.
37         * JSBench/facebook-firefox/urem.html: Added.
38         * JSBench/facebook-firefox/urem.js: Added.
39         * JSBench/facebook-safari/urem.html: Added.
40         * JSBench/facebook-safari/urem.js: Added.
41         * JSBench/google-chrome-win/urem.html: Added.
42         * JSBench/google-chrome-win/urem.js: Added.
43         * JSBench/google-chrome/urem.html: Added.
44         * JSBench/google-chrome/urem.js: Added.
45         * JSBench/google-firefox-win/urem.html: Added.
46         * JSBench/google-firefox-win/urem.js: Added.
47         * JSBench/google-firefox/uem.html: Added.
48         * JSBench/google-firefox/uem.js: Added.
49         * JSBench/google-safari/urem.html: Added.
50         * JSBench/google-safari/urem.js: Added.
51         * JSBench/harness.html: Added.
52         * JSBench/harness.js: Added.
53         * JSBench/harness.py: Added.
54         * JSBench/index.html: Added.
55         * JSBench/reload.html: Added.
56         * JSBench/twitter-chrome-win/rem.html: Added.
57         * JSBench/twitter-chrome-win/rem.js: Added.
58         * JSBench/twitter-chrome/urem.html: Added.
59         * JSBench/twitter-chrome/urem.js: Added.
60         * JSBench/twitter-firefox-win/urem.html: Added.
61         * JSBench/twitter-firefox-win/urem.js: Added.
62         * JSBench/twitter-firefox/urem.html: Added.
63         * JSBench/twitter-firefox/urem.js: Added.
64         * JSBench/twitter-safari/urem.html: Added.
65         * JSBench/twitter-safari/urem.js: Added.
66         * JSBench/yahoo-chrome-win/urem.html: Added.
67         * JSBench/yahoo-chrome-win/urem.js: Added.
68         * JSBench/yahoo-chrome/urem.html: Added.
69         * JSBench/yahoo-chrome/urem.js: Added.
70         * JSBench/yahoo-firefox-win/urem.html: Added.
71         * JSBench/yahoo-firefox-win/urem.js: Added.
72         * JSBench/yahoo-firefox/urem.html: Added.
73         * JSBench/yahoo-firefox/urem.js: Added.
74         * JSBench/yahoo-safari/urem.html: Added.
75         * JSBench/yahoo-safari/urem.js: Added.
76
77 2016-05-20  Ryosuke Niwa  <rniwa@webkit.org>
78
79         run-benchmark's results should contain Animometer's debug output
80         https://bugs.webkit.org/show_bug.cgi?id=157941
81
82         Reviewed by Stephanie Lewis.
83
84         Made developer.html support the JSON generated by run-benchmark which stores everything under debugOutput.
85
86         * Animometer/resources/debug-runner/animometer.js:
87         (Utilities.initialize): Unwrap debugOutput in the case run-benchmark's result JSON is used.
88
89 2016-05-18  Timothy Hatcher  <timothy@apple.com>
90
91         Make Animometer work in all browsers
92         https://bugs.webkit.org/show_bug.cgi?id=157855
93         rdar://problem/26338521
94
95         Reviewed by Jon Lee.
96
97         * Animometer/resources/runner/logo.svg: Use a symbol instead
98         of putting the id on the root svg. This works in all browsers.
99
100 2016-05-07  Timothy Hatcher  <timothy@apple.com>
101
102         Update Animometer design
103         https://bugs.webkit.org/show_bug.cgi?id=157449
104
105         Reviewed by Darin Adler.
106
107         * Animometer/developer.html: Stop including runner/animometer.css.
108         * Animometer/index.html: Udpated elements to fit new styles.
109
110         * Animometer/resources/debug-runner/animometer.css:
111         Copy the old runner/animometer.css to here so the debug runner is unaffected.
112
113         * Animometer/resources/runner/animometer.css:
114         New styles for the design. Drop flex box for broad browser support.
115
116         * Animometer/resources/runner/animometer.js:
117         (ResultsTable.clear): Use textContent.
118         (window.sectionsManager.showSection): Add class to the body.
119         (window.sectionsManager.setSectionScore): Use textContent, not innerHTML.
120
121         * Animometer/resources/runner/crystal.svg: Added.
122         * Animometer/resources/runner/lines.svg: Added.
123         * Animometer/resources/runner/logo.svg: Added.
124
125         * Animometer/resources/runner/tests.js: Shorten test name and title case them.
126
127 2016-05-06  Manuel Rego Casasnovas  <rego@igalia.com>
128
129         [css-grid] Unprefix CSS Grid Layout properties
130         https://bugs.webkit.org/show_bug.cgi?id=157137
131
132         Reviewed by Simon Fraser.
133
134         Remove "-webkit" prefix from all the grid layout properties,
135         including the display value.
136         Update the source code to remove the prefix where it was used too.
137
138         * Layout/auto-grid-lots-of-data.html:
139         * Layout/fixed-grid-lots-of-data.html:
140         * Layout/fixed-grid-lots-of-stretched-data.html:
141
142 2016-04-25  Geoffrey Garen  <ggaren@apple.com>
143
144         bmalloc: Misc improvements to MallocBench
145         https://bugs.webkit.org/show_bug.cgi?id=157004
146
147         Reviewed by Darin Adler.
148
149         * MallocBench/run-malloc-benchmarks: Added --memory and --memory_warning
150         modes for focused memory testing.
151
152         * MallocBench/MallocBench/Benchmark.cpp:
153         (Benchmark::printReport): Clarified output.
154
155         (Benchmark::currentMemoryBytes): Added compressed memory because top
156         does the same. (It always happens to zero in the benchmarks we run. But
157         this is good for sanity.)
158
159         * MallocBench/MallocBench/CommandLine.cpp: Moved up to 8 runs to reduce
160         variance.
161
162         * MallocBench/MallocBench/alloc_free.cpp:
163         (benchmark_alloc_free): Cycle a single allocation in order to stress
164         the effect of merging on calls to madvise.
165
166         * MallocBench/MallocBench/big.cpp:
167         (benchmark_big): Graduated to 8kB-128kB because medium tests up to 8 and
168         our large allocator doesn't kick in until 64kB.
169
170         * MallocBench/MallocBench/medium.cpp:
171         (benchmark_medium): Test all the way down to 1kB because our large
172         allocator used to service 1kB allocations and 1kB is an interesting
173         middle size where memory is unusually large but allocation throughput
174         still matters.
175
176         * MallocBench/MallocBench/stress.cpp:
177         (benchmark_stress): Reduced the churn count to match stress_aligned
178         because this test was taking too long to complete.
179
180         * MallocBench/MallocBench/stress_aligned.cpp:
181         (benchmark_stress_aligned): Our new large allocator can handle even
182         more absurdly large values.
183
184 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
185
186         Add a content animation test that uses SVG animation.
187         https://bugs.webkit.org/show_bug.cgi?id=156827
188
189         * Animation/svg-animation.html: Added.
190         * Skipped:
191
192 2016-04-22  Simon Fraser  <simon.fraser@apple.com>
193
194         Skip two content animation tests which are only meant for iOS testing.
195
196         * Animation/css-animation.html: Added.
197         * Animation/raf-animation.html: Added.
198
199         * Skipped:
200
201 2016-04-20  Simon Fraser  <simon.fraser@apple.com>
202
203         Add content animation tests to benchmark_runner, and allow the runner to collect device data as part of the results
204         https://bugs.webkit.org/show_bug.cgi?id=156827
205
206         Add two files missing from the previous commit.
207
208         * Animation/css-animation.html: Added.
209         * Animation/raf-animation.html: Added.
210
211 2016-04-20  Simon Fraser  <simon.fraser@apple.com>
212
213         Add content animation tests to benchmark_runner, and allow the runner to collect device data as part of the results
214         https://bugs.webkit.org/show_bug.cgi?id=156827
215
216         Reviewed by Stephanie Lewis.
217
218         Two new files for the content-animation suite.
219
220         After patching for use in the benchmark, these tests are a little different to other benchmarks.
221         The test content itself does not collect performance data; the tests spit out a boilerplate JSON
222         result with a placeholder for framerate, which is collected in native code.
223
224         When run as a benchmark, test completion involves a couple of bounces between the test and MobileSafari.
225         Test completion is initiated by a setTimeout() in the test, at which point location.hash is set to "#done".
226         MobileSafari detects that, and asynchronously dumps performance data. Once this is complete, MobileSafari
227         changes the URL has to "#submit", which triggers the XHR to the test relay that indicates the test is
228         complete.
229
230         * Animation/css-animation.html: Added.
231         * Animation/raf-animation.html: Added.
232
233 2016-04-15  Jon Lee  <jonlee@apple.com>
234
235         Animometer test could report a NaN
236         https://bugs.webkit.org/show_bug.cgi?id=156646
237
238         Reviewed by Darin Adler.
239         Provisionally reviewed by Said Abou-Hallawa.
240
241         * Animometer/tests/resources/main.js:
242         (didFinishInterval): The ramp controller has a first phase where it ramps up the complexity and
243         reacts based on how well the system handles the load. The assumption was that it would handle at least
244         1 particle easily. That is not always the case. As a result, an interpolation calculation could
245         end up setting an upper bound of NaN.
246
247         This occurs because we never get out of the first tier, so this._lastTierComplexity is undefined.
248         Now that we guarantee a minimum complexity of 1, modify the conditional to check for this._lastTierComplexity
249         before interpolating the upper bound of the first ramp. In the case where the system struggles with
250         1 particle, set it to currentComplexity.
251
252 2016-04-09  Jon Lee  <jonlee@apple.com>
253
254         Update Animometer to accommodate different screens
255         https://bugs.webkit.org/show_bug.cgi?id=156449
256
257         Reviewed by Darin Adler.
258         Provisionally reviewed by Said Abou-Hallawa.
259
260         * Animometer/index.html: Wrap button in a container to add padding at the bottom.
261         * Animometer/resources/debug-runner/animometer.css:
262         (@media screen and (min-device-width: 1800px)): Deleted.
263         (@media screen and (min-width: 1800px)): Cannot use min-device-width since it may match incorrectly.
264         (screen and (max-device-height: 414px) and (orientation: landscape)): Some devices swap device width
265         and height with orientation change.
266         * Animometer/resources/runner/animometer.css: Similar.
267         (screen and (min-device-width: 1024px) and (orientation: landscape)):
268         (screen and (max-device-height: 414px) and (orientation: landscape)):
269         (.frame-container): On smaller iPhones, adding 1px prevents the navigation bars from appearing.
270         (@media screen and (min-device-width: 768px) and (max-device-width: 1024px)): Deleted.
271         (@media (min-device-height: 768px) and (max-device-height: 1024px)): Target iPad Airs and similar.
272         (@media screen and (min-device-width: 1024px) and (max-device-width: 1366px)): Deleted.
273         (@media screen and (max-device-width: 1024px) and (min-device-height: 1366px)): Target iPad Pro.
274         (#results footer): Add padding below the button for testing again.
275         * Animometer/tests/master/multiply.html: Remove the center text.
276         * Animometer/tests/master/resources/text.js: Update the test so that in every frame the text moves.
277         * Animometer/tests/master/text.html: Update the text sizing depending on the size of the device.
278
279 2016-04-08  Jon Lee  <jonlee@apple.com>
280
281         Have Animometer benchmark always start with complexity of 1
282         https://bugs.webkit.org/show_bug.cgi?id=156432
283
284         Reviewed by Ryosuke Niwa.
285
286         * Animometer/tests/resources/main.js: Update the default Controller and RampController to
287         set its minimum complexities to 1 instead of 0.
288
289 2016-04-08  Jon Lee  <jonlee@apple.com>
290
291         Fix SVG benchmark test
292         https://bugs.webkit.org/show_bug.cgi?id=156410
293
294         Reviewed by Dean Jackson.
295
296         * Animometer/resources/extensions.js: Update Point.zero to be a static Point.
297         * Animometer/tests/simple/resources/tiled-canvas-image.js:
298         (Stage.call._setupTiles): Refactor.
299         * Animometer/tests/master/resources/particles.js:
300         (Particle.prototype.reset): Use Point.center.
301         (complexity): We are not using a gradient background anymore, so remove the +1.
302         * Animometer/tests/master/resources/svg-particles.js: Update to use SVG transform
303         instead of CSS transform.
304
305 2016-04-06  Jon Lee  <jonlee@apple.com>
306
307         Update master benchmark with SVG test
308         https://bugs.webkit.org/show_bug.cgi?id=156273
309
310         Reviewed by Dean Jackson.
311         Provisionally reviewed by Said Abou-Hallawa.
312
313         Switch masks tests for SVG path test.
314
315         * Animometer/resources/debug-runner/tests.js: Move mask test here.
316         * Animometer/resources/runner/tests.js: Add SVG test here.
317         * Animometer/tests/dom/particles.html: Renamed from PerformanceTests/Animometer/tests/master/particles.html.
318         * Animometer/tests/dom/resources/dom-particles.js: Renamed from PerformanceTests/Animometer/tests/master/resources/dom-particles.js.
319
320         * Animometer/tests/master/resources/particles.js: Add minPosition for bounds checking. Prevents particle from being
321         partially obscured.
322         * Animometer/tests/master/resources/svg-particles.js: Added.
323         (Particle): The particle is either a path object or a rect using a path as a clip. The
324         same path is used either way. For each particle create a linear gradient with a random
325         rotation.
326         (SVGParticlesStage): Look in #shapes to see how many different kinds of paths are available.
327         This makes the test more generic in case other shapes need to be tested.
328         * Animometer/tests/master/svg-particles.html: Added. Have two defs, one that houses each
329         particle's gradient, and one that holds the shape templates.
330
331 2016-03-27  Hunseop Jeong  <hs85.jeong@samsung.com>
332
333         [EFL] REGRESSION(r188793): It made 200 layout tests and Bindings/event-target-wrapper.html performance test fail
334         https://bugs.webkit.org/show_bug.cgi?id=148470 
335
336         Reviewed by Darin Adler.
337
338         * Skipped: Unskip the Bindings/event-target-wrapper test.
339
340 2016-03-23  Jon Lee  <jonlee@apple.com>
341
342         Update focus and leaves tests
343         https://bugs.webkit.org/show_bug.cgi?id=155825
344
345         Reviewed by Simon Fraser.
346
347         Particles would improperly disappear, before they were fully off stage. Update the calculation.
348         * Animometer/tests/dom/resources/leaves.js:
349         * Animometer/tests/master/resources/leaves.js:
350
351         * Animometer/tests/master/focus.html: Update the center element styling.
352         * Animometer/tests/master/resources/focus.js:
353         (FocusElement.Utilities.createClass): Give enough space in the container for each particle for the blur
354         to spread. It should be about 3x more space than the blur radius on each side.
355         (Stage.call.initialize): Ditto for the center element.
356
357 2016-03-23  Jon Lee  <jonlee@apple.com>
358
359         Update support for other platforms
360         https://bugs.webkit.org/show_bug.cgi?id=155824
361
362         Reviewed by Simon Fraser.
363
364         * Animometer/resources/debug-runner/animometer.css: Remove extraneous media query. All of it should
365         be handled in the release stylesheet.
366         * Animometer/resources/debug-runner/animometer.js: Add support for browsers that return an HTMLCollection
367         when retrieving radio elements with a name, instead of the selected value.
368         * Animometer/resources/runner/animometer.css: Adjust the queries for devices of varying widths.
369         (.frame-container): Move overflow:hidden to #stage.
370         * Animometer/tests/master/resources/stage.css: Consolidate into tests/resources/stage.css.
371         * Animometer/tests/resources/stage.css:
372         (body): Remove overflow:hidden.
373         (#stage): Set overflow:hidden here.
374         (#center-text): Moved from master/resources/stage.css.
375
376         Update stylesheet hrefs.
377         * Animometer/tests/master/canvas-stage.html:
378         * Animometer/tests/master/focus.html:
379         * Animometer/tests/master/leaves.html:
380         * Animometer/tests/master/multiply.html:
381         * Animometer/tests/master/particles.html:
382         * Animometer/tests/master/text.html: Adjust text size to fit in the device screen.
383
384 2016-03-23  Jon Lee  <jonlee@apple.com>
385
386         Make the benchmark require device to be in landscape orientation
387         https://bugs.webkit.org/show_bug.cgi?id=155822
388         rdar://problem/25258650
389
390         Reviewed by Ryosuke Niwa.
391
392         Check that the device is in landscape orientation. If not, disable the button to start it,
393         and show a warning message.
394
395         * Animometer/developer.html: Add a message about how the browser should be set up. Include a
396         warning message that appears if the orientation is incorrect on mobile devices.
397         * Animometer/index.html: Ditto.
398
399         * Animometer/resources/debug-runner/animometer.css: Migrate the .hidden rule into the release
400         stylesheet. Update the style to accommodate the new UI.
401         * Animometer/resources/runner/animometer.css:
402
403         * Animometer/resources/runner/animometer.js:
404         (window.benchmarkController.initialize): Add the orientation listener is needed.
405         (window.benchmarkController.addOrientationListenerIfNecessary): Only mobile devices need this. Check
406         to see for support of window.orientation.
407         (window.benchmarkController._orientationChanged): Toggle the warning based on whether we match the
408         landscape query. Set a state variable, which is needed for the debug harness. Call updateStartButtonState.
409         (window.benchmarkController.updateStartButtonState):
410         * Animometer/resources/debug-runner/animometer.js: Change _updateStartButtonState to return
411         a boolean about whether at least one test is selected. That will be used in
412         benchmarkController.updateStartButtonState(). Move the load event listener to the release version.
413         (window.benchmarkController.updateStartButtonState): Override the release version, and also check
414         that at least one test is selected.
415
416 2016-03-22  Geoffrey Garen  <ggaren@apple.com>
417
418         MallocBench: consolidate regression testing for aligned allocation
419         https://bugs.webkit.org/show_bug.cgi?id=155762
420
421         Reviewed by Michael Saboff.
422
423         * MallocBench/MallocBench.xcodeproj/project.pbxproj:
424         * MallocBench/MallocBench/Benchmark.cpp:
425         * MallocBench/MallocBench/memalign.cpp: Removed.
426         * MallocBench/MallocBench/memalign.h: Removed. The stress_aligned test
427         covers this and much more.
428
429         * MallocBench/MallocBench/stress_aligned.cpp:
430         (benchmark_stress_aligned): Include specific tests for extreme sizes
431         and alignments.
432
433 2016-03-21  Jon Lee  <jonlee@apple.com>
434
435         Update benchmark tests
436         https://bugs.webkit.org/show_bug.cgi?id=155723
437
438         Reviewed by Darin Adler.
439         Provisionally reviewed by Said Abou-Hallawa.
440
441         Add quadratic and bezier segments to the canvas path test.
442
443         * Animometer/resources/runner/tests.js: Some of the query strings are unnecessary.
444         Rename the test.
445         * Animometer/tests/master/resources/canvas-stage.js:
446         (tune): Update to be able to take an array of possible constructors. Choose one randomly.
447         * Animometer/tests/master/resources/canvas-tests.js:
448         (CanvasLinePoint.Utilities.createClass): Move the point selection out to a separate
449         function called randomPoint() for reuse. Move X_LOOPS, Y_LOOPS, and offsets into the
450         class definition.
451         (randomPoint): Scale the grid down a little bit so that the lines along the edge of the
452         canvas are not cut off when the stroke size is thick.
453         (CanvasQuadraticSegment): Added.
454         (CanvasBezierSegment): Added.
455         (SimpleCanvasStage): Pass in an array of the different segment types. Since line segments
456         are short compared to the curved ones, make it twice as likely to render a line segment.
457         (SimpleCanvasStage.animate): Update the drawing code so that we render all line segments.
458
459         Add a helper method that selects a random element from an array.
460
461         * Animometer/tests/resources/main.js:
462         (Stage.randomElementInArray): Select a random element from the provided array.
463
464         * Animometer/tests/bouncing-particles/resources/bouncing-tagged-images.js: Refactor.
465         * Animometer/tests/dom/resources/leaves.js: Ditto.
466         * Animometer/tests/master/resources/dom-particles.js: Ditto.
467         * Animometer/tests/master/resources/image-data.js: Ditto.
468         * Animometer/tests/master/resources/leaves.js: Ditto.
469         * Animometer/tests/simple/resources/simple-canvas-paths.js: Ditto.
470
471         Add canvas tests that includes all stroke and fill paths. This makes it possible to avoid having to
472         include the full simple canvas suite for perf testing.
473
474         * Animometer/resources/debug-runner/tests.js: Add new tests. Move the canvas test into the Canvas
475         suite.
476         * Animometer/tests/simple/resources/simple-canvas-paths.js: Add a CanvasStroke and CanvasFill particle
477         that random selects an object to render.
478
479         * Animometer/resources/debug-runner/tests.js: Move 3D suite before basic canvas suite.
480         When updating the perf bot script, we will include the suites up to this one, but exclude
481         the basic canvas suite.
482
483         Move compositing transforms test to HTML suite and remove the empty Miscellaneous suite.
484
485         * Animometer/resources/debug-runner/tests.js:
486         * Animometer/tests/dom/compositing-transforms.html: Renamed from PerformanceTests/Animometer/tests/misc/compositing-transforms.html.
487         * Animometer/tests/dom/resources/compositing-transforms.js: Renamed from PerformanceTests/Animometer/tests/misc/resources/compositing-transforms.js.
488
489         Clean up miscellaneous test suite. Add a canvas ellipse test, and remove the other
490         canvas tests.
491
492         * Animometer/resources/debug-runner/tests.js: Add ellipse tests to the simple suite.
493         * Animometer/tests/misc/canvas-electrons.html: Removed.
494         * Animometer/tests/misc/canvas-stars.html: Removed.
495         * Animometer/tests/misc/resources/canvas-electrons.js: Removed.
496         * Animometer/tests/misc/resources/canvas-stars.js: Removed.
497         * Animometer/tests/simple/resources/simple-canvas-paths.js: Add ellipse primitives.
498
499         Merge text tests together into one.
500
501         * Animometer/resources/runner/tests.js: Remove international.html.
502         * Animometer/tests/master/international.html: Removed.
503         * Animometer/tests/master/resources/text.js:
504         (animate): Update styling. Manually calculate gradients for the shadow particles.
505         Reduce the step size for y direction to avoid cutting text off at the margins. Increase
506         step for x since there will be a little more room.
507         * Animometer/tests/master/text.html: Add more translations and lay it out in a table.
508
509 2016-03-20  Jon Lee  <jonlee@apple.com>
510
511         Add a link to show debug data
512         https://bugs.webkit.org/show_bug.cgi?id=155724
513
514         Reviewed by Simon Fraser.
515
516         * Animometer/developer.html: Attach the onclick handler to the score.
517         * Animometer/index.html: Ditto.
518
519 2016-03-18  Dean Jackson  <dino@apple.com>
520
521         Add a basic WebGL test to Animometer
522         https://bugs.webkit.org/show_bug.cgi?id=155475
523         <rdar://problem/25156860>
524
525         Reviewed by Simon Fraser and Jon Lee.
526
527         Add a pretty simple WebGL test to Animometer
528         which tries to draw a number of animated triangles.
529         The result still needs a bit of tuning.
530
531         * Animometer/resources/debug-runner/tests.js: Add a new
532         Suite for "3D" tests.
533         * Animometer/tests/3d/resources/webgl.js: Added.
534         * Animometer/tests/3d/webgl.html: Added.
535
536 2016-03-18  Jon Lee  <jonlee@apple.com>
537
538         Add support for statically linking to a specific test
539         https://bugs.webkit.org/show_bug.cgi?id=155631
540
541         Rubber-stamped by Darin Adler.
542
543         * Animometer/developer.html: Update to call restartBenchmark instead so that it works for
544         both the preset and the manually set test sessions.
545         * Animometer/resources/debug-runner/animometer.css:
546         (.tree .link): Style the "link" UI.
547         * Animometer/resources/debug-runner/animometer.js: Move updateDisplay from suitesManager
548         to optionsManager since this is a visual option and has nothing to do with the suites
549         settings. Update the construction of the test UI by including a "link" after each test.
550         Clicking on that link brings up a JS prompt with a URL and a query string with the current
551         parameters of the controller, and selected test. Pasting this URL into the location bar will
552         automatically start running the selected test.
553         (suitesManager.suitesFromQueryString): Iterate through the Suites and tests and find the one
554         that matches the provided parameters. Returns an object similar to the form in
555         suitesManager.updateLocalStorageFromUI.
556         (benchmarkController.initialize): After settings up the events and options, try parsing the
557         query string and running the benchmark immediately. Otherwise, fall back to the form.
558         (benchmarkController.startBenchmark): Store the options and suites into member variables for
559         reuse in restartBenchmark.
560         (benchmarkController.startBenchmarkImmediatelyIfEncoded): Convert the query string to an object.
561         If that's successful, find the suite and test referenced in the query string. Start the benchmark if
562         the search for the test succeeded.
563         * Animometer/resources/extensions.js:
564         (Utilities.stripNonASCIICharacters): Helper method to convert the name of the suite and test
565         into a query-string-friendly version.
566         (Utilities.convertObjectToQueryString): Helper method to convert an object to query string
567         format.
568         (Utilities.convertQueryStringToObject): Helper method to convert query string into an object
569         with properties and values.
570
571 2016-03-16  Jon Lee  <jonlee@apple.com>
572
573         Add a new benchmark test
574         https://bugs.webkit.org/show_bug.cgi?id=155570
575
576         Reviewed by Simon Fraser.
577
578         New Leaves test includes various image sizes and opacity.
579
580         * Animometer/resources/debug-runner/tests.js: Add it to the HTML test suite.
581         * Animometer/tests/dom/leaves.html: Added.
582         * Animometer/tests/dom/resources/leaves.js: Added. Override the
583         (Particle.call.reset): Uses a range of sizes, and opacity.
584         (Particle.call.animate): Opacity goes up then down. When it hits 0, reset the particle.
585         (Particle.call.move): Set transform and opacity.
586         * Animometer/tests/master/resources/leaves.js: Get rid of the closure so that it
587         can be used in this test. Update the relative path so that it works in both the master
588         and dom test suite.
589
590 2016-03-15  Simon Fraser  <simon.fraser@apple.com>
591
592         Add developer Animometer test that bounces P3-tagged images
593         https://bugs.webkit.org/show_bug.cgi?id=155511
594
595         Reviewed by Tim Horton.
596         
597         Add a test for rendering performance of tagged images. The 5 images are tagged
598         with the Display P3 colorspace.
599
600         * Animometer/resources/debug-runner/tests.js:
601         * Animometer/tests/bouncing-particles/bouncing-tagged-images.html: Added.
602         * Animometer/tests/bouncing-particles/resources/bouncing-tagged-images.js: Added.
603         * Animometer/tests/bouncing-particles/resources/image1.jpg: Added.
604         * Animometer/tests/bouncing-particles/resources/image2.jpg: Added.
605         * Animometer/tests/bouncing-particles/resources/image3.jpg: Added.
606         * Animometer/tests/bouncing-particles/resources/image4.jpg: Added.
607         * Animometer/tests/bouncing-particles/resources/image5.jpg: Added.
608
609 2016-03-09  Jon Lee  <jonlee@apple.com>
610
611         Enhance existing Animometer tests
612         https://bugs.webkit.org/show_bug.cgi?id=155261
613
614         Reviewed by Simon Fraser.
615
616         * Animometer/tests/master/resources/canvas-tests.js: Add a gradient to
617         the filled circles. To expose more of the gradient, add another circle.
618         (SimpleCanvasStage.call.animate): For each frame, create a gradient with
619         undulating stop points and colors. Fill the circles twice; once with
620         the solid color, and once with the gradient.
621
622         * Animometer/tests/master/resources/dom-particles.js: Refactor the
623         emission variables into a separate stage for this test. Add a colorOffset
624         variable to make the colors of each particle slightly different, since
625         the ramp controller can add large numbers of particles all at once, which
626         would otherwise get all the same color.
627         * Animometer/tests/master/resources/particles.js:
628         (initialize): Remove the code specific to the SVG mask test.
629
630         * Animometer/tests/master/resources/image-data.js:
631         (initialize): Remove unused local variable.
632         * Animometer/tests/master/resources/multiply.js:
633         (initialize): Make the test harder by adding more total particles.
634
635 2016-03-09  Jon Lee  <jonlee@apple.com>
636
637         Add text tests
638         https://bugs.webkit.org/show_bug.cgi?id=155257
639
640         Reviewed by Simon Fraser.
641
642         * Animometer/resources/extensions.js:
643         (UnitBezier.Utilities.createClass): Add a class that computes Bezier points
644         assuming that two of the control points are at (0,0) and (1,1). Taken from
645         WebCore/platform/graphics/UnitBezier.h
646         * Animometer/resources/runner/tests.js: Add a test for English text and one
647         for international text.
648         * Animometer/tests/master/international.html: Added.
649         * Animometer/tests/master/resources/text.js: Added. The test assumes there is
650         #template div which it will copy. The copies are placed behind the template, and
651         are set with different colors each frame. They are moved around with CSS transform.
652         * Animometer/tests/master/text.html: Added.
653
654         Remove the other text tests, since these ones cover the same techniques.
655         * Animometer/tests/text/layering-text.html: Removed.
656         * Animometer/tests/text/resources/layering-text.js: Removed.
657         * Animometer/tests/text/resources/text-boxes.js: Removed.
658         * Animometer/tests/text/text-boxes.html: Removed.
659         * Animometer/resources/debug-runner/tests.js:
660
661 2016-03-09  Jon Lee  <jonlee@apple.com>
662
663         Add a new image test
664         https://bugs.webkit.org/show_bug.cgi?id=155232
665
666         Reviewed by Dean Jackson.
667         Provisionally reviewed by Said Abou-Hallawa.
668
669         The image test renders PNGs and moves them with translate and rotate
670         transforms. Each particle has a lifetime, and when the lifetime ends or
671         the particle goes offscreen, it resets itself somewhere on the stage.
672
673         * Animometer/resources/debug-runner/tests.js: Remove the CSS bouncing PNG
674         images test, because this one tests the same technique.
675         * Animometer/resources/runner/tests.js: Added here as "Leaves".
676         * Animometer/tests/master/leaves.html: Added.
677         * Animometer/tests/master/resources/particles.js: Refactor out the parts
678         specific to the DOM particles test. Consequently make velocity a public
679         member.
680         (initialize): The options parameter is never used, so remove it.
681         (animate): Remove unused local variable.
682         * Animometer/tests/master/resources/leaves.js: Maintains a focal point that
683         moves back and forth across the canvas. That point affects the velocity
684         of the particles. When the focal point is on the leftmost side, it is
685         between [-6, -2], and set in reset(). When the focal point is on the rightmost
686         side, it will be from [2, 6].
687         * Animometer/tests/master/resources/dom-particles.js: Move JS specific to
688         this test here from particles.js.
689
690         New images.
691         * Animometer/tests/master/resources/compass100.png: Added.
692         * Animometer/tests/master/resources/console100.png: Added.
693         * Animometer/tests/master/resources/contribute100.png: Added.
694         * Animometer/tests/master/resources/debugger100.png: Added.
695         * Animometer/tests/master/resources/inspector100.png: Added.
696         * Animometer/tests/master/resources/layout100.png: Added.
697         * Animometer/tests/master/resources/performance100.png: Added.
698         * Animometer/tests/master/resources/script100.png: Added.
699         * Animometer/tests/master/resources/shortcuts100.png: Added.
700         * Animometer/tests/master/resources/standards100.png: Added.
701         * Animometer/tests/master/resources/storage100.png: Added.
702         * Animometer/tests/master/resources/styles100.png: Added.
703         * Animometer/tests/master/resources/timeline100.png: Added.
704
705 2016-03-03  Jon Lee  <jonlee@apple.com>
706
707         Add ability to retrieve raw data from release harness
708         https://bugs.webkit.org/show_bug.cgi?id=155026
709
710         Reviewed by Simon Fraser.
711
712         * Animometer/developer.html: Remove the special UI in the debug
713         harness.
714         * Animometer/resources/runner/animometer.css: Add styles for the
715         overlay.
716         * Animometer/resources/runner/animometer.js: Let 'j' show the JSON
717         results, but only if the overlay doesn't exist. Add 'esc' key to dismiss
718         the overlay.
719         (window.benchmarkController.selectResults): Cycle the cases around
720         so that the first 's' press selects both the benchmark score and
721         the individual test scores.
722         * Animometer/resources/debug-runner/animometer.css: Remove
723         unneeded rules.
724         * Animometer/resources/debug-runner/animometer.js: Make the same
725         call to handleKeyPress.
726
727 2016-03-03  Jon Lee  <jonlee@apple.com>
728
729         Make sure multiply test particles have at least some opacity
730         https://bugs.webkit.org/show_bug.cgi?id=155027
731
732         Reviewed by Simon Fraser.
733
734         * Animometer/tests/master/resources/multiply.js:
735         (initialize): Have the elements spin a little faster to make it
736         more obvious when the system is being stressed.
737         (_addTile):
738         (animate): Make sure each element being animated has at least 1%
739         opacity.
740
741 2016-03-03  Jon Lee  <jonlee@apple.com>
742
743         Update image test
744         https://bugs.webkit.org/show_bug.cgi?id=154962
745
746         Rubber-stamped by Darin Adler.
747
748         * Animometer/tests/master/image-data.html: Make each canvas have a compositing layer.
749         * Animometer/tests/master/resources/image-data.js:
750         (initialize): Update to load multiple images serially.
751         (_loadImage):
752         (tune): Use display instead of visibility. When showing an element anew, move it somewhere else.
753         (_createTestElement): Set up the element, refactor out placement of element to _refreshElement.
754         (_refreshElement): Place element in a tile grid.
755         (animate):
756         (_getRandomNeighboringPixelIndex): Use a more conservative distribution to make the effect last a little longer.
757         * Animometer/tests/master/resources/compass.svg: Added.
758         * Animometer/tests/master/resources/console.svg: Added.
759         * Animometer/tests/master/resources/contribute.svg: Added.
760         * Animometer/tests/master/resources/debugger.svg: Added.
761         * Animometer/tests/master/resources/inspector.svg: Added.
762         * Animometer/tests/master/resources/layout.svg: Added.
763         * Animometer/tests/master/resources/performance.svg: Added.
764         * Animometer/tests/master/resources/script.svg: Added.
765         * Animometer/tests/master/resources/shortcuts.svg: Added.
766         * Animometer/tests/master/resources/standards.svg: Added.
767         * Animometer/tests/master/resources/storage.svg: Added.
768         * Animometer/tests/master/resources/styles.svg: Added.
769         * Animometer/tests/master/resources/timeline.svg: Added.
770
771 2016-03-02  Jon Lee  <jonlee@apple.com>
772
773         Add some new controllers, and refine tests
774         https://bugs.webkit.org/show_bug.cgi?id=154914
775
776         Reviewed by Simon Fraser.
777
778         Improve tests.
779
780         * Animometer/tests/master/focus.html: Move each particle into a layer. Put the particle
781         in a container element. Expand the container element by the max blur radius, and clip
782         overflow. This way, when the blur is applied, it avoids causing layer resizes.
783         * Animometer/tests/master/resources/focus.js:
784         (FocusElement.Utilities.createClass): Create a container element, and put the particle
785         inside.
786         (hide): Set display:none.
787         (show): Set display:block.
788         (animate): Apply filters to the container element.
789         (FocusStage.call.initialize): Instead of inserting and removing elements from the DOM,
790         keep them in the stage, but set the display style instead. Use this._offsetIndex to
791         keep track of which elements are displayed.
792         (FocusStage.call.animate): Move some calculations around to avoid doing unneeded math.
793         (FocusStage.call.getBlurValue): Make sure elements are always blurred.
794         (FocusStage.call.getOpacityValue): Make sure elements have some opacity.
795         * Animometer/tests/master/resources/multiply.js: Have the particles on the edge of the
796         stage appear less black when the complexity gets large enough.
797         (tune): Have this._distanceFactor calculate the factor. Avoid calculating square root each
798         frame.
799
800 2016-03-02  Jon Lee  <jonlee@apple.com>
801
802         Add some new controllers, and refine tests
803         https://bugs.webkit.org/show_bug.cgi?id=154914
804
805         Reviewed by Simon Fraser.
806
807         Add a controller that centers around 30 fps instead of 60 fps.
808
809         * Animometer/developer.html: Add a new option.
810         * Animometer/resources/debug-runner/animometer.js:
811         * Animometer/resources/runner/animometer.js:
812         (this._processData.findRegression): When calculating the complexity-frameLength regression,
813         check the controller, and use a 30 fps baseline if needed.
814         * Animometer/resources/statistics.js:
815         (Regression.Utilities.createClass): Update to allow clients to specify the baseline
816         frame length.
817         * Animometer/tests/resources/main.js:
818         (tune): Override some of the constants in RampController. Move those constants out for
819         easier reading.
820
821         Add a fixed controller, with no step.
822
823         * Animometer/developer.html: Add a controller that takes no step.
824         * Animometer/resources/debug-runner/animometer.js:
825         * Animometer/tests/resources/main.js:
826         (Rotater.Utilities.createClass):
827
828         Switch to ramp controller as default.
829
830         * Animometer/developer.html: Increase the test length to 20 seconds.
831         * Animometer/resources/debug-runner/animometer.js: Rename the "adjustment" field to "controller"
832         since that is a more accurate description.
833         * Animometer/resources/debug-runner/graph.js:
834         * Animometer/resources/runner/animometer.js: Update preferences for release suite.
835
836 2016-02-26  Jon Lee  <jonlee@apple.com>
837
838         Address Dean's comments in 154673.
839
840         * Animometer/developer.html:
841         * Animometer/resources/debug-runner/animometer.js:
842         * Animometer/resources/debug-runner/graph.js:
843
844 2016-02-25  Jon Lee  <jonlee@apple.com>
845
846         Update animation benchmark and tests
847         https://bugs.webkit.org/show_bug.cgi?id=154673
848
849         Reviewed by Dean Jackson.
850
851         Update test visuals.
852
853         * Animometer/tests/master/resources/canvas-tests.js:
854         (CanvasLineSegment.Utilities.createClass): Line segments near the edge of the stage get clipped.
855         Update circle position and radius to minimize impact.
856         * Animometer/tests/master/resources/particles.js: Get rid of rotating gradient background, and
857         have 3 locations for emitting particles.
858         * Animometer/tests/master/resources/multiply.js: Update distance metric so that fringe tiles get
859         more color.
860         (initialize): Fix some of the math for laying out the tiles.
861         (animate): When a tile isn't used, set visibility: hidden.
862
863 2016-02-24  Jon Lee  <jonlee@apple.com>
864
865         Update animation benchmark and tests
866         https://bugs.webkit.org/show_bug.cgi?id=154673
867
868         Reviewed by Dean Jackson.
869
870         Update the ramp controller.
871
872         The controller refines the complexity interval to test across.
873
874         * Animometer/resources/statistics.js: Add functions that estimate cumulative distribution function.
875         (Regression): For the flat regression, force the first segment to be at 60 fps.
876         (valueAt): Add convenience function to return interpolated value based on the regression used.
877         (_calculateRegression): Include the number of points included for both segments, and the piecewise
878         errors.
879         * Animometer/tests/resources/math.js: Make the Kalman estimator subclass Experiment, and allow it
880         to be reset.
881
882         * Animometer/tests/resources/main.js: Initialize the tier such that it starts at 10^0 = 1.
883         Increase the number of ramps. Maintain three FPS thresholds-- the frame rate of interest, a limit
884         on the lowest FPS we care to go for later interpolation, and a minimum FPS threshold we want to
885         aim for each ramp. Also keep three estimators: a running average of the change point, a minimum
886         boundary for each ramp, and an estimator for all the frames within an interval. The first two
887         are used to determine the parameters of the next ramp, and the latter allows us to refine the
888         parameters.
889         (update): During the tier phase, it is possible that the highest complexity possible for a test
890         won't stress the system enough to trigger stopping the tier phase and transitioning to the ramps.
891         If the complexity doesn't change when going to the next tier, we've maxed the test out, and move
892         on. When the tier phase completed, turn off Controller.frameLengthEstimator, which estimates the
893         FPS at each tier.
894         (tune): At each interval, look at the confidence distribution of being on the 60 FPS side or the
895         slow side. If the slowest FPS we achieve at the ramp's maximum complexity is not at least
896         _fpsRampSlowThreshold, then increase the maximum complexity. If we ever achieve 60 FPS, increase
897         the ramp's minimum complexity to that level. If, at an even lower complexity, a glitch causes the
898         FPS to drop, we reset the minimum complexity.
899
900         Have the bootstrap calculation occur between tests. Clean up harness.
901
902         * Animometer/resources/debug-runner/animometer.js: Run bootstrap after a test has
903         completed to avoid doing all of it at the end before showing the results. Clean up
904         parameters being passed around.
905         * Animometer/resources/debug-runner/tests.js:
906         (text):
907         * Animometer/resources/runner/animometer.js:
908         (this._processData.calculateScore): Save the results to the same object holding the data.
909         (this._processData._processData): In the case where a file is dragged, calculate the score
910         serially. Grab the results object and move it to the results variable and remove it from
911         the data object. This avoids serializing the results into the JSON.
912         (this._processData.findRegression): Include the samples used for bootstrapping. Reduce the
913         resample size to shorten the wait.
914         * Animometer/resources/runner/benchmark-runner.js:
915         * Animometer/resources/statistics.js:
916         (bootstrap): Update how bootstrapData is sorted. In some regression results the mix of
917         floats and integers causes an alphabetical sort to occur.
918         * Animometer/resources/strings.js:
919
920         Add meta charset so that encodings between harness and test match.
921
922         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
923         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
924         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
925         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
926         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
927         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
928         * Animometer/tests/master/canvas-stage.html:
929         * Animometer/tests/master/focus.html:
930         * Animometer/tests/master/image-data.html:
931         * Animometer/tests/master/multiply.html:
932         * Animometer/tests/master/particles.html:
933         * Animometer/tests/misc/canvas-electrons.html:
934         * Animometer/tests/misc/canvas-stars.html:
935         * Animometer/tests/misc/compositing-transforms.html:
936         * Animometer/tests/simple/simple-canvas-paths.html:
937         * Animometer/tests/simple/tiled-canvas-image.html:
938         * Animometer/tests/template/template-canvas.html:
939         * Animometer/tests/template/template-css.html:
940         * Animometer/tests/template/template-svg.html:
941         * Animometer/tests/text/layering-text.html:
942         * Animometer/tests/text/text-boxes.html:
943
944         Update test harness reporting.
945
946         * Animometer/developer.html: Add missing meta charset.
947         * Animometer/index.html: Remove unnecessary utf-8 declaration.
948         * Animometer/resources/debug-runner/animometer.css: Add convenience classes for
949         formatting the results table.
950         * Animometer/resources/debug-runner/animometer.js: Adjust which stats are shown.
951         * Animometer/resources/debug-runner/tests.js: Display bootstrapping statistics.
952         * Animometer/resources/strings.js: Move strings not used by the release harness.
953
954         Switch to a pseudo-random number generator.
955
956         * Animometer/resources/statistics.js: Add a Pseudo class, with a simple
957         pseudo-random number generator.
958         (_calculateRegression): Reset the generator before running bootstrap.
959         (bootstrap): Deleted.
960
961         Replace Math.random with Pseudo.random.
962         * Animometer/tests/master/resources/canvas-tests.js:
963         * Animometer/tests/master/resources/focus.js:
964         * Animometer/tests/master/resources/particles.js:
965         * Animometer/tests/resources/main.js:
966
967         Use bootstrapping to get confidence interval in the breakpoint.
968
969         For the ramp controller, calculate the piecewise regression, and then use
970         bootstrapping in order to find the 95% confidence interval. Use the raw data.
971
972         * Animometer/developer.html: Default to the complexity graph. Add a legend
973         checkbox to toggle visibility of the bootstrap score and histogram.
974         * Animometer/resources/debug-runner/animometer.css: Make some more space to show
975         the old raw and average scores in the legend. Add new styles for the data.
976         * Animometer/resources/debug-runner/graph.js:
977         (_addRegressionLine): Allow passing an array for the variance bar tied to the
978         regression line. Now |stdev| is |range|.
979         (createComplexityGraph): Add bootstrap median, and overlay a histogram of
980         the bootstrap samples. Switch raw samples from circles to X's.
981         (onComplexityGraphOptionsChanged): Allow toggling of the bootstrap data.
982         (onGraphTypeChanged): Move the regressions for the raw and average samples to the
983         legend. In the subtitle use the bootstrap median, and include the 95% confidence
984         interval.
985         * Animometer/resources/runner/animometer.js:
986         (this._processData.findRegression): Factor out the code that determines which
987         samples to include when calculating the piecewise regression. For series that have
988         many samples, or a wider range of recorded complexities, throw away the 2.5%
989         lowest and highest samples before calculating the regression. Keep all samples
990         if the number of samples to regress is small or the range of complexities is
991         narrow.
992         (this._processData._calculateScore): Factor out regression calculation to
993         findRegression(). Bootstrap the change point of the regression. The score is the
994         median.
995         * Animometer/resources/statistics.js:
996         (_calculateRegression): Correct an issue in the calculation of the regression, where
997         the denominator can be 0.
998         (bootstrap): Template for bootstrapping. Create a bootstrap sample array, Create
999         re-samples by random selection with replacement. Return the 95% confidence samples,
1000         the bootstrap median, mean, and the data itself.
1001         * Animometer/resources/strings.js: Add bootstrap.
1002         * Animometer/tests/resources/main.js:
1003         (processSamples): Don't prematurely cut the sample data.
1004
1005         Fix graph drawing.
1006
1007         * Animometer/resources/debug-runner/animometer.js: Add spacing in the JSON output.
1008         Multiple tests output a lot of JSON and can hang when selecting JSON with no whitespace.
1009         * Animometer/resources/debug-runner/animometer.css:
1010         (#complexity-graph .series.raw circle): Update the color.
1011         * Animometer/resources/debug-runner/graph.js: Use the FPS axis instead of the
1012         complexity axis, which can vary in domain. For determining the complexity domain,
1013         only use samples after samplingTimeOffset.
1014
1015         Allow dropping results JSON.
1016
1017         * Animometer/developer.html: Add a button.
1018         * Animometer/resources/debug-runner/animometer.css:
1019         * Animometer/resources/debug-runner/animometer.js: Read the data and go straight
1020         to the dashboard. With JSON output, write out only the options and the raw data.
1021
1022         Teach the harness to evaluate the samples and determine the test score.
1023
1024         This will allow us to update how the score is calculated separately from the samples recorded.
1025         This also prepares the harness to be able to accept JSON of prior runs.
1026
1027         * Animometer/resources/strings.js: Clean up and remove unneeded strings and reduce some of the
1028         hierarchy.
1029         * Animometer/resources/debug-runner/tests.js: Update to use the new strings.
1030
1031         * Animometer/tests/resources/main.js: Allow all controllers to show a complexity-FPS graph.
1032         (_processComplexitySamples): Factor out some of the sample processing done in the ramp
1033         controller for the benefit of the other controllers. |complexitySamples| contains a list of
1034         samples. Sort the samples by complexity. Optionally remove the top x% of samples.
1035         Group them, and calculate distribution of samples within the same complexity, and add those as
1036         new entries into |complexityAverageSamples|.
1037         (Controller.processSamples): Move the code responsible for determining the complexity and FPS
1038         scores out to ResultsDashboard. The structure of the data returned by the controller is:
1039
1040         {
1041             controller: [time-regression, time-regression, ...], // optional, data specific to controller
1042             marks: [...],
1043             samples: {                    // all of the sample data
1044                 controller: [...],
1045                 complexity: [...],        // processed from controller samples
1046                 complexityAverage: [...], // processed from complexity samples
1047             }
1048         }
1049
1050         (AdaptiveController.processSamples): Adding the target frame length is no longer necessary; we
1051         now pass the test options to the graph.
1052         (Regression): Move to statistics.js.
1053         * Animometer/resources/statistics.js: Move Regression to here. Add a check if the sampling range
1054         only contains one sample, since we cannot calculate a regression from one sample point.
1055
1056         Teach the test harness to evaluate the data.
1057         * Animometer/resources/runner/animometer.js:
1058         (ResultsDashboard): Store the options used to run the test and the computed results/score separately
1059         from the data. The results are stored as:
1060
1061         {
1062             score: /* geomean of iteration score */,
1063             iterationsResults: [
1064                 {
1065                     score: /* geomean of tests */,
1066                     testsResults: {
1067                         suiteName: {
1068                             testName: {
1069                                 controller: {
1070                                     average:
1071                                     concern:
1072                                     stdev:
1073                                     percent:
1074                                 },
1075                                 frameLength: { ... },
1076                                 complexity: {
1077                                     complexity:
1078                                     stdev:
1079                                     segment1:
1080                                     segment2:
1081                                 },
1082                                 complexityAverage: { ... }
1083                             },
1084                             testName: { ... },
1085                         },
1086                         ... next suite ...
1087                     }
1088                 },
1089                 { ...next iteration... }
1090             ]
1091         }
1092
1093         * Animometer/resources/debug-runner/animometer.js: Pass options around instead of relying
1094         on what was selected in the form. This will later allow for dropping previous results, and
1095         using those runs' options when calculating scores.
1096         (ResultsTable._addGraphButton): Simplify button action by using attached test data.
1097         * Animometer/resources/debug-runner/graph.js: Refactor to use the data.
1098
1099         Consolidate JS files, and move statistics out to a separate JS.
1100
1101         Preparation for having the Controller only handle recording and storage of the samples,
1102         and leave the evaluation of the test score out to the harness. Move Experiment to
1103         a new statistics.js, where Regression will also eventually go. Get rid of algorithm.js
1104         and move it to utilities.js since the Heap is used only for Experiments.
1105
1106         * Animometer/tests/resources/algorithm.js: Removed. Heap is in utilities.js.
1107         * Animometer/tests/resources/sampler.js: Removed. Experiment is in statistics.js,
1108         Sampler in main.js.
1109         * Animometer/tests/resources/main.js: Move Sampler here.
1110         * Animometer/resources/statistics.js: Added. Move Statistics and Experiment here.
1111         * Animometer/resources/extensions.js: Move Heap here. Attach static method to create
1112         a max or min heap to Heap, instead of a new Algorithm object.
1113
1114         Update JS files.
1115         * Animometer/developer.html:
1116         * Animometer/index.html:
1117         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
1118         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
1119         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
1120         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
1121         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
1122         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
1123         * Animometer/tests/master/canvas-stage.html:
1124         * Animometer/tests/master/focus.html:
1125         * Animometer/tests/master/image-data.html:
1126         * Animometer/tests/master/multiply.html:
1127         * Animometer/tests/master/particles.html:
1128         * Animometer/tests/misc/canvas-electrons.html:
1129         * Animometer/tests/misc/canvas-stars.html:
1130         * Animometer/tests/misc/compositing-transforms.html:
1131         * Animometer/tests/simple/simple-canvas-paths.html:
1132         * Animometer/tests/simple/tiled-canvas-image.html:
1133         * Animometer/tests/template/template-canvas.html:
1134         * Animometer/tests/template/template-css.html:
1135         * Animometer/tests/template/template-svg.html:
1136         * Animometer/tests/text/layering-text.html:
1137         * Animometer/tests/text/text-boxes.html:
1138
1139         Fix the cursor in the graph analysis when the min
1140         complexity is not 0.
1141
1142         * Animometer/resources/debug-runner/graph.js:
1143         (_addRegression):
1144         (createComplexityGraph):
1145
1146 2016-02-23  Geoffrey Garen  <ggaren@apple.com>
1147
1148         Fix some issues in MallocBench
1149         https://bugs.webkit.org/show_bug.cgi?id=154600
1150
1151         Reviewed by Oliver Hunt.
1152
1153         * MallocBench/MallocBench.xcodeproj/project.pbxproj: Make nimlang.ops
1154         a part of the build so that it copies to the right place for execution.
1155
1156         * MallocBench/MallocBench/Interpreter.cpp:
1157         (Interpreter::Interpreter): Don't try to open .ops files for writing
1158         because we're only going to read and we might need extra permissions to
1159         write.
1160
1161         (Interpreter::~Interpreter): Give more context when opening a file fails
1162         to help with debugging.
1163
1164         * MallocBench/MallocBench/stress.cpp:
1165         (benchmark_stress): Reduce iterations to complete in less than 10 seconds.
1166
1167 2016-02-23  Michael Saboff  <msaboff@apple.com>
1168
1169         Unreviewed change to revert extraneous changes made part of change set 196955.
1170
1171         * MallocBench/MallocBench/Interpreter.cpp:
1172         (Interpreter::doMallocOp):
1173         (Interpreter::Thread::switchTo):
1174         (writeData): Deleted.
1175
1176 2016-02-19  Michael Saboff  <msaboff@apple.com>
1177
1178         MallocBench: Added recording for nimlang website, new recording details and added new options
1179         https://bugs.webkit.org/show_bug.cgi?id=154485
1180
1181         Reviewed by Geoff Garen.
1182
1183         Added new capabilities to MallocBench.  These include:
1184             Added a recording of http://nim-lang.org/docs/lib.html.
1185             Added thread id to the recording and the ability to playback switching threads in MallocBench
1186             Added aligned allocations to recordings and the ability to playback
1187             Added --use-thread-id option to honor recorded thread ids
1188             Added --detailed-report to output remaining allocations by size after playback
1189             Added --no-warmup to not run the warm up iteration
1190
1191         Changed the way that options are passed down to the benchmarks.  Instead of passing individual
1192         boolean or numeric option values, just pass a reference the CommandLine itself.  Each benchmark
1193         can access the options that are appropriate.  The Benchmark class also uses the options for
1194         is parallel, run counts and warm up.
1195
1196         Added thread id and aligned malloc to the Op by noticing that structure padding and Opcode allowed
1197         for another 32 bits of data.  Breaking that unused 32 bits into a 16 bit thread id value and a
1198         16 bit log base 2 of the alignment for aligned malloc allowed for existing recordings to playback
1199         without any incompatibilities.
1200
1201         Threaded operation is simulated by creating threads as needed.  As long as the next Op's thread id
1202         is the same as the last, operation continues as normal.  When the next Op has a different thread id,
1203         we switch to that thread using the shared Op stream to continue playing back.  There is a mutex to
1204         assure that only one thread is really running at a time and a condition variable used to wait
1205         that the current thread id matches each block thread's thread id.  This doesn't simulate true
1206         concurrent threading, but is instead plays back Ops recorded for multiple thread faithfully.
1207
1208         * MallocBench/MallocBench.xcodeproj/project.pbxproj:
1209         * MallocBench/MallocBench/Benchmark.cpp:
1210         (deallocateHeap):
1211         (Benchmark::Benchmark):
1212         (Benchmark::runOnce):
1213         (Benchmark::run):
1214         * MallocBench/MallocBench/Benchmark.h:
1215         (Benchmark::isValid):
1216         * MallocBench/MallocBench/CommandLine.cpp:
1217         (CommandLine::printUsage):
1218         * MallocBench/MallocBench/CommandLine.h:
1219         (CommandLine::isValid):
1220         (CommandLine::benchmarkName):
1221         (CommandLine::isParallel):
1222         (CommandLine::useThreadID):
1223         (CommandLine::detailedReport):
1224         (CommandLine::warmUp):
1225         (CommandLine::heapSize):
1226         (CommandLine::runs):
1227         * MallocBench/MallocBench/Interpreter.cpp:
1228         (Interpreter::Interpreter):
1229         (Interpreter::run):
1230         (Interpreter::readOps):
1231         (Interpreter::doOnSameThread):
1232         (Interpreter::switchToThread):
1233         (Interpreter::detailedReport):
1234         (compute2toPower):
1235         (writeData):
1236         (Interpreter::doMallocOp):
1237         (Interpreter::Thread::Thread):
1238         (Interpreter::Thread::stop):
1239         (Interpreter::Thread::~Thread):
1240         (Interpreter::Thread::runThread):
1241         (Interpreter::Thread::waitToRun):
1242         (Interpreter::Thread::switchTo):
1243         * MallocBench/MallocBench/Interpreter.h:
1244         (Interpreter::Thread::isMainThread):
1245         * MallocBench/MallocBench/alloc_free.cpp: Added.
1246         (benchmark_alloc_free):
1247         * MallocBench/MallocBench/alloc_free.h: Added.
1248         * MallocBench/MallocBench/balloon.cpp:
1249         (benchmark_balloon):
1250         * MallocBench/MallocBench/balloon.h:
1251         * MallocBench/MallocBench/big.cpp:
1252         (benchmark_big):
1253         * MallocBench/MallocBench/big.h:
1254         * MallocBench/MallocBench/churn.cpp:
1255         (benchmark_churn):
1256         * MallocBench/MallocBench/churn.h:
1257         * MallocBench/MallocBench/facebook.cpp:
1258         (benchmark_facebook):
1259         * MallocBench/MallocBench/facebook.h:
1260         * MallocBench/MallocBench/flickr.cpp:
1261         (benchmark_flickr):
1262         (benchmark_flickr_memory_warning):
1263         * MallocBench/MallocBench/flickr.h:
1264         * MallocBench/MallocBench/fragment.cpp:
1265         (validate):
1266         (benchmark_fragment):
1267         (benchmark_fragment_iterate):
1268         * MallocBench/MallocBench/fragment.h:
1269         * MallocBench/MallocBench/list.cpp:
1270         (benchmark_list_allocate):
1271         (benchmark_list_traverse):
1272         * MallocBench/MallocBench/list.h:
1273         * MallocBench/MallocBench/main.cpp:
1274         (main):
1275         * MallocBench/MallocBench/medium.cpp:
1276         (benchmark_medium):
1277         * MallocBench/MallocBench/medium.h:
1278         * MallocBench/MallocBench/memalign.cpp:
1279         (test):
1280         (benchmark_memalign):
1281         * MallocBench/MallocBench/memalign.h:
1282         * MallocBench/MallocBench/message.cpp:
1283         (benchmark_message_one):
1284         (benchmark_message_many):
1285         * MallocBench/MallocBench/message.h:
1286         * MallocBench/MallocBench/nimlang.cpp: Added.
1287         (benchmark_nimlang):
1288         * MallocBench/MallocBench/nimlang.h: Added.
1289         * MallocBench/MallocBench/nimlang.ops: Added.
1290         * MallocBench/MallocBench/realloc.cpp:
1291         (benchmark_realloc):
1292         * MallocBench/MallocBench/realloc.h:
1293         * MallocBench/MallocBench/reddit.cpp:
1294         (benchmark_reddit):
1295         (benchmark_reddit_memory_warning):
1296         * MallocBench/MallocBench/reddit.h:
1297         * MallocBench/MallocBench/stress.cpp:
1298         (deallocate):
1299         (benchmark_stress):
1300         * MallocBench/MallocBench/stress.h:
1301         * MallocBench/MallocBench/stress_aligned.cpp:
1302         (benchmark_stress_aligned):
1303         * MallocBench/MallocBench/stress_aligned.h:
1304         * MallocBench/MallocBench/theverge.cpp:
1305         (benchmark_theverge):
1306         (benchmark_theverge_memory_warning):
1307         * MallocBench/MallocBench/theverge.h:
1308         * MallocBench/MallocBench/tree.cpp:
1309         (benchmark_tree_allocate):
1310         (benchmark_tree_traverse):
1311         (benchmark_tree_churn):
1312         * MallocBench/MallocBench/tree.h:
1313         * MallocBench/run-malloc-benchmarks:
1314
1315 2016-02-11  Jon Lee  <jonlee@apple.com>
1316
1317         Fix a missing refactoring.
1318
1319         * Animometer/tests/master/resources/multiply.js:
1320         (animate): Move to Utilities.lerp.
1321         (_lerp): Deleted.
1322
1323 2016-02-10  Jon Lee  <jonlee@apple.com>
1324
1325         Add new benchmark tests.
1326         https://bugs.webkit.org/show_bug.cgi?id=154063
1327
1328         Provisionally reviewed by Said Abou-Hallawa.
1329
1330         Add tests for get/put image data, filters, opacity, and css transforms.
1331
1332         * Animometer/resources/runner/benchmark-runner.js:
1333         (_runBenchmarkAndRecordResults): Update the body background color to match that of
1334         the stage.
1335         (this._runNextIteration): Clear the background color style for the results page.
1336         * Animometer/resources/runner/tests.js:
1337         * Animometer/tests/master/focus.html: Added.
1338         * Animometer/tests/master/image-data.html: Added.
1339         * Animometer/tests/master/multiply.html: Added.
1340         * Animometer/tests/master/resources/focus.js: Added.
1341         * Animometer/tests/master/resources/image-data.js: Added.
1342         * Animometer/tests/master/resources/multiply.js: Added.
1343         * Animometer/tests/master/resources/stage.css: Move common styles out.
1344         * Animometer/tests/resources/main.js: Update Stage.randomBool to use Math.random.
1345         Add Stage.randomSign for randomly setting a direction. Add the notion of the
1346         current timestamp of the test to Benchmark, since some animations cycle through
1347         colors and rely on an incremental counter like the time.
1348
1349 2016-02-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
1350
1351         Add internal benchmark tests for CSS mix-blend-modes and filters
1352         https://bugs.webkit.org/show_bug.cgi?id=154058
1353
1354         Provisionally reviewed by Jon Lee.
1355
1356         * Animometer/resources/debug-runner/tests.js: Include the new tests in the
1357         "HTML suite" of the debug runner.
1358
1359         * Animometer/resources/extensions.js:
1360         (Utilities.browserPrefix):
1361         (Utilities.setElementPrefixedProperty): Utility functions to allow setting
1362         prefixed style properties.
1363
1364         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1365         Set the mix-blend-mode and the filter to some random values if the options
1366         of the test requested that.
1367
1368         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1369         (parseShapeParameters): Parse the url options "blend" and "filter" and set
1370         the corresponding flags.
1371
1372         * Animometer/tests/resources/main.js:
1373         (randomStyleMixBlendMode):
1374         (randomStyleFilter): Return random mix-blend-mode and filter.
1375
1376 2016-02-08  Jon Lee  <jonlee@apple.com>
1377
1378         Add a ramp controller
1379         https://bugs.webkit.org/show_bug.cgi?id=154028
1380
1381         Provisionally reviewed by Said Abou-Hallawa.
1382
1383         Enhance the graph to include a complexity-fps graph, in addition
1384         to the time graph.
1385
1386         * Animometer/developer.html: Add a ramp option.
1387         * Animometer/resources/debug-runner/animometer.css: Update the style.
1388         * Animometer/resources/strings.js: Flatten the Strings.text constants.
1389         * Animometer/resources/debug-runner/animometer.js:
1390         (ResultsTable.call._addGraphButton): Refactor.
1391         (ResultsTable.call._addTest): Add regression data.
1392         (benchmarkController): Add a form that allows the user to switch between the two forms,
1393         Add a form that allows the user to toggle different data. Hide certain header columns
1394         depending on the selected controller.
1395         * Animometer/resources/debug-runner/graph.js: Add the complexity regressions.
1396         * Animometer/resources/debug-runner/tests.js: Add headers for the ramp results.
1397         * Animometer/resources/runner/animometer.js:
1398         (ResultsTable): If a header is disabled don't include them in _flattenedHeaders.
1399         * Animometer/tests/resources/main.js:
1400         (Controller): Allow options to specify the capacity for sample arrays.
1401         (Regression): A piecewise regression that tries to fit a slope and a flat profile.
1402         (_calculateRegression): Options can fix the slope and bias when calculating the minimal
1403         error. Sweep across the samples in time (which could be backward depending on the controller)
1404         and calculate the intersection point.
1405         (RampController): This controller assumes that the target frame rate is below
1406         58 FPS. It runs in two stages. The first stage quickly determines the order of
1407         magnitude of objects needed to stress the system by the setting the complexity
1408         to increasingly difficult tiers. Perform a series of ramps descending from a
1409         high-water mark of complexity. The complexity needed to reach the target frame
1410         length is done by performing a piecewise regression on each ramp, and track a
1411         running average of these values. For the next ramp, make that running average
1412         the center of the ramp. With a minimum complexity of 0, the high-water mark is
1413         twice that average. The score is based on the highest complexity that can
1414         reach 60 fps.
1415
1416 2016-02-08  Jon Lee  <jonlee@apple.com>
1417
1418         Address Said's comments on the benchmark, and do some clean up.
1419
1420         * Animometer/developer.html:
1421         * Animometer/resources/debug-runner/animometer.css: Add styles for averages.
1422         * Animometer/resources/debug-runner/animometer.js: Use the right
1423         Strings constants.
1424         * Animometer/resources/debug-runner/graph.js:
1425         (_addRegressionLine): Add missing code to draw the line and standard
1426         deviation highlight.
1427         (onGraphTypeChanged): Remove unneeded variables
1428         (onTimeGraphOptionsChanged):
1429         * Animometer/resources/runner/benchmark-runner.js:
1430         (_runBenchmarkAndRecordResults): Rename samplers to suiteResults and
1431         _suitesSamplers to _suitesResults.
1432         * Animometer/tests/resources/main.js:
1433         (results): Call processSamples().
1434         (update): Change sampling timestamp comparison.
1435         (_animateLoop): Move shouldStop call to before the update.
1436         * Animometer/tests/resources/sampler.js:
1437         (process): Rename to processSamples().
1438
1439 2016-02-07  Jon Lee  <jonlee@apple.com>
1440
1441         Teach Controller to measure intervals, and turn off the frame length estimator.
1442
1443         * Animometer/tests/resources/main.js: Default interval length is 100 ms.
1444         (start): Set the first interval.
1445         (_measureAndResetInterval): Reports the average frame length of the interval that just
1446         completed, and sets up the next interval.
1447         (update): If there is no length, then just use the estimator per frame, otherwise the
1448         estimator measures per interval. Add a didFinishInterval for subclasses to process
1449         prior to recording the sample. Update tune() to include whether an interval had
1450         finished.
1451         (StepController): Step controllers don't measure on an interval basis.
1452
1453 2016-02-07  Jon Lee  <jonlee@apple.com>
1454
1455         Minor refactoring. Rename Controller._estimator to Controller._frameLengthEstimator
1456         and switch the parameters for start(), update(), and tune(), so that the timestamp
1457         is first and stage is second.
1458
1459         * Animometer/tests/resources/main.js:
1460
1461 2016-02-07  Jon Lee  <jonlee@apple.com>
1462
1463         Move ResultsTable functionality not needed for release tests out.
1464         Move reporting of score and mean to selection of the time-based graph.
1465
1466         * Animometer/developer.html: Rename graph-options to time-graph-options.
1467         * Animometer/resources/debug-runner/animometer.js:
1468         (DeveloperResultsTable): Moved from runner/animometer.js. Switch from mean
1469         values to "average" objects which can hold stdev. Move graph button and
1470         calculation of noisy measurements here. Sophisticated header processing
1471         is not needed in release suite.
1472         (populateTable): Use DeveloperResultsTable.
1473         * Animometer/resources/debug-runner/graph.js: Pull time graph creation to
1474         its own function, and add a new onGraphTypeChanged handler in preparation
1475         of a complexity graph to be added later.
1476         * Animometer/resources/runner/animometer.js:
1477         (ResultsTable): Simplify to just handle test names and scores.
1478
1479 2016-02-07  Jon Lee  <jonlee@apple.com>
1480
1481         Tests: reuse objects already made.
1482
1483         Avoid thrash of object creation and removal by maintaining an index that
1484         moves along the array as the adjust values change. If the tune value
1485         requires more objects than the maximum size of the object array, then create
1486         new objects. This means that the object array size never decreases.
1487
1488         * Animometer/tests/master/resources/canvas-stage.js: Maintain a separate
1489         offsetIndex. For these tests, we want to avoid drawing the oldest objects,
1490         so the scene will draw the object at offsetIndex to the end of the array.
1491         (tune): Reverse the logic since "removal" of objects is much simpler and
1492         involves simply changing the offsetIndex.
1493         (animate): Update the for loop to draw from offsetIndex to the end.
1494         (complexity): Update the definition.
1495         * Animometer/tests/master/resources/canvas-tests.js: Maintain a separate
1496         offsetIndex. For these tests, we want to avoid drawing the newest objects,
1497         so the scene will draw the object at index 0 to the object at offsetIndex.
1498         (SimpleCanvasStage.animate): Fly-by removal of local stage variable,
1499         which is unneeded. Update the for loop to draw from offsetIndex to the end.
1500         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1501         (SimpleCanvasStage.animate): Update the for loop to draw from 0 to
1502         offsetIndex.
1503         * Animometer/tests/simple/resources/simple-canvas.js:
1504         (tune): Update logic. Here, offsetIndex represents the boundary of the last
1505         index to render.
1506         (animate): Update the for loop to draw from 0 to offsetIndex.
1507         (complexity): Update the definition.
1508
1509 2016-02-07  Jon Lee  <jonlee@apple.com>
1510
1511         Tests: refactor and update styles.
1512
1513         * Animometer/tests/resources/main.js: Add helper methods that return
1514         a color that hue rotates based on the date, and a counter value that
1515         increases based on the date. Fix randomInt() to not bias against the min and
1516         max values.
1517
1518         * Animometer/tests/master/resources/canvas-tests.js: Use new helper methods.
1519         * Animometer/tests/master/resources/dom-particles.js: Ditto.
1520         * Animometer/tests/master/resources/particles.js: Ditto.
1521         * Animometer/tests/simple/resources/simple-canvas-paths.js: Refactor to
1522         use a rotating color instead of a random color. The fast switching of color
1523         is too vivid to watch.
1524
1525         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1526         (BouncingSvgParticlesStage.call.createGradient): Fix the gradient so
1527         that the last stop is located at the end.
1528
1529 2016-02-07  Jon Lee  <jonlee@apple.com>
1530
1531         Refactor tune() to not return the complexity of the scene.
1532
1533         We have stage.complexity() now, so returning the complexity through tune
1534         is unnecessary.
1535
1536         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1537         * Animometer/tests/master/resources/canvas-stage.js:
1538         * Animometer/tests/master/resources/particles.js:
1539         * Animometer/tests/misc/resources/canvas-electrons.js:
1540         * Animometer/tests/misc/resources/canvas-stars.js:
1541         * Animometer/tests/resources/main.js:
1542         * Animometer/tests/simple/resources/simple-canvas.js:
1543         * Animometer/tests/simple/resources/tiled-canvas-image.js:
1544         * Animometer/tests/template/resources/template-canvas.js:
1545         * Animometer/tests/template/resources/template-css.js:
1546         * Animometer/tests/template/resources/template-svg.js:
1547         * Animometer/tests/text/resources/layering-text.js:
1548
1549 2016-02-07  Jon Lee  <jonlee@apple.com>
1550
1551         Make the fixed controller a step controller instead. Halfway through the test
1552         it will bump up the complexity 4-fold. Calculate the step timestamp using options
1553         instead of a separate parameter to the Controller constructor.
1554
1555         * Animometer/developer.html: Change value to "step"
1556         * Animometer/resources/debug-runner/animometer.js:
1557         (window.suitesManager.updateEditsElementsState): Show number inputs when set to "step".
1558         * Animometer/tests/resources/main.js:
1559         (update): Provide a hook for subclasses to tune.
1560         (StepController): Maintain a flag determining whether we've stepped, and the time
1561         we should step.
1562         (Benchmark): Use the new StepController.
1563
1564 2016-02-07  Jon Lee  <jonlee@apple.com>
1565
1566         Adjust the FPS graph scale.
1567
1568         Instead of making the FPS graph linearly scale, scale it based on the frame length,
1569         but show the data in terms of FPS. Because it is inversely proportional, and most
1570         of the data never gets below 20, concentrate the axis from 20-60 FPS, since otherwise
1571         over half of the available graph space ends up blank.
1572
1573         This means we should convert all of the FPS data to frame length data.
1574
1575         * Animometer/resources/debug-runner/graph.js: Update the domain to be based on
1576         frame length in milliseconds instead of FPS. Update the cursor to consider all of the
1577         values being shown, and then pick the min and max values to represent the length of the
1578         cursor.
1579         * Animometer/resources/runner/animometer.js:
1580         * Animometer/resources/strings.js:
1581         * Animometer/tests/resources/main.js:
1582         (processSamples): Add the ability to only sample a range of the data instead of everything
1583         after an offset index. Update sampler to record the frame lengths instead of the frame
1584         rate.
1585
1586 2016-02-07  Jon Lee  <jonlee@apple.com>
1587
1588         Add option to use different methods for retrieving a timestamp.
1589
1590         * Animometer/developer.html: Add performance.now and Date.now options.
1591         * Animometer/resources/runner/animometer.js: Default to performance.now.
1592         (window.benchmarkController.startBenchmark):
1593         * Animometer/tests/resources/main.js: Tie the desired method to _getTimestamp.
1594         (run): Use _getTimestamp.
1595         (_animateLoop): Ditto.
1596
1597 2016-02-07  Jon Lee  <jonlee@apple.com>
1598
1599         Allow adding any number of markers to the graph. The markers can be labeled
1600         and contain timestamp and sample index data. Make it a part of the controller
1601         rather than keeping it in the sampler.
1602
1603         * Animometer/resources/debug-runner/animometer.css: Add styles for markers
1604         * Animometer/resources/debug-runner/graph.js: Create the markers and add
1605         text labels.
1606         * Animometer/resources/runner/animometer.js: Assume the samplingTimeOffset
1607         is just one of the marks provided.
1608         * Animometer/resources/strings.js: Add Strings.json.marks.
1609         * Animometer/tests/resources/main.js:
1610         (Controller): Keep marks here. They are keyed by the marker name, so no two
1611         markers should have the same name.
1612         (recordFirstSample): Refactor to use mark.
1613         (mark): Allows for arbitrary data if needed later. The timestamp maintained
1614         is relative to the absolute start timestamp.
1615         (containsMark): Checks whether a mark with a specific comment exists.
1616         (processSamples): Removes the _startTimestamp offset from the marks before
1617         setting it in results.
1618         * Animometer/tests/resources/sampler.js: Remove marks.
1619
1620 2016-02-07  Jon Lee  <jonlee@apple.com>
1621
1622         Get rid of options member variable in Benchmark.
1623
1624         Options are only needed when initializing the stage or benchmark, so there's no
1625         need to also keep a reference to it.
1626
1627         * Animometer/tests/resources/main.js: Get rid of options variable in Benchmark.
1628         Pass options to Controllers and Stages.
1629         (Controller.Utilities.createClass):
1630         (Benchmark.Utilities.createClass):
1631         (get options): Deleted.
1632
1633         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
1634         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
1635         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
1636         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
1637         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1638         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1639         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
1640         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1641         * Animometer/tests/master/resources/canvas-stage.js:
1642         * Animometer/tests/master/resources/canvas-tests.js:
1643         * Animometer/tests/master/resources/particles.js:
1644         * Animometer/tests/misc/resources/canvas-electrons.js:
1645         * Animometer/tests/misc/resources/canvas-stars.js:
1646         * Animometer/tests/misc/resources/compositing-transforms.js:
1647         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1648         * Animometer/tests/simple/resources/tiled-canvas-image.js:
1649         * Animometer/tests/template/resources/template-canvas.js:
1650         * Animometer/tests/template/resources/template-css.js:
1651         * Animometer/tests/template/resources/template-svg.js:
1652         * Animometer/tests/text/resources/layering-text.js:
1653
1654 2016-02-07  Jon Lee  <jonlee@apple.com>
1655
1656         Update how the benchmark is run
1657         https://bugs.webkit.org/show_bug.cgi?id=153960
1658
1659         Provisionally reviewed by Said Abou-Hallawa.
1660
1661         Introduce the notion of a Controller. It is responsible for recording, updating,
1662         and processing the statistics and complexity of the benchmark. This allows
1663         plugging in different Controllers.
1664
1665         This strips most of the functionality from Animator and BenchmarkState, so fold
1666         what's left into Benchmark. Now, Benchmarks only own a stage and a controller, but
1667         are responsible for driving the animation loop.
1668
1669         Rewrite Animator._shouldRequestAnotherFrame into two different Controllers. One
1670         maintains a fixed complexity, and the other adapts the complexity to meet a
1671         fixed FPS.
1672
1673         Fix the Kalman estimator to be modeled on a scalar variable with no model.
1674
1675         * Animometer/tests/resources/main.js: Remove BenchmarkState and Animator, and
1676         replace it with a Controller. Add a FixedController and refactor the previous controller
1677         to an AdaptiveController.
1678
1679         (Controller): Controllers own the estimator and the sampler. When a new frame is
1680         displayed, the animation loop calls update(). The estimator and sampler record
1681         stats, then tune. Samplers can track multiple series of data. The basic controller
1682         tracks timestamp, complexity, and estimated frame rate.
1683                 The Kalman estimation is based on the frame length rather than the frame
1684         rate. Because FPS is inverse proportional to frame length, in the case where the measured
1685         frame length is very small, the FPS ends up being a wildly large number (in the order of
1686         600-1000 "FPS"), and it pulls the estimator up drastically enough that it takes a while
1687         for it to settle back down. Using frame length reduces the impact of these spikes.
1688                 Converging the estimation takes enough time to avoid initializing it immediately
1689         when the benchmark starts. Instead, the benchmark runs for a brief period of time (100ms)
1690         before running it in earnest. Allow controllers an opportunity to set the complexity
1691         before starting recording.
1692                 When the benchmark is complete, the controller has an opportunity to process
1693         the samples. The default implementation calculates the raw FPS based on the time
1694         difference of the samples, and calculates the complexity score. This is moved from
1695         Benchmark.processSamples.
1696
1697         (Controller): Initialize timestamps. These are at first relative to the start of the
1698         benchmark, but are offset by the absolute start time during start(). By default maintain
1699         3 data series, but subclasses can override.
1700         (start): Calls recordFirstSample() for subclasses to override if needed.
1701         (recordFirstSample): For basic controller, start sampling at the beginning.
1702         (update): Update the frame length estimator and sample.
1703         (shouldStop): Checks that the time is before _endTimestamp.
1704         (results): Returns the processed samples.
1705         (processSamples): Iterate through the sample data and collate them. Include scores.
1706
1707         (FixedComplexityController): Controller that tunes the stage to the desired complexity
1708         prior to starting, and keeps it at that complexity.
1709
1710         (AdaptiveController): Have the estimator estimate the interval frame rate instead of the
1711         raw frame rate.
1712                 The previous version of this controller ignored the frame that came after the
1713         adjustment. The raw FPS show that whatever noise the scene change adds is negligible
1714         compared to the noise of the system overall. Stop ignoring that frame and include all
1715         frames in the measurements.
1716
1717         (Benchmark): Remove dependency on animator, and instantiate a runner based on what is
1718         selected. Most of the loop's functionality is in Controller, so remove here.
1719         (Benchmark.run): Remove start() since it is only called from run(), and fold it in here.
1720         (Benchmark._animateLoop): Fold in from Animator.animateLoop. Let the benchmark run for
1721         a brief period before calling Controller.start().
1722
1723         * Animometer/tests/resources/math.js: Fix the Kalman estimator. The filter estimates
1724         a scalar variable, and makes basic assumptions regarding the model. As a result
1725         none of the linear algebra classes are needed, so remove Matrix, Vector3, and Matrix3.
1726         (SimpleKalmanEstimator): Calculate the gain based on the provided process and
1727         measurement errors.
1728         (KalmanEstimator): Deleted.
1729         (IdentityEstimator): Deleted.
1730         (PIDController): Refactor to use the Utilities.createClass() helper.
1731
1732         The Kalman filter algorithm is explained here http://greg.czerniak.info/guides/kalman1/.
1733         The state, represented by a scalar, is the estimated frame length. There is no user
1734         transition of the state, and the state is the same as the measurement. With this model,
1735         the estimation error converges, so calculate the gain ahead of time.
1736
1737         * Animometer/developer.html: Remove fixed-after-warmup since it is not useful.
1738         Replace the option to toggle the estimator, and make it possible to customize the
1739         estimator's error parameters. Show raw FPS by default, and remove interval FPS,
1740         which will be shown instead of the filtered raw FPS.
1741         * Animometer/resources/debug-runner/animometer.css: Put the header behind the graph.
1742         Remove #intervalFPS rules; move the color to #filteredFPS.
1743         * Animometer/resources/debug-runner/graph.js:
1744         (updateGraphData): Update the hr style to force the layout to be calculated
1745         correctly. Change the tick format to be in terms of seconds, since the timestamps
1746         are in milliseconds. Remove interval data.
1747         * Animometer/resources/runner/animometer.js:
1748         (window.benchmarkController.startBenchmark): Set Kalman parameters.
1749         * Animometer/resources/runner/benchmark-runner.js:
1750         (_runBenchmarkAndRecordResults): When a benchmark completes, expect it to return
1751         the final data, rather than passing a sampler from the controller. This avoids
1752         needing to expose the sampler variable in the benchmark.
1753         * Animometer/tests/resources/sampler.js:
1754         (process): Move the setting of the target frame rate to AdaptiveController.
1755
1756 2016-02-06  Jon Lee  <jonlee@apple.com>
1757
1758         Code clean up: Move Rotater function closer to Stage static methods.
1759         The Rotater is used together with those methods; keep them close.
1760
1761         * Animometer/tests/resources/main.js:
1762
1763 2016-02-06  Jon Lee  <jonlee@apple.com>
1764
1765         Update the JS includes due to ResultsTable move.
1766
1767         * Animometer/developer.html:
1768         * Animometer/index.html:
1769
1770 2016-02-06  Jon Lee  <jonlee@apple.com>
1771
1772         Move createElement and createSVGElement to Utilities.
1773
1774         * Animometer/resources/extensions.js:
1775         (Utilities.createElement): Added.
1776         (Utilities.createSVGElement): Added.
1777         (DocumentExtension.createElement): Deleted.
1778         (DocumentExtension.createSvgElement): Deleted.
1779
1780         * Animometer/resources/debug-runner/animometer.js:
1781         * Animometer/resources/runner/animometer.js:
1782         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
1783         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
1784         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1785
1786 2016-02-06  Jon Lee  <jonlee@apple.com>
1787
1788         Add a convenience function for creating a class.
1789
1790         The pattern for creating a class is common enough to add as a Utilities
1791         helper function. It also makes it easy to collapse class definitions when
1792         editing.
1793
1794         * Animometer/resources/debug-runner/animometer.js: Move ProgressBar definition,
1795         since it is only used here.
1796         * Animometer/resources/runner/animometer.js: Move ResultsDashboard and
1797         ResultsTable definition, since it is only used here.
1798         * Animometer/resources/extensions.js: Move Utilities definition to the top. Convert
1799         Point, Insets, SimplePromise.
1800         (ProgressBar): Moved to animometer.js.
1801         (ResultsDashboard): Moved to animometer.js.
1802         (ResultsTable): Moved to animometer.js.
1803         * Animometer/resources/runner/benchmark-runner.js: Convert BenchmarkRunnerState,
1804         BenchmarkRunner.
1805         * Animometer/tests/resources/main.js: Convert Rotater, Stage, Animator, Benchmark.
1806         * Animometer/tests/resources/sampler.js: Convert Experiment, Sampler.
1807
1808         Convert test primitives.
1809         * Animometer/tests/master/resources/canvas-tests.js: Convert CanvasLineSegment,
1810         CanvasArc, CanvasLinePoint.
1811         * Animometer/tests/simple/resources/simple-canvas-paths.js: Convert CanvasLineSegment,
1812         CanvasLinePoint, CanvasQuadraticSegment, CanvasQuadraticPoint, CanvasBezierSegment,
1813         CanvasBezierPoint, CanvasArcToSegment, CanvasArcToSegmentFill, CanvasArcSegment,
1814         CanvasArcSegmentFill, CanvasRect, CanvasRectFill.
1815         * Animometer/tests/simple/resources/tiled-canvas-image.js: Convert CanvasImageTile.
1816
1817 2016-02-06  Jon Lee  <jonlee@apple.com>
1818
1819         Minor improvements to debug harness.
1820
1821         * Animometer/developer.html:
1822         * Animometer/resources/debug-runner/animometer.css:
1823         (#suites): Put the complexity text boxes closer to the test names.
1824         (#options):
1825         (#rawFPS circle): Make the interval FPS appear as a separate data series, with a line.
1826         (#intervalFPS path):
1827         (#intervalFPS circle):
1828         * Animometer/resources/debug-runner/animometer.js:
1829         (window.optionsManager.updateLocalStorageFromUI): Convert number inputs from text.
1830         (window.suitesManager._onChangeTestCheckbox): Refactor to take a checkbox.
1831         (window.suitesManager._createTestElement): Enhance such that typing into the complexity
1832         input will automatically select that test for running.
1833         (window.suitesManager.updateLocalStorageFromJSON): Make the harness work for private
1834         browsing.
1835         * Animometer/resources/debug-runner/graph.js: Separate the intervalFPS data, and show
1836         more accuracy in timestamps.
1837
1838 2016-02-06  Jon Lee  <jonlee@apple.com>
1839
1840         Refactor helper methods for getting random values for a stage.
1841
1842         Instead of requiring a Stage instance, just attach it to the Stage object.
1843
1844         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
1845         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1846         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1847         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1848         * Animometer/tests/master/resources/canvas-tests.js:
1849         * Animometer/tests/master/resources/particles.js:
1850         * Animometer/tests/misc/resources/canvas-electrons.js:
1851         * Animometer/tests/misc/resources/canvas-stars.js:
1852         * Animometer/tests/misc/resources/compositing-transforms.js:
1853         * Animometer/tests/resources/main.js:
1854         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1855
1856 2016-02-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
1857
1858         Add a new graphics test for CanvasRenderingContext2D functions: getImageData and putImageData
1859         https://bugs.webkit.org/show_bug.cgi?id=151716
1860
1861         Reviewed by Darin Adler.
1862
1863         The purpose of this test is to measure the performance of getImageData
1864         and putImageData functions. This test draws a background on the canvas
1865         and then gets some random tiles from this background and draw them in
1866         destinations different from their original sources.
1867
1868         * Animometer/resources/debug-runner/tests.js: Adding the new test to the canvas simple tests suite.
1869
1870         * Animometer/resources/extensions.js:
1871         (Array.prototype.shuffle): Shuffles the elements of an array.
1872
1873         (Point.zero): Returns a new Point object whose x and y are equal zero.
1874         (Point.prototype.str): Used for debugging the Point object.
1875
1876         * Animometer/tests/simple/resources/tiled-canvas-image.js: Added.
1877         (CanvasImageTile):
1878         (CanvasImageTile.prototype.getImageData):
1879         (CanvasImageTile.prototype.putImageData):
1880         (Stage.call.initialize):
1881         (Stage.call._createTiles):
1882         (Stage.call._nextTilePosition):
1883         (Stage.call.tune):
1884         (Stage.call._drawBackground):
1885         (Stage.call.animate):
1886         (Stage.call.complexity):
1887         (Stage.call):
1888         * Animometer/tests/simple/tiled-canvas-image.html: Added.
1889
1890 2016-01-07  Jon Lee  <jonlee@apple.com>
1891
1892         Fix new test.
1893
1894         * Animometer/resources/runner/tests.js: Wrong URL from an
1895         old patch.
1896         * Animometer/tests/master/particles.html:
1897         * Animometer/tests/master/resources/dom-particles.js:
1898         (Particle.call.reset): Figured out a simpler way to set up
1899         the particles.
1900         (this.move.reset): Deleted.
1901         (this.move._applyAttributes): Deleted.
1902         * Animometer/tests/master/resources/particles.js:
1903         (Particle): Call move() after reset().
1904
1905 2016-01-07  Jon Lee  <jonlee@apple.com>
1906
1907         Update benchmark test suite
1908         https://bugs.webkit.org/show_bug.cgi?id=152679
1909
1910         Reviewed by Simon Fraser.
1911
1912         Add a new test. The test has a rotating background
1913         gradient, and does a better job physically simulating
1914         particles.
1915
1916         * Animometer/resources/extensions.js: Teach Point to take constants as well as other Points.
1917         (Point.prototype.length): Added.
1918         (Point.prototype.normalize): Added.
1919         * Animometer/resources/runner/tests.js: Add the test to the master suite.
1920         * Animometer/tests/master/particles.html: Added.
1921         * Animometer/tests/master/resources/particles.js: Added. Parent class for different kinds of particles.
1922         (Particle):
1923         (Particle.prototype.reset): If the particle starts slowing down in terms of its animation,
1924         reset it.
1925         (Particle.prototype.animate): Bounce off the walls elastically, and include gravity.
1926         (Particle.prototype.move): Subclasses should override.
1927         (ParticlesStage): Stage includes a rotating gradient background.
1928         * Animometer/tests/master/resources/dom-particles.js: Added. Creates a <div> and adds it to
1929         the stage.
1930         * Animometer/tests/resources/star.svg: Added.
1931
1932 2016-01-03  Jon Lee  <jonlee@apple.com>
1933
1934         Update benchmark test suite
1935         https://bugs.webkit.org/show_bug.cgi?id=152679
1936
1937         Reviewed by Simon Fraser.
1938
1939         Move algorithm.js and sampler.js to tests/ and benchmark-runner.js to runner/.
1940
1941         Needed by both harnesses.
1942         * Animometer/resources/runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/resources/debug-runner/benchmark-runner.js.
1943         * Animometer/developer.html:
1944         * Animometer/index.html:
1945
1946         Needed only by the tests. Move to tests/. Statistics, in sampler.js, is used by ResultsDashboard, so move that
1947         into extensions.js.
1948         * Animometer/resources/extensions.js:
1949         * Animometer/tests/resources/algorithm.js: Renamed from PerformanceTests/Animometer/resources/algorithm.js.
1950         * Animometer/tests/resources/sampler.js: Renamed from PerformanceTests/Animometer/resources/sampler.js.
1951         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
1952         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
1953         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
1954         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
1955         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
1956         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
1957         * Animometer/tests/master/canvas-stage.html:
1958         * Animometer/tests/misc/canvas-electrons.html:
1959         * Animometer/tests/misc/canvas-stars.html:
1960         * Animometer/tests/misc/compositing-transforms.html:
1961         * Animometer/tests/simple/simple-canvas-paths.html:
1962         * Animometer/tests/template/template-canvas.html:
1963         * Animometer/tests/template/template-css.html:
1964         * Animometer/tests/template/template-svg.html:
1965         * Animometer/tests/text/layering-text.html:
1966         * Animometer/tests/text/text-boxes.html:
1967
1968 2016-01-07  Jon Lee  <jonlee@apple.com>
1969
1970         Update benchmark test suite
1971         https://bugs.webkit.org/show_bug.cgi?id=152679
1972
1973         Reviewed by Simon Fraser.
1974
1975         Fix tests for other browsers.
1976
1977         * Animometer/resources/extensions.js:
1978         (Point.elementClientSize): Some browsers return 0 for SVG clientWidth and clientHeight.
1979         Use getBoundingClientRect() instead.
1980         * Animometer/tests/misc/resources/canvas-electrons.js:
1981         (CanvasElectron.prototype._draw): Some browsers don't support ellipse.
1982
1983 2016-01-07  Jon Lee  <jonlee@apple.com>
1984
1985         Add a waitUntilReady() step
1986         https://bugs.webkit.org/show_bug.cgi?id=152862
1987
1988         Reviewed by Simon Fraser.
1989
1990         Add a waitUntilReady() callback that lets the benchmark complete
1991         its setup before running the benchmark.
1992
1993         * Animometer/tests/resources/main.js:
1994         (Benchmark.prototype.run): First call waitUntilReady, which returns
1995         a promise. When the promise resolves, run everything that was in this
1996         function.
1997         (Benchmark.prototype.waitUntilReady): Default implementation returns
1998         a resolved promise.
1999         (Benchmark.prototype.resolveWhenFinished): Deleted.
2000         * Animometer/tests/template/resources/template-canvas.js:
2001         (new.TemplateCanvasStage.waitUntilReady): Example on how to override.
2002
2003 2016-01-03  Jon Lee  <jonlee@apple.com>
2004
2005         Update data reporting and analysis
2006         https://bugs.webkit.org/show_bug.cgi?id=152670
2007
2008         Reviewed by Simon Fraser.
2009
2010         Show new graph data. Provide controls to show different series data. Provide an
2011         interactive cursor that shows the data at a given sample.
2012
2013         * Animometer/developer.html: Add a nav section in #results. Each part of the graph
2014         has a checkbox for visual toggling, as well as companion spans to contain the data.
2015                 The numbers will always be shown even if the SVG isn't.
2016         * Animometer/resources/debug-runner/animometer.css:
2017         (#suites): Adjust spacing when doing fixed complexity.
2018         (#test-graph nav): Place the nav in the upper right corner.
2019         (#test-graph-data > svg): Fix the FPS scale from 0-60. It makes the raw FPS goes past
2020         that scale. Allow it to show.
2021         (.target-fps): Add a dotted line for where the benchmark is supposed to settle for FPS.
2022         (#cursor line): The cursor contains a line and highlight circles for the data being shown.
2023         (#cursor circle):
2024         (#complexity path): This and rules afterward are named by series type.
2025         (#complexity circle):
2026         (#filteredFPS path):
2027         (#filteredFPS circle):
2028         (#rawFPS path):
2029         (#intervalFPS circle):
2030         (.left-samples): Deleted.
2031         (.right-samples): Deleted.
2032         * Animometer/resources/debug-runner/animometer.js:
2033         (initialize): Add a "changed" listener when the checkboxes change in the nav.
2034         (onBenchmarkOptionsChanged): Renamed.
2035         (showTestGraph): All graph data is passed in as graphData instead of as arguments.
2036         * Animometer/resources/debug-runner/graph.js: Extend BenchmarkController. When showing
2037         a new graph, call updateGraphData(). It creates all of the d3 graphs. onGraphOptionsChanged()
2038         toggles the data on and off.
2039         (updateGraphData): Add the axes. Add the average lines and markers for sample time and
2040         target FPS. Add the cursor group. Use helper function addData() to add the data. On top of
2041         everything add a transparent area which will catch all of the mouse events. When the mouse
2042         moves in the graph, find the closest data point, show the data in the nav area, and highlight
2043         the data points.
2044         (addData): Adds a line and circle for each data point. Also adds a highlight cursor with a
2045         size a little larger than the circle radius for the data points.
2046         (onGraphOptionsChanged): Called when data is visually toggled.
2047         (showOrHideNodes): Helper function to toggle the .hidden class.
2048         * Animometer/resources/extensions.js:
2049         (ResultsDashboard.prototype.get data): Get rid of the arguments for _processData.
2050         (ResultsTable.prototype._addGraphButton): Shove all of the graph data into a singular object.
2051
2052         Producing the JSON can take a while with all of the data. Make it on-demand with a
2053         button.
2054
2055         * Animometer/resources/debug-runner/animometer.js:
2056         (showResults): When showing the results, don't serialize the JSON data. Move that to...
2057         (showJSONResults): ...here. Remove the button.
2058
2059         * Animometer/developer.html: Add a button. The button will remove itself and populate
2060         the textarea with the JSON data.
2061         * Animometer/resources/debug-runner/animometer.css:
2062         (.hidden): Add a universal hidden class.
2063         (#results button.small-button): Promote the small-button styles to the whole results
2064         section for use in the JSON button.
2065         (#results button.small-button:active):
2066         (#results-data button.small-button): Deleted.
2067         (#results-data button.small-button:active): Deleted.
2068
2069         Refactor how Animator does its recording.
2070
2071         * Animometer/tests/resources/math.js: Create a new, simple estimator that just returns
2072         the same interval frame rate for adjustment.
2073         * Animometer/tests/resources/main.js:
2074         (Animator): Remove _dropFrameCount, and make variables more accurate described.
2075         (Animator.prototype.initialize): Use the identity estimator instead of using a bool.
2076         (Animator.prototype._intervalTimeDelta): Rename, only used internally.
2077         (Animator.prototype._shouldRequestAnotherFrame): Assume we drop one frame for adjustment
2078         of the scene. If we are within the number of frames to measure for the interval, just
2079         record the timestamp. Otherwise we are ready to evaluate and adjust the scene. Record
2080         the interval frame rate and the estimator's frame rate.
2081
2082         Avoid processing the data through the Experiment while the test is running. Reconfigure
2083         the sampler to just record the raw samples. After the test is done, run the samples through
2084         the Experiment to get the score.
2085
2086         * Animometer/resources/sampler.js:
2087         (Experiment): Fold _init() into the constructor since nobody else will call it. This is not
2088         needed until the test concludes, so remove startSampling(). Clients should just call sample().
2089         (Sampler): Pre-allocate arrays given the number of data points being recorded, and a capacity
2090         of how many samples will be used. The processor is a called when it's time to process the data
2091         since that is the client also telling the Sampler what to record.
2092                 Introduce the notion of marks as well, which allows the client to mark when an
2093         event occurs. When we mark sample start, we can attach the timestamp there, instead of storing
2094         it separately.
2095         (Sampler.prototype.startSampling): Deleted. Clients should just call record().
2096         (Sampler.prototype.record): The data to record is passed in as variable arguments.
2097         (Sampler.prototype.mark): When adding a mark, a client needs to provide a unique string, and
2098         can provide extra data object for later retrieval.
2099         (Sampler.prototype.process): Renamed from toJSON. Trim the sampling arrays to what was used.
2100         Call the processor to process the samples.
2101         * Animometer/resources/debug-runner/benchmark-runner.js:
2102         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Call process().
2103
2104         * Animometer/resources/strings.js: Add some new strings, remove the graph ones since they are
2105         not used.
2106         * Animometer/tests/resources/main.js:
2107         (Benchmark): Create a sampler with 4 series. The maximum number of points expected is the
2108         number of seconds multiplied by 60 fps. Benchmark, as a client of the Sampler, knows about all
2109         of the data being added to the Sampler. It is added through record(), and processed through
2110         processSamples().
2111         (Benchmark.prototype.update): Mark when we've passed warmup and are starting to sample. Include
2112         the timestamp in the custom data for the mark. This avoids the need to store is separately in
2113         the Sampler. Fold what was in record() here, since nothing else needs this functionality.
2114         record() now just relays the information to the sampler.
2115         (Benchmark.prototype.record): Called by Animator, which provides the data to the sampler.
2116         Animator's calls to this is part of a later patch. Requires each stage to return its complexity.
2117         (Benchmark.prototype.processSamples): If the sampling mark exists, add it to the results.
2118                 Go through all of the samples. All samples contain a timestamp and complexity. We
2119         calculate "raw FPS" which is the time differential from the previous sample. At regular intervals
2120         the Kalman-filtered FPS and the interval average FPS are also recorded. We also create two
2121         experiments, to get the scores for the complexity and smoothed FPS, and add those samples to
2122         the experiments. Grab those scores and add them into results also.
2123
2124         Add complexity() to the tests for Benchmark.record().
2125         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2126         * Animometer/tests/misc/resources/canvas-electrons.js:
2127         * Animometer/tests/misc/resources/canvas-stars.js:
2128         * Animometer/tests/text/resources/layering-text.js:
2129
2130 2015-12-27  Jon Lee  <jonlee@apple.com>
2131
2132         Simplify the test harness
2133         https://bugs.webkit.org/show_bug.cgi?id=152562
2134
2135         Reviewed by Simon Fraser.
2136
2137         Update the simple canvas tests. For the paths, start from the center instead of the
2138         top-left corner. Instead of using a coordinate limit, use a canonized factor, and
2139         use that along both the x and y axes, so that more capable tests use more of the
2140         canvas.
2141
2142         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2143         (CanvasLinePoint): Rewrite to use the coordinate maximum factor.
2144         (CanvasQuadraticPoint): Ditto.
2145         (CanvasBezierPoint): Ditto.
2146         * Animometer/tests/simple/resources/simple-canvas.js:
2147         (tune): Calculate a factor instead of a maximum coordinate.
2148
2149 2015-12-27  Jon Lee  <jonlee@apple.com>
2150
2151         Simplify the test harness
2152         https://bugs.webkit.org/show_bug.cgi?id=152562
2153
2154         Reviewed by Simon Fraser.
2155
2156         All of the benchmarks use the default Animator(). Don't require new tests
2157         to pass a new instance, and instead just make one in the Benchmark constructor.
2158
2159         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
2160         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
2161         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
2162         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2163         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
2164         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2165         * Animometer/tests/master/resources/canvas-tests.js:
2166         * Animometer/tests/misc/resources/canvas-electrons.js:
2167         * Animometer/tests/misc/resources/canvas-stars.js:
2168         * Animometer/tests/misc/resources/compositing-transforms.js:
2169         * Animometer/tests/resources/main.js:
2170         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2171         * Animometer/tests/template/resources/template-canvas.js:
2172         * Animometer/tests/template/resources/template-css.js:
2173         * Animometer/tests/template/resources/template-svg.js:
2174         * Animometer/tests/text/resources/layering-text.js:
2175         * Animometer/tests/text/resources/text-boxes.js:
2176
2177         Refactor the template.
2178
2179         * Animometer/tests/template/resources/template-canvas.js:
2180         * Animometer/tests/template/resources/template-css.js:
2181         * Animometer/tests/template/resources/template-svg.js:
2182         * Animometer/tests/template/template-canvas.html:
2183         * Animometer/tests/template/template-css.html:
2184         * Animometer/tests/template/template-svg.html:
2185
2186         Refactor the SVG suite.
2187
2188         * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Move scripts to the end.
2189         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto.
2190
2191         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Remove extraneous includes
2192         to stage.js.
2193         * Animometer/tests/text/text-boxes.html: Ditto.
2194
2195         BouncingCanvasParticlesBenchmark is not necessary. Use Benchmark directly when subclassing.
2196         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Remove
2197         BouncingCanvasParticlesBenchmark.
2198         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Use Benchmark.
2199         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Ditto.
2200
2201         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: Require the shape
2202         in the constructor instead of having subclasses set the private variable.
2203
2204         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: Refactor.
2205         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2206
2207         Refactor the HTML suite.
2208
2209         Move scripts to the end.
2210         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
2211         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
2212         * Animometer/tests/text/layering-text.html:
2213         * Animometer/tests/text/text-boxes.html:
2214
2215         Refactor to use the new variables.
2216         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
2217         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2218         * Animometer/tests/text/resources/layering-text.js:
2219         * Animometer/tests/text/resources/text-boxes.js:
2220
2221         Refactor the bouncing canvas tests.
2222
2223         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Move scripts to the end.
2224         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Move scripts to the end.
2225
2226         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Promote a few
2227         properties to "public" since they are used by subclasses.
2228         (BouncingParticlesStage): Fix the constructor, which was missing "this". Make particles
2229         "public" for subclasses.
2230         (BouncingParticlesStage.initialize): Fix the max velocity, which was accidentally changed.
2231         * Animometer/tests/misc/resources/compositing-transforms.js: Refactor.
2232
2233         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
2234         BouncingCanvasParticlesAnimator is no longer needed.
2235         (BouncingCanvasParticle): Change constructor to take a shape as a parameter instead of
2236         having subclasses set the variable.
2237
2238         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Refactor.
2239         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Refactor.
2240
2241         Move example/ files into misc/.
2242
2243         * Animometer/tests/misc/canvas-electrons.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-electrons.html.
2244         * Animometer/tests/misc/canvas-stars.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-stars.html.
2245         * Animometer/tests/misc/resources/canvas-electrons.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-electrons.js.
2246         * Animometer/tests/misc/resources/canvas-stars.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-stars.js.
2247
2248         * Animometer/resources/debug-runner/tests.js: Update test URLs.
2249
2250         Refactor miscellaneous suite.
2251
2252         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2253         Remove BouncingParticlesAnimator and BouncingParticleBenchmark, which are
2254         not needed.
2255         (tune): Remove console assert.
2256         * Animometer/tests/resources/main.js: Add Rotater back in from stage.js.
2257
2258         * Animometer/tests/examples/resources/canvas-electrons.js: Remove CanvasElectronsAnimator.
2259         * Animometer/tests/examples/resources/canvas-stars.js: Remove CanvasStarsAnimator.
2260         * Animometer/tests/misc/resources/compositing-transforms.js:
2261         * Animometer/tests/examples/canvas-electrons.html: Move scripts to the end.
2262         * Animometer/tests/examples/canvas-stars.html: Ditto.
2263         * Animometer/tests/misc/compositing-transforms.html: Ditto.
2264
2265         Refactor the simple suite.
2266
2267         * Animometer/tests/master/resources/canvas-stage.js:
2268         (tune): Remove coordinateMaximum since it is not needed in any
2269         of the master tests.
2270         * Animometer/tests/simple/resources/simple-canvas.js:
2271         SimpleCanvasAnimator and SimpleCanvasBenchmark are no longer
2272         needed.
2273         (tune): Manage the objects differently, but instead of duplicating
2274         all of SimpleCanvasStage here, just replace tune(). Include
2275         coordinateMaximum, and remove items from the end of the list
2276         instead of the beginning.
2277         (StageBenchmark.call.createAnimator): Deleted.
2278         (StageBenchmark.call): Deleted.
2279         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2280         * Animometer/tests/simple/simple-canvas-paths.html: Move
2281         scripts to the end.
2282
2283         Get rid of stage.js, StageAnimator, and StageBenchmark. Don't have the progress bar update during the test.
2284
2285         * Animometer/resources/debug-runner/animometer.js:
2286         (initialize): Move the setting of testsCount to the debug runner.
2287         (didRunTest): Nicer name.
2288         * Animometer/resources/debug-runner/benchmark-runner.js:
2289         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Don't pass in the progress bar to benchmarks.
2290         * Animometer/resources/extensions.js:
2291         (ProgressBar): Refactor. Make variables "private". Resetting the progress when instantiating.
2292         (ProgressBar.prototype.incrementRange): This is called every time a benchmark completes.
2293         * Animometer/resources/runner/animometer.js:
2294         (window.benchmarkRunnerClient.initialize): Remove unneeded setting of testsCount.
2295         * Animometer/resources/strings.js: These are no longer needed.
2296         * Animometer/tests/master/canvas-stage.html: Remove script inclusion. Other tests will follow.
2297         * Animometer/tests/master/resources/canvas-tests.js: Use Benchmark instead of StageBenchmark.
2298         * Animometer/tests/resources/main.js: Messages are no longer needed
2299         (Animator.prototype._shouldRequestAnotherFrame): Rename from animate(), since this method returns a boolean
2300         indicating whether another frame should be requested. Collapse the logic from StageAnimator into animateLoop.
2301         (BenchmarkState.prototype.currentStage): Deleted.
2302         (BenchmarkState.prototype.currentMessage): Deleted.
2303         (BenchmarkState.prototype.currentProgress): Deleted.
2304         (Animator.prototype.animate): Deleted.
2305         (Animator.prototype.animateLoop): The stage is animated only when we have another frame to draw.
2306         (Benchmark.prototype.record): No need to update the progress bar.
2307         * Animometer/tests/resources/stage.js: Removed. Rotater will appear in a later patch, in main.js.
2308
2309         * Animometer/resources/debug-runner/benchmark-runner.js:
2310         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Each test is run as a benchmark.
2311         Remove the call to runBenchmark by merging the options here, and calling benchmark.run()
2312         directly.
2313
2314         Make the class relationships more easily understandable. The benchmark owns the stage,
2315         animator, and options. Make the stage and animator no longer have their own references to
2316         the options. Make Stage a first-class citizen by promoting it to main.js. Later patches
2317         will try to get rid of stage.js altogether.
2318         * Animometer/tests/resources/main.js:
2319         (Stage): Moved from stage.js.
2320         (Animator): Don't pass in benchmark and options in its constructor. It will get initialized
2321         by benchmark-related parameters in initialize().
2322         (Animator.prototype.initialize): Add a back-reference to benchmark and cache an option.
2323         (Animator.prototype.get benchmark):
2324         (Animator.prototype.animate): Refactor to use the cached option, to remove its dependency on
2325         the options dictionary.
2326         (Benchmark): Require all benchmarks to have a stage and animator. The instance will initialize
2327         them.
2328         (Benchmark.prototype.get options):
2329         (Benchmark.prototype.get stage): BenchmarkStates.stages will need to be renamed to avoid confusion.
2330         (Benchmark.prototype.get animator):
2331         (Benchmark.prototype.start):
2332         (Benchmark.prototype.update): Ask the stage directly to tune or clear instead of adding another
2333         level of indirection.
2334         (window.runBenchmark): Deleted. Remove the need for a benchmarkClient. Also remove the standalone
2335         path, since tests can be individually selected, and remove the need for runBenchmark since that is
2336         handled in BenchmarkRunner._runBenchmarkAndRecordResults.
2337         * Animometer/tests/resources/stage.js:
2338         (Stage): Deleted. Moved to main.js.
2339         (StageBenchmark): What's left is updating the progress bar; to be removed.
2340         (StageAnimator): What's left can be folded in Animator.
2341
2342         Refactor master suite.
2343         * Animometer/tests/master/resources/canvas-stage.js: This now only has SimpleCanvasStage.
2344         (animate): Push the clearRect() into each stage.
2345         (complexity):
2346         (StageBenchmark.call.createAnimator): Deleted.
2347         (StageBenchmark.call): Deleted.
2348         * Animometer/tests/master/resources/canvas-tests.js: SimpleCanvasPathStrokeStage is no longer needed.
2349         (CanvasLineSegment.prototype.draw):
2350         (CanvasArc):
2351         (CanvasLinePoint): Remove the draw call because depending on its index it either needs to be moveTo
2352         or lineTo, and it is otherwise a very small draw operation that doesn't need the overhead of the
2353         function call. Do all of the drawing through the stage.
2354
2355         Refactor the subclass pattern. Introduce Utilities.createSubclass().
2356
2357         * Animometer/resources/debug-runner/benchmark-runner.js:
2358         * Animometer/resources/extensions.js:
2359         (window.Utilities.createSubclass): Takes the super class, a function representing
2360         the class's constructor, and additional methods to attach to the new class's
2361         prototype object.
2362         * Animometer/tests/text/text-boxes.html: Remove unneeded reference to utilities.js.
2363
2364         Refactor tests.
2365         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
2366         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
2367         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
2368         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
2369         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2370         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2371         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
2372         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
2373         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2374         * Animometer/tests/examples/resources/canvas-electrons.js:
2375         * Animometer/tests/examples/resources/canvas-stars.js:
2376         * Animometer/tests/master/resources/canvas-stage.js:
2377         * Animometer/tests/master/resources/canvas-tests.js:
2378         * Animometer/tests/misc/resources/compositing-transforms.js:
2379         * Animometer/tests/resources/stage.js:
2380         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2381         * Animometer/tests/simple/resources/simple-canvas.js:
2382         * Animometer/tests/template/resources/template-canvas.js:
2383         * Animometer/tests/template/resources/template-css.js:
2384         * Animometer/tests/template/resources/template-svg.js:
2385         * Animometer/tests/text/resources/layering-text.js: Reorder some of the methods
2386         and properties since they rely on each other.
2387         * Animometer/tests/text/resources/text-boxes.js:
2388
2389         * Animometer/resources/debug-runner/animometer.js: Arrange calls
2390         in the order they are evoked.
2391         * Animometer/resources/debug-runner/benchmark-runner.js:
2392         (BenchmarkRunnerState.prototype.next): Get rid of return value since
2393         no caller to next() uses it.
2394         (BenchmarkRunnerState.prototype.prepareCurrentTest): Refactor the
2395         promise to resolve simply when onload() is called instead of
2396         looking for #stage.
2397         (BenchmarkRunner.prototype._runTestAndRecordResults): Suite.run
2398         simply calls runBenchmark(). Call it directly rather than through
2399         the Suite.
2400         (BenchmarkRunner.prototype.step): Remove unused parameter in
2401         resolve callback.
2402         (BenchmarkRunner.prototype.runMultipleIterations): Use this instead
2403         of self since it is outside of the closure which needed the self
2404         variable.
2405         (resolveIfReady): Deleted.
2406         (BenchmarkRunner.prototype.waitForElement): Deleted.
2407         * Animometer/resources/runner/tests.js: prepare() and run() are
2408         no longer needed.
2409         (Suite.prototype.prepare): Deleted.
2410         (Suite.prototype.run): Deleted.
2411         * Animometer/tests/master/canvas-stage.html: Move all scripts to
2412         the end of the page.
2413
2414 2015-12-23  Simon Fraser  <simon.fraser@apple.com>
2415
2416         Add an Animometer developer test which animates text-rich boxes
2417         https://bugs.webkit.org/show_bug.cgi?id=152544
2418
2419         Reviewed by Zalan Bujtas.
2420
2421         Add a test that draws lots of international text. This is a particle test,
2422         moving the boxes around with absolution positioning.
2423
2424         * Animometer/resources/debug-runner/tests.js:
2425         * Animometer/tests/text/resources/text-boxes.js: Added.
2426         (BouncingTextBox):
2427         (BouncingTextBox.prototype._move):
2428         (BouncingTextBox.prototype.animate):
2429         (BouncingTextBoxStage):
2430         (BouncingTextBoxStage.prototype.createParticle):
2431         (BouncingTextBoxStage.prototype.particleWillBeRemoved):
2432         (BouncingTextBoxsBenchmark):
2433         (BouncingTextBoxsBenchmark.prototype.createStage):
2434         (window.benchmarkClient.create):
2435         * Animometer/tests/text/text-boxes.html: Added.
2436
2437 2015-12-23  Jon Lee  <jonlee@apple.com>
2438
2439         Split benchmark into two different pages
2440         https://bugs.webkit.org/show_bug.cgi?id=152458
2441
2442         Reviewed by Simon Fraser.
2443
2444         Add tests to 'animometer' suite.
2445
2446         * Animometer/resources/runner/tests.js:
2447         * Animometer/tests/master/canvas-stage.html: Added.
2448         * Animometer/tests/master/resources/canvas-stage.js: Added.
2449         * Animometer/tests/master/resources/canvas-tests.js: Added.
2450         * Animometer/tests/master/resources/stage.css: Added.
2451
2452 2015-12-23  Jon Lee  <jonlee@apple.com>
2453
2454         Split benchmark into two different pages
2455         https://bugs.webkit.org/show_bug.cgi?id=152458
2456
2457         Reviewed by Simon Fraser.
2458
2459         Address comments.
2460
2461         * Animometer/resources/debug-runner/benchmark-runner.js:
2462         (BenchmarkRunner.prototype._runTestAndRecordResults): When the testing is complete the frame owning the
2463         sampler goes away, and a later call to get the JSON data is no longer available. Process the data
2464         right here, instead, and just reference it when displaying the results in ResultsDashboard.prototype._processData.
2465         * Animometer/resources/extensions.js:
2466         (Array.prototype.fill.Array.prototype.fill): Add a null check. Remove braces around single-line clause.
2467         (Array.prototype.find.Array.prototype.find): Update the null check.
2468         (ResultsDashboard.prototype._processData): Use the already-processed data.
2469         * Animometer/resources/runner/animometer.css:
2470         (.frame-container > iframe): Remove calc().
2471
2472         Move Array functions to extensions.js since that is included by the harness.
2473         Add ES6 Array polyfills.
2474
2475         * Animometer/resources/algorithm.js:
2476         (Array.prototype.swap): Moved to extensions.js.
2477         * Animometer/resources/extensions.js:
2478         (Array.prototype.swap):
2479         (Array.prototype.fill): Added.
2480         (Array.prototype.find): Added.
2481
2482         Adjust styles for iPad.
2483
2484         * Animometer/resources/runner/animometer.css:
2485         (@media screen and (min-device-width: 768px)): Apply to iPad as well.
2486         (@media screen and (max-device-width: 1024px)): Update width for iPads.
2487
2488         Adjustment styles for iOS.
2489
2490         * Animometer/developer.html: Different divs contain the iframe, so use a class instead and
2491         update the style rules.
2492         * Animometer/index.html:
2493         * Animometer/resources/debug-runner/animometer.css: Remove extraneous rules.
2494         (@media screen and (min-device-width: 1800px)): Move this up.
2495         * Animometer/resources/runner/animometer.css: Add rules to accomodate iOS.
2496
2497         Get rid of prefixed flex properties for now.
2498
2499         * Animometer/resources/debug-runner/animometer.css:
2500         * Animometer/resources/runner/animometer.css:
2501
2502         Update the structure of the harness. Remove the JSON-per-test but keep
2503         the JSON of the whole test run. Use the full page in order to display
2504         the graph.
2505
2506         * Animometer/developer.html: Update several of the JS file includes to UTF-8. Remove header and footer. Test results screen includes score,
2507         average, and worst 5% statistics.
2508         * Animometer/index.html: Make structure similar to developer.html.
2509         * Animometer/resources/debug-runner/animometer.css: Remove most of the
2510         button rules since they are superfluous. Move the progress bar to the
2511         top, fixed. Update the results page rules.
2512         * Animometer/resources/debug-runner/animometer.js: Remove most of the
2513         additions to sectionsManager since they are no longer needed.
2514         (setSectionHeader): Updates header of the section.
2515         (window.suitesManager._updateStartButtonState): Update selector.
2516         (showResults): Add keypress event for selecting different data for
2517         copy/paste. Update how the results are populated. Include full test
2518         JSON in a textarea, rather than requiring a button press.
2519         (showTestGraph):
2520         * Animometer/resources/debug-runner/tests.js: Update structure of Headers. Define different kinds of headers. Headers can control their
2521         title, and the text used as the cell contents, including class name.
2522         * Animometer/resources/extensions.js:
2523         (ResultsTable): Update to include a flattened version of the headers,
2524         used while populating table contents. Remove unneeded helper functions
2525         for creating the table. Rename "show" to "add".
2526         * Animometer/resources/runner/animometer.css: Update rules to
2527         accommodate the new structure.
2528         * Animometer/resources/runner/animometer.js:
2529         (window.sectionsManager.setSectionScore): Helper function to set the
2530         score and mean for a section.
2531         (window.sectionsManager.populateTable): Helper function to set the table.
2532         (window.benchmarkController.showResults): Refactor.
2533         (window.benchmarkController.selectResults): Update selectors.
2534         * Animometer/resources/runner/tests.js: Set Headers. Debug harness
2535         extends it.
2536
2537         Update debug runner to have similar names to the basic runner. Include
2538         that page's CSS and remove extraneous CSS rules.
2539
2540         Get rid of the statistics table #record.
2541
2542         * Animometer/developer.html: Rename #home to #intro. Rename .spacer to hr.
2543         * Animometer/resources/debug-runner/animometer.css: Set to flexbox when selected.
2544         * Animometer/resources/debug-runner/animometer.js: Remove recordTable.
2545         (window.suitesManager._updateStartButtonState): Update selector to #intro.
2546         (setupRunningSectionStyle): Deleted.
2547
2548         * Animometer/resources/runner/animometer.css:
2549         (#test-container.selected): Change to flex-box only when visible.
2550
2551         Remove recordTable.
2552         * Animometer/resources/debug-runner/benchmark-runner.js:
2553         (BenchmarkRunner.prototype._runTestAndRecordResults):
2554         * Animometer/resources/runner/tests.js:
2555         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
2556         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
2557         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
2558         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
2559         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2560         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2561         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
2562         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2563         * Animometer/tests/examples/resources/canvas-electrons.js:
2564         * Animometer/tests/examples/resources/canvas-stars.js:
2565         * Animometer/tests/misc/resources/compositing-transforms.js:
2566         * Animometer/tests/resources/main.js:
2567         * Animometer/tests/resources/stage.js:
2568         (StageBenchmark): Remove _recordTable.
2569         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2570         * Animometer/tests/simple/resources/simple-canvas.js:
2571         * Animometer/tests/template/resources/template-canvas.js:
2572         * Animometer/tests/template/resources/template-css.js:
2573         * Animometer/tests/template/resources/template-svg.js:
2574         * Animometer/tests/text/resources/layering-text.js:
2575
2576         * Animometer/resources/debug-runner/animometer.js:
2577         (willStartFirstIteration): Fix selector, since results-table is used
2578         in multiple places, so it cannot be an id.
2579
2580         Make it possible to select the scores, or the whole table data,
2581         by cycling through different selections through key press of 's'.
2582
2583         * Animometer/resources/runner/animometer.js:
2584         (window.benchmarkController.showResults): Attach a keypress handler
2585         if it hasn't been added already.
2586         (window.benchmarkController.selectResults):
2587         * Animometer/resources/runner/tests.js: Cycle through different
2588         ranges.
2589
2590         Fix a few fly-by errors.
2591
2592         * Animometer/resources/debug-runner/benchmark-runner.js:
2593         (BenchmarkRunnerState.prototype.prepareCurrentTest): Update the frame relative path
2594         since the files are now in the top directory instead of inside runner/.
2595         (BenchmarkRunner.prototype._runTestAndRecordResults): Incorrect reference to function.
2596         (BenchmarkRunner.prototype.step): Member variable is never used.
2597
2598         A little stylistic cleanup.
2599
2600         * Animometer/resources/debug-runner/benchmark-runner.js:
2601         * Animometer/resources/extensions.js:
2602         (window.DocumentExtension.createElement):
2603         * Animometer/tests/resources/main.js:
2604         (Benchmark.prototype.record):
2605         * Animometer/tests/resources/stage.js:
2606         (StageBenchmark.prototype.showResults): Reverse progress and message.
2607         The message appears less frequently than the progress.
2608         * Animometer/tests/simple/resources/simple-canvas.js:
2609         (SimpleCanvasBenchmark): Remove unused options.
2610
2611         Add newer version of harness in a new page. Consolidate differences between the two
2612         pages.
2613
2614         * Animometer/developer.html: Include runner/animometer.js. Rename the JS function
2615         to run the benchmark to startBenchmark() instead of startTest(). Rename #running to
2616         #test-container.
2617         * Animometer/index.html: Added. Similarly calls startBenchmark() and has #test-container.
2618         * Animometer/resources/debug-runner/animometer.css: Make the canvas 2:1 (1200px x 800px)
2619         instead of 4:3.
2620
2621         Split out benchmarkRunnerClient and benchmarkController.
2622
2623         * Animometer/resources/debug-runner/animometer.js: Move needed functions out of
2624         benchmarkRunnerClient, and leave the rest here to extend that object. Get rid of _resultsTable
2625         and move populating the results table into benchmarkController. Rename _resultsDashboard
2626         to results and make it accessible for other objects to use.
2627         (willAddTestFrame): This is unnecessary. Remove.
2628
2629         (window.sectionsManager.showScore): Grab it from the results object instead of
2630         benchmarkRunnerClient.
2631         (window.sectionsManager.showSection): Deleted. Moved to runner/animometer.js.
2632
2633         (window.benchmarkController._runBenchmark): Deleted. Mostly moved into _startBenchmark.
2634         (window.benchmarkController.startBenchmark): Refactor to call _startBenchmark.
2635         (window.benchmarkController.showResults): Include most of benchmarkRunnerClient.didFinishLastIteration()
2636         here.
2637
2638         * Animometer/resources/debug-runner/benchmark-runner.js:
2639         (BenchmarkRunner.prototype._appendFrame): Remove unneeded call to willAddTestFrame.
2640         * Animometer/resources/extensions.js:
2641         (ResultsDashboard): Change the class to process the sampler data on-demand and hold onto that data
2642         for later referencing.
2643         (ResultsDashboard.prototype.toJSON): Deleted.
2644         (ResultsDashboard.prototype._processData): Rename toJSON to _processData since it's not really
2645         outputting JSON. Store the processed data into a member variable that can be referenced later.
2646         (ResultsDashboard.prototype.get data): Process the data if it hasn't already.
2647         (ResultsDashboard.prototype.get score): Process the data if it hasn't already, then return the
2648         aggregate score.
2649         (ResultsTable.prototype._showHeader): When outputting the results to a table, don't force the
2650         need for an empty children array. This was to allow for a header row in the table that spanned
2651         multiple columns. In the simpler harness, this is not needed.
2652         (ResultsTable.prototype._showEmptyCells):
2653         (ResultsTable.prototype._showTest): This hardcoded the columns. At least for the name and score,
2654         which is the bare minimum needed for the simpler harness, key off of the header name provided.
2655         * Animometer/resources/runner/animometer.css: Added. Use a similar 2:1 ratio. The score tables are
2656         split into the data and the headers, and are also displayed RTL so that a later patch allows a
2657         user to copy-paste the data easily.
2658         * Animometer/resources/runner/animometer.js: Added. Use a simpler version of benchmarkRunnerClient.
2659         The debug harness will extend these classes.
2660         (window.benchmarkController._startBenchmark): Used by both harnesses.
2661         (window.benchmarkController.startBenchmark): Set hard-coded options.
2662         (window.benchmarkController.showResults): Includes most of benchmarkRunnerClient.didFinishLastIteration()
2663         here.
2664
2665         Get rid of utilities.js. Move it all into extensions.js.
2666
2667         * Animometer/resources/extensions.js:
2668         * Animometer/tests/resources/utilities.js: Removed.
2669
2670         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Remove script link.
2671         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Ditto.
2672         * Animometer/tests/bouncing-particles/bouncing-css-images.html: Ditto.
2673         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: Ditto.
2674         * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Ditto.
2675         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto.
2676         * Animometer/tests/examples/canvas-electrons.html: Ditto.
2677         * Animometer/tests/examples/canvas-stars.html: Ditto.
2678         * Animometer/tests/misc/compositing-transforms.html: Ditto.
2679         * Animometer/tests/simple/simple-canvas-paths.html: Ditto.
2680         * Animometer/tests/template/template-canvas.html: Ditto.
2681         * Animometer/tests/template/template-css.html: Ditto.
2682         * Animometer/tests/template/template-svg.html: Ditto.
2683         * Animometer/tests/text/layering-text.html: Ditto.
2684
2685         Split tests.js into two. Add a new suite to runner/tests.js.
2686
2687         * Animometer/developer.html: Update the script order. Scripts from
2688         debug-runner/ will always build on those from runner/, and have the
2689         same name.
2690         * Animometer/resources/debug-runner/tests.js: Move "complex examples"
2691         suite into "miscellaneous tests".
2692         (Suite): Deleted.
2693         (Suite.prototype.prepare): Deleted.
2694         (Suite.prototype.run): Deleted.
2695         (suiteFromName): Deleted.
2696         * Animometer/resources/runner/tests.js: Added. Take definitions and
2697         functions needed by the test harness. Leave the test suites behind.
2698         (Suite): Moved from debug script.
2699         (Suite.prototype.prepare): Ditto.
2700         (Suite.prototype.run): Ditto.
2701         (suiteFromName): Ditto.
2702         (testFromName): Ditto.
2703
2704         Move benchmark resources out into resources/debug-runner, and update URLs.
2705
2706         * Animometer/developer.html: Renamed from PerformanceTests/Animometer/runner/animometer.html.
2707         * Animometer/resources/debug-runner/animometer.css: Renamed from PerformanceTests/Animometer/runner/resources/animometer.css.
2708         * Animometer/resources/debug-runner/animometer.js: Renamed from PerformanceTests/Animometer/runner/resources/animometer.js.
2709         * Animometer/resources/debug-runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/runner/resources/benchmark-runner.js.
2710         * Animometer/resources/debug-runner/d3.min.js: Renamed from PerformanceTests/Animometer/runner/resources/d3.min.js.
2711         * Animometer/resources/debug-runner/graph.js: Renamed from PerformanceTests/Animometer/runner/resources/graph.js.
2712         * Animometer/resources/debug-runner/tests.js: Renamed from PerformanceTests/Animometer/runner/resources/tests.js.
2713
2714 2015-12-11  Jon Lee  <jonlee@apple.com>
2715
2716         Improve Animometer on iOS
2717         https://bugs.webkit.org/show_bug.cgi?id=152180
2718
2719         Reviewed by Simon Fraser.
2720
2721         Improve experience on phones. Make the canvas take
2722         up the whole screen.
2723
2724         * Animometer/runner/animometer.html: Add meta viewport.
2725         Remove the container div.
2726         * Animometer/runner/resources/animometer.css: Have buttons lay
2727         out vertically. Update detail arrow glyph. Make the suites and
2728         options section lay out vertically. Remove the top spacers since
2729         we want the canvas to take over the whole screen. Minimal display
2730         is recommended for use.
2731
2732 2015-12-07  Jon Lee  <jonlee@apple.com>
2733
2734         Update suites for benchmark
2735         https://bugs.webkit.org/show_bug.cgi?id=151957
2736
2737         Reviewed by Simon Fraser.
2738
2739         * Animometer/runner/animometer.html: Use spacers instead of relying on
2740         justify-content center to center the content. That allows the opening screen
2741         to grow downward when expanding the list of choices, otherwise it expands
2742         from the center, and off the top edge of the screen.
2743         * Animometer/runner/resources/animometer.css:
2744         (.tree): Don't overflow scroll.
2745         (.tree > li > label.tree-label:before): Use better glyphs.
2746         (.tree > li > :checked ~ label.tree-label:before):
2747         (main): Using flex-start for justify-content so that if the section grows too
2748         big it gets pinned to the top edge of the document instead of growing past it.
2749         (.spacer): Make the spacers have a minimum 20px and grow evenly.
2750         (section#home): Add a min-height so that the border will expand if the suite
2751         tests shown make the section grow past the height.
2752         * Animometer/runner/resources/animometer.js: Update the selectors.
2753         (window.suitesManager._treeElement):
2754         (window.suitesManager._suitesElements):
2755         (window.suitesManager._editsElements):
2756
2757 2015-12-07  Jon Lee  <jonlee@apple.com>
2758
2759         Update options for benchmark
2760         https://bugs.webkit.org/show_bug.cgi?id=151956
2761
2762         Reviewed by Simon Fraser.
2763
2764         Move "Fix test complexity" and "Adaptive" checkboxes into a radio group.
2765
2766         Move "Show running results" into a radio group, and add options to remove the HUD.
2767
2768         * Animometer/runner/animometer.html: Get rid of the preamble. Wrap the options
2769         in a form for easier referencing in JS.
2770         * Animometer/runner/resources/animometer.css: Show the surrounding border if the
2771         body's display-minimal class name is set.
2772         * Animometer/runner/resources/animometer.js:
2773
2774         Update the way optionsManager gets and sets default values. Include support for
2775         radio groups.
2776         (window.optionsManager.valueForOption):
2777         (window.optionsManager.updateUIFromLocalStorage):
2778         (window.optionsManager.updateLocalStorageFromUI):
2779
2780         (window.benchmarkRunnerClient.willStartFirstIteration):
2781         (window.sectionsManager.setupRunningSectionStyle):
2782         (window.suitesManager._treeElement): Fly-by whitespace fix.
2783         (window.suitesManager._suitesElements): Ditto.
2784         (window.suitesManager.updateEditsElementsState): Update options check.
2785         (window.suitesManager.updateDisplay): Add a new update function for the HUD.
2786         Attach a class to the body depending on the user's choice.
2787         (window.benchmarkController.initialize): Add an event listener when the form
2788         radio buttons update.
2789         (window.benchmarkController.onFormChanged):
2790         (window.optionsManager._optionsElements): Deleted.
2791         (window.optionsManager._adaptiveTestElement): Deleted.
2792         (window.benchmarkController.onChangeAdaptiveTestCheckbox): Deleted.
2793         * Animometer/tests/resources/main.js:
2794         (Benchmark.prototype.update): Update options checks.
2795         * Animometer/tests/resources/stage.js: Update option check.
2796         (StageBenchmark.prototype.showResults):
2797
2798 2015-12-01  Simon Fraser  <simon.fraser@apple.com>
2799
2800         Add a basic compositing Animometer test
2801         https://bugs.webkit.org/show_bug.cgi?id=151724
2802
2803         Reviewed by Dean Jackson.
2804
2805         Add a "bouncing particles" test that moves composited layers around, optionally with a filter.
2806
2807         This is added under a new "Miscellaneous" category.
2808
2809         Remove the test templates category from the UI.
2810
2811         * Animometer/runner/resources/tests.js:
2812         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2813         (BouncingCssShape.prototype.animate):
2814         * Animometer/tests/misc/compositing-transforms.html: Added.
2815         * Animometer/tests/misc/resources/compositing-transforms.js: Added.
2816         (BouncingCompositedImage):
2817         (BouncingCompositedImage.prototype._move):
2818         (BouncingCompositedImage.prototype.animate):
2819         (CompositingTransformsStage):
2820         (CompositingTransformsStage.prototype.createParticle):
2821         (CompositingTransformsStage.prototype.particleWillBeRemoved):
2822         (CompositedTransformsBenchmark):
2823         (CompositedTransformsBenchmark.prototype.createStage):
2824         (window.benchmarkClient.create):
2825
2826 2015-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
2827
2828         Fix the graphics benchmark complexity bounds adjustment
2829         https://bugs.webkit.org/show_bug.cgi?id=151670
2830
2831         Reviewed by Simon Fraser.
2832
2833         Make sure the graphics benchmark complexity bounds adjustment is applied
2834         to the absolute lower bound.
2835
2836         * Animometer/tests/resources/math.js:
2837         (PIDController.prototype._saturate):
2838
2839 2015-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
2840
2841         Add an option to select the results form the graphics benchmark
2842         https://bugs.webkit.org/show_bug.cgi?id=151666
2843
2844         Reviewed by Ryosuke Niwa.
2845
2846         We need an easy way to select the graphics benchmark results table such
2847         that when it is copied to the clipboard, rich text format is set to the
2848         clipboard.
2849
2850         * Animometer/runner/animometer.html: Add a new button to select the results table or JSON.
2851
2852         * Animometer/runner/resources/animometer.js:
2853         (window.sectionsManager._sectionDataElement): Selects the container <data> element.
2854         (window.sectionsManager._sectionDataDivElement): Replace a literal string with a string table entry.
2855         (window.sectionsManager.showTestName): Replace a literal string with a string table entry.
2856         (window.sectionsManager.selectData): Selects the container <data> element in a selection.
2857         (window.sectionsManager.selectDataContents): Select the contents of container <data> element in a selection.
2858         (window.benchmarkController.selectResults): Selects the results table.
2859         (window.benchmarkController.showJSON): Function rename.
2860         (window.benchmarkController.selectJSON): Selects the contents of the results JSON.
2861         (window.benchmarkController.showJson): Deleted.
2862
2863 2015-11-20  Simon Fraser  <simon.fraser@apple.com>
2864
2865         Animometer: graphs should not do interpolation
2866         https://bugs.webkit.org/show_bug.cgi?id=151526
2867
2868         Reviewed by Simon Fraser.
2869
2870         Having the graphs do interpolation is misleading, because you can't see the actual data.
2871
2872         Also remove "shape-rendering: crispEdges;" so the lines get antialiased.
2873
2874         * Animometer/runner/resources/animometer.css:
2875         (section#test-graph > data > svg): Deleted.
2876         * Animometer/runner/resources/graph.js:
2877         (graph): Deleted.
2878
2879 2015-11-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
2880
2881         Calculate the graphics benchmark test gain adaptively
2882         https://bugs.webkit.org/show_bug.cgi?id=151208
2883
2884         Reviewed by Darin Adler.
2885
2886         We need to calculate the gain of the graphics benchmark tests adaptively
2887         and get rid of the gain and limits parameters we have to choose manually
2888         for every test. We are going to use the classic Ziegler–Nichols method for
2889         calculating the gain and integral and derivative times. We are going to
2890         try moving on a cubic curve during the manual stage from y0 to reach ysp.
2891         We also going to use a saturation actuator to ensure the system does not
2892         fluctuate.
2893
2894         * Animometer/resources/extensions.js:
2895         (ResultsTable.prototype._isNoisyMeasurement): Fix a parameter name.
2896         (ResultsTable.prototype._isNoisyTest): Since score is a member of testResults, we need to limit our search to frame rate and complexity.
2897         (ResultsTable.prototype._showTest): Pass the correct parameter to _isNoisyMeasurement().
2898
2899         * Animometer/resources/strings.js: Fix the indentation and name and value of a string.
2900
2901         * Animometer/runner/resources/tests.js: Remove all the manual gains and limits parameters which had to be passed to every test.
2902
2903         * Animometer/tests/resources/main.js:
2904         (BenchmarkState.prototype.currentStage): Fix an enum name.
2905         (Benchmark): Get rid of manual gain and limits.
2906         (Benchmark.prototype.update): Simplify the calculation by having all the times in ms.
2907
2908         * Animometer/tests/resources/math.js:
2909         (PIDController): Get rid of the manual gain and limits and the magic numbers for Ti and Td.
2910         (PIDController.prototype._yPosition): Tells whether the test current output is moving towards the set-point or away from it.
2911         (PIDController.prototype._distanceUltimate): Calculates the ultimate distance from y0 after time t using a cubic formula.
2912         (PIDController.prototype._distance): Calculates the distance of y relative to y0.
2913         (PIDController.prototype._gainIncrement): Decides how much the proportional gain should be increased during the manual gain stage.
2914         (PIDController.prototype._updateStage): Updates the stage of the controller based on its current stage and the system output.
2915         (PIDController.prototype._tuneP): Tunes the system before calculating the PID controller gains.
2916         (PIDController.prototype._tunePID): PID tuning function.
2917         (PIDController.prototype._tune):
2918         (PIDController.prototype._saturate):
2919         (PIDController.prototype.tune): Manages calculating the controller parameters. It then returns a PID tuning value.
2920         (PIDController.prototype._sat): Deleted. We may need to return it back but the limits have to be calculated adaptively not manually.
2921
2922 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
2923
2924         Reorganize the graphics benchmark string table
2925         https://bugs.webkit.org/show_bug.cgi?id=151334
2926
2927         Reviewed by Simon Fraser.
2928
2929         Make the graphics benchmark string table be an object of sub-objects. Each
2930         sub-object represents an associative array, the key is the string name and
2931         the value is the string data.
2932
2933         * Animometer/resources/extensions.js:
2934         (ResultsDashboard.prototype.toJSON):
2935         (ResultsTable.prototype._showGraph):
2936         (ResultsTable.prototype._showJSON):
2937         (ResultsTable.prototype._isNoisyMeasurement):
2938         (ResultsTable.prototype._isNoisyTest):
2939         (ResultsTable.prototype._showTest):
2940         (ResultsTable.prototype._showSuite):
2941         (ResultsTable.prototype._showIteration):
2942         * Animometer/resources/sampler.js:
2943         (Sampler.prototype.toJSON):
2944         * Animometer/resources/strings.js:
2945         * Animometer/runner/resources/animometer.js:
2946         (window.benchmarkRunnerClient.didFinishLastIteration):
2947         (window.suitesManager.updateLocalStorageFromJSON):
2948         (window.benchmarkController.showResults):
2949         (window.benchmarkController.showJson):
2950         (window.benchmarkController.showTestGraph):
2951         (window.benchmarkController.showTestJSON):
2952         * Animometer/runner/resources/tests.js:
2953         * Animometer/tests/resources/main.js:
2954
2955 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
2956
2957         Disable flattening the stage iframe of the graphics benchmark when running on iOS
2958         https://bugs.webkit.org/show_bug.cgi?id=151361
2959
2960         Reviewed by Simon Fraser.
2961
2962         Use fixed size for stage iframe of the graphics benchmark to disable
2963         flattening the iframe while animating the particles. Also ensure the
2964         bouncing particles do not go outside the iframe's boundaries.
2965
2966         * Animometer/runner/resources/animometer.css:
2967         (section#running > #running-test > iframe):
2968         (@media screen and (min-device-width: 1800px)):
2969         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2970         (BouncingParticle.prototype.animate):
2971
2972 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
2973
2974         Use the media queries to dynamically set the stage for the graphics benchmark
2975         https://bugs.webkit.org/show_bug.cgi?id=151327
2976
2977         Reviewed by Simon Fraser.
2978
2979         Clean setting the benchmark css rules by using the media queries. Accessing
2980         document.stylesheets.cssRules seems to be unreliable. Fix the test harness
2981         load event listener invocation. And also remove the options for normalizing
2982         the stage resolution for retina display.
2983
2984         * Animometer/resources/extensions.js:
2985         (window.DocumentExtension.insertCssRuleAfter): Deleted.
2986         * Animometer/runner/animometer.html:
2987         * Animometer/runner/resources/animometer.css:
2988         (@media screen and (min-device-width: 1800px)):
2989         * Animometer/runner/resources/animometer.js:
2990         (window.sectionsManager.setupRunningSectionStyle):
2991         (window.benchmarkController.initialize):
2992         (window.sectionsManager.setupSectionStyle): Deleted.
2993         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2994         (BouncingParticlesStage):
2995         * Animometer/tests/text/layering-text.html:
2996         * Animometer/tests/text/resources/layering-text.js:
2997         (LayeringTextStage):
2998         (LayeringTextStage.prototype._setFontSize): Deleted.
2999
3000 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
3001
3002         Remove the option for animating using setInterval from the graphics benchmark
3003         https://bugs.webkit.org/show_bug.cgi?id=151283
3004
3005         Reviewed by Darin Adler.
3006
3007         Get rid of the option to run animation using setInterval().
3008
3009         * Animometer/tests/resources/main.js:
3010         (Animator.prototype.animate):
3011         (Benchmark):
3012         (Benchmark.prototype.start):
3013         (Animator.prototype.start): Deleted.
3014
3015 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
3016
3017         Highlight the alarming test results in the graphics benchmark results page
3018         https://bugs.webkit.org/show_bug.cgi?id=151286
3019
3020         Reviewed by Simon Fraser.
3021
3022         When showing the results of a test in the graphics benchmark the following
3023         criteria is going to be applied:
3024
3025         1. If the standard deviation of the test complexity or the frame rate is
3026            equal to or more than 10%, the standard deviation and the test name
3027            will be displayed in red.
3028         2. If the average frame rate is not in the range = [(desired_frame_rate - 2)
3029            .. (desired_frame_rate + 2)], the average frame rate and the test name will
3030            be displayed in red.
3031
3032         * Animometer/resources/extensions.js:
3033         (ResultsTable.prototype._showHeaderRow):
3034         (ResultsTable.prototype._showHeader):
3035         (ResultsTable.prototype._showEmptyCell):
3036         (ResultsTable.prototype._showText):
3037         (ResultsTable.prototype._showFixedNumber):
3038         (ResultsTable.prototype.):
3039         (ResultsTable.prototype._showGraph):
3040         (ResultsTable.prototype._showJSON):
3041         (ResultsTable.prototype._isAlarmingMeasurement):
3042         (ResultsTable.prototype._isAlarmingTestResults):
3043         (ResultsTable.prototype._showEmptyCells):
3044         (ResultsTable.prototype._showEmptyRow):
3045         (ResultsTable.prototype._showTest):
3046         (ResultsTable.prototype._showSuite):
3047         (ResultsTable.prototype._showIteration):
3048         (ResultsTable.prototype.showRecord):
3049         (ResultsTable.prototype.showIterations):
3050         (ResultsTable.prototype._showEmpty): Deleted.
3051         * Animometer/runner/resources/animometer.js:
3052         (window.benchmarkRunnerClient.didFinishLastIteration):
3053         * Animometer/tests/resources/stage.js:
3054         (StageBenchmark.prototype.showResults):
3055
3056 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
3057
3058         Clean referencing the options object in the graphics benchmark
3059         https://bugs.webkit.org/show_bug.cgi?id=151284
3060
3061         Reviewed by Simon Fraser.
3062
3063         Get rid of the Benchmark.options member and rely only on the private member
3064         Benchmark._options. The animator need to have its own options member instead
3065         of accessing it from its reference to Benchmark object.
3066
3067         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
3068         (BouncingCanvasParticlesAnimator):
3069         (BouncingCanvasParticlesBenchmark.prototype.createAnimator):
3070         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
3071         (BouncingParticle.prototype.animate):
3072         (BouncingParticlesAnimator):
3073         (BouncingParticlesBenchmark.prototype.createAnimator):
3074         * Animometer/tests/examples/resources/canvas-electrons.js:
3075         (CanvasElectronsStage.prototype.animate):
3076         (CanvasElectronsAnimator):
3077         (CanvasElectronsBenchmark.prototype.createAnimator):
3078         (window.benchmarkClient.create):
3079         * Animometer/tests/examples/resources/canvas-stars.js:
3080         (CanvasStarsStage.prototype.animate):
3081         (CanvasStarsAnimator):
3082         (CanvasStarsBenchmark.prototype.createAnimator):
3083         (window.benchmarkClient.create):
3084         * Animometer/tests/resources/main.js:
3085         (BenchmarkState.prototype.currentProgress):
3086         (Animator):
3087         (Animator.prototype.animate):
3088         (Benchmark):
3089         (Benchmark.prototype.update):
3090         * Animometer/tests/resources/stage.js:
3091         (Stage.prototype.clear):
3092         (StageAnimator):
3093         (StageBenchmark.prototype.createAnimator):
3094         (StageBenchmark.prototype.tune):
3095         (StageBenchmark.prototype.showResults):
3096         * Animometer/tests/simple/resources/simple-canvas.js:
3097         (SimpleCanvasStage.prototype.animate):
3098         (SimpleCanvasAnimator):
3099         (SimpleCanvasAnimator.prototype.animate):
3100         (SimpleCanvasBenchmark.prototype.createAnimator):
3101         * Animometer/tests/template/resources/template-canvas.js:
3102         (TemplateCanvasStage.prototype.animate):
3103         (TemplateCanvasBenchmark.prototype.createAnimator):
3104         (window.benchmarkClient.create):
3105
3106 2015-11-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
3107
3108         Eliminate a request for layout every time an item is added to the stage of the graphics benchmark
3109         https://bugs.webkit.org/show_bug.cgi?id=151289
3110
3111         Reviewed by Simon Fraser.
3112
3113         Cache the stage size when it is created instead of requesting every time
3114         an object is added via clientWidth and clientHeight.
3115
3116         * Animometer/resources/extensions.js:
3117         (Insets.elementPadding):
3118         * Animometer/tests/resources/stage.js:
3119         (Stage):
3120         (Stage.prototype.get size):
3121
3122 2015-11-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
3123
3124         Initialize the graphics benchmark's Kalman filter with estimated 60 FPS
3125         https://bugs.webkit.org/show_bug.cgi?id=150965
3126
3127         Reviewed by Darin Adler.
3128
3129         This should give the benchmark more accurate reading at warmup time. And
3130         hence we can safely reduce the test running time to be 10 seconds.
3131
3132         * Animometer/runner/animometer.html:
3133         Add "defer" back when loading resources/animometer.js since this script
3134         depends on many other scripts and we need to wait till the page is parsed.
3135         Also change the default test interval to be 10 seconds.
3136
3137         * Animometer/runner/resources/graph.js:
3138         (graph): Make the test results curves smoother.
3139
3140         * Animometer/tests/resources/main.js:
3141         (Animator): Initialize the Kalman filter with 60 FPS which should be true
3142         if the test page is empty.
3143
3144         (Animator.prototype.animate):
3145         * Animometer/tests/resources/math.js:
3146         (KalmanEstimator): Fix the initial value of _vecX_est.
3147             _vecX_est[0] = current FPS (= 60FPS when the test page is empty)
3148             _vecX_est[1] = first time derivative of FPS (=0; FPS has been constant).
3149             _vecX_est[2] = second time derivative of FPS (=0; since _vecX_est[1]=0).
3150         (KalmanEstimator.prototype.estimate): Add some comments.
3151
3152 2015-11-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
3153
3154         Remove "defer" from the scripts' references in the graphics benchmark home page
3155         https://bugs.webkit.org/show_bug.cgi?id=150915
3156
3157         Reviewed by Simon Fraser.
3158
3159         It causes the benchmark to be very flakey.
3160
3161         * Animometer/runner/animometer.html:
3162
3163 2015-11-01  Said Abou-Hallawa  <sabouhallawa@apple,com>
3164
3165         Add an option to make the graphics benchmark runs a specific test with fixed complexity
3166         https://bugs.webkit.org/show_bug.cgi?id=150529
3167
3168         Reviewed by Darin Adler.
3169
3170         Beside each test in the suites tree, we are going to show the complexity
3171         arithmetic mean of the of the last run in an edit control. Based on a
3172         new option these edit controls will all be visible or hidden. If they are
3173         visible their values can be changed. The benchmark runner if it run in
3174         the non-adaptive mode will set the complexity of the test to the passed
3175         value and will not change it ever. The animator will animate the test and
3176         frame rate will also be measured.
3177
3178         * Animometer/runner/animometer.html: Add a new option for the non-adaptive mode.
3179
3180         * Animometer/runner/resources/animometer.css:
3181         (section#home input[type="number"]): Define the width of all the edit control in the <home> section.
3182         (section#home > suites input[type="number"]): The edit controls in the <suites> box will be right aligned and hidden by default.
3183         (section#home > suites input[type="number"].selected): When the class "selected" is added, the edit controls will be visible.
3184         (section#home > options > label > input[type="number"]): Deleted.
3185
3186         * Animometer/runner/resources/animometer.js:
3187         (window.benchmarkRunnerClient.didFinishLastIteration): Update the local storage with the results of each test.
3188         (window.optionsManager._adaptiveTestElement): Returns the checkbox for setting the adaptive test option.
3189         (window.suitesManager._editElement):  Returns the edit element associated with each test element in the suites tree.
3190         (window.suitesManager._editsElements): Returns a list of all the elements in the <suites> box.
3191         (window.suitesManager._localStorageNameForTest): Change this function to take strings.
3192         (window.suitesManager._createTestElement): Adds an edit control beside each test.
3193         (window.suitesManager.updateEditsElementsState): Adds/Removes the 'selected' class to/from all the tests edit elements.
3194         (window.suitesManager.updateUIFromLocalStorage): Reads the edit control value from the local storage.
3195         (window.suitesManager.updateLocalStorageFromUI): Saves the edit control value to the local storage.
3196         (window.suitesManager.updateLocalStorageFromJSON): Saves the last run results to the local storage.
3197         (window.benchmarkController.initialize): Shows/Hides the test edit controls based on the adaptive test option.
3198         (window.benchmarkController.onChangeAdaptiveTestCheckbox): An onchange event handler for the adaptive test checkbox.
3199
3200         * Animometer/tests/resources/main.js:
3201         (Benchmark.prototype.update): Fix the complexity of the test if the running mode is non-adaptive test and desired complexity is not zero.
3202         (window.runBenchmark): Add the test complexity as a new benchmark option.
3203
3204 2015-11-01  Said Abou-Hallawa  <sabouhallawa@apple,com>
3205
3206         Make the size of the benchmark canvas adaptive to the screen size and screen resolution
3207         https://bugs.webkit.org/show_bug.cgi?id=150530
3208
3209         Reviewed by Darin Adler.
3210
3211         We want to set the size of the benchmark stage dynamically such that it
3212         depends on the screen resolution and the device scale factor. This patch
3213         does more than that because the home page css was not done properly. To
3214         use the flex box layout, the animometer.css has to be rewritten almost from
3215         scratch. The suites tree has to be rewritten also because it was not collapsing
3216         and with the flex box layout it was going outside of the window area. The
3217         options handling and the local storage handling had to be rewritten to
3218         allow more flexibility with this patch and the future patches. The code
3219         in animometer.js was reorganized into objects to allow distributing the code
3220         nicely among separate entities.
3221
3222         * Animometer/resources/extensions.js:
3223         (Point.elementClientSize): Returns the client size of an HTMLElement as a Point object.
3224         (Insets.prototype.get width): Follow the function opening brace style guidelines.
3225         (Insets.prototype.get height):
3226         (Insets.prototype.get size): Returns the size of an Insets as a Point object.
3227
3228         (window.DocumentExtension): Provides document helper functions. It should be assailable from the runner and the tests.
3229         (window.DocumentExtension.createElement): Creates an HTMLElement given its name, attributes and parentElement.
3230         (window.DocumentExtension.createSvgElement): Creates an SVGElement given its name, attributes and parentElement (moved from utilities.js).
3231         (window.DocumentExtension.insertCssRuleAfter): Inserts a CSS rule after an exiting rule given its text.
3232
3233         (ResultsTable.prototype._showHeader): Use DocumentExtension functions.
3234         (ResultsTable.prototype._showGraph): Use DocumentExtension functions and create a real button for "Graph..." option.
3235         (ResultsTable.prototype._showJSON): Use DocumentExtension functions and create a real button for "JSON..." option.
3236         (Options): Deleted.
3237
3238         * Animometer/runner/animometer.html: Restructure the page to use the flex box layout.
3239
3240         * Animometer/runner/resources/animometer.css:
3241         (html,body):
3242         (button):
3243
3244         (button.large-button):The large button appears in the animometer.html.
3245         (button.large-button:active):
3246         (button.large-button:disabled):
3247
3248         (button.small-button): The small button appears in the results table.
3249         (button.small-button:active):