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