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