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