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