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