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