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