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