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