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