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