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