2016-04-06 Jon Lee Update master benchmark with SVG test https://bugs.webkit.org/show_bug.cgi?id=156273 Reviewed by Dean Jackson. Provisionally reviewed by Said Abou-Hallawa. Switch masks tests for SVG path test. * Animometer/resources/debug-runner/tests.js: Move mask test here. * Animometer/resources/runner/tests.js: Add SVG test here. * Animometer/tests/dom/particles.html: Renamed from PerformanceTests/Animometer/tests/master/particles.html. * Animometer/tests/dom/resources/dom-particles.js: Renamed from PerformanceTests/Animometer/tests/master/resources/dom-particles.js. * Animometer/tests/master/resources/particles.js: Add minPosition for bounds checking. Prevents particle from being partially obscured. * Animometer/tests/master/resources/svg-particles.js: Added. (Particle): The particle is either a path object or a rect using a path as a clip. The same path is used either way. For each particle create a linear gradient with a random rotation. (SVGParticlesStage): Look in #shapes to see how many different kinds of paths are available. This makes the test more generic in case other shapes need to be tested. * Animometer/tests/master/svg-particles.html: Added. Have two defs, one that houses each particle's gradient, and one that holds the shape templates. 2016-03-27 Hunseop Jeong [EFL] REGRESSION(r188793): It made 200 layout tests and Bindings/event-target-wrapper.html performance test fail https://bugs.webkit.org/show_bug.cgi?id=148470 Reviewed by Darin Adler. * Skipped: Unskip the Bindings/event-target-wrapper test. 2016-03-23 Jon Lee Update focus and leaves tests https://bugs.webkit.org/show_bug.cgi?id=155825 Reviewed by Simon Fraser. Particles would improperly disappear, before they were fully off stage. Update the calculation. * Animometer/tests/dom/resources/leaves.js: * Animometer/tests/master/resources/leaves.js: * Animometer/tests/master/focus.html: Update the center element styling. * Animometer/tests/master/resources/focus.js: (FocusElement.Utilities.createClass): Give enough space in the container for each particle for the blur to spread. It should be about 3x more space than the blur radius on each side. (Stage.call.initialize): Ditto for the center element. 2016-03-23 Jon Lee Update support for other platforms https://bugs.webkit.org/show_bug.cgi?id=155824 Reviewed by Simon Fraser. * Animometer/resources/debug-runner/animometer.css: Remove extraneous media query. All of it should be handled in the release stylesheet. * Animometer/resources/debug-runner/animometer.js: Add support for browsers that return an HTMLCollection when retrieving radio elements with a name, instead of the selected value. * Animometer/resources/runner/animometer.css: Adjust the queries for devices of varying widths. (.frame-container): Move overflow:hidden to #stage. * Animometer/tests/master/resources/stage.css: Consolidate into tests/resources/stage.css. * Animometer/tests/resources/stage.css: (body): Remove overflow:hidden. (#stage): Set overflow:hidden here. (#center-text): Moved from master/resources/stage.css. Update stylesheet hrefs. * Animometer/tests/master/canvas-stage.html: * Animometer/tests/master/focus.html: * Animometer/tests/master/leaves.html: * Animometer/tests/master/multiply.html: * Animometer/tests/master/particles.html: * Animometer/tests/master/text.html: Adjust text size to fit in the device screen. 2016-03-23 Jon Lee Make the benchmark require device to be in landscape orientation https://bugs.webkit.org/show_bug.cgi?id=155822 rdar://problem/25258650 Reviewed by Ryosuke Niwa. Check that the device is in landscape orientation. If not, disable the button to start it, and show a warning message. * Animometer/developer.html: Add a message about how the browser should be set up. Include a warning message that appears if the orientation is incorrect on mobile devices. * Animometer/index.html: Ditto. * Animometer/resources/debug-runner/animometer.css: Migrate the .hidden rule into the release stylesheet. Update the style to accommodate the new UI. * Animometer/resources/runner/animometer.css: * Animometer/resources/runner/animometer.js: (window.benchmarkController.initialize): Add the orientation listener is needed. (window.benchmarkController.addOrientationListenerIfNecessary): Only mobile devices need this. Check to see for support of window.orientation. (window.benchmarkController._orientationChanged): Toggle the warning based on whether we match the landscape query. Set a state variable, which is needed for the debug harness. Call updateStartButtonState. (window.benchmarkController.updateStartButtonState): * Animometer/resources/debug-runner/animometer.js: Change _updateStartButtonState to return a boolean about whether at least one test is selected. That will be used in benchmarkController.updateStartButtonState(). Move the load event listener to the release version. (window.benchmarkController.updateStartButtonState): Override the release version, and also check that at least one test is selected. 2016-03-22 Geoffrey Garen MallocBench: consolidate regression testing for aligned allocation https://bugs.webkit.org/show_bug.cgi?id=155762 Reviewed by Michael Saboff. * MallocBench/MallocBench.xcodeproj/project.pbxproj: * MallocBench/MallocBench/Benchmark.cpp: * MallocBench/MallocBench/memalign.cpp: Removed. * MallocBench/MallocBench/memalign.h: Removed. The stress_aligned test covers this and much more. * MallocBench/MallocBench/stress_aligned.cpp: (benchmark_stress_aligned): Include specific tests for extreme sizes and alignments. 2016-03-21 Jon Lee Update benchmark tests https://bugs.webkit.org/show_bug.cgi?id=155723 Reviewed by Darin Adler. Provisionally reviewed by Said Abou-Hallawa. Add quadratic and bezier segments to the canvas path test. * Animometer/resources/runner/tests.js: Some of the query strings are unnecessary. Rename the test. * Animometer/tests/master/resources/canvas-stage.js: (tune): Update to be able to take an array of possible constructors. Choose one randomly. * Animometer/tests/master/resources/canvas-tests.js: (CanvasLinePoint.Utilities.createClass): Move the point selection out to a separate function called randomPoint() for reuse. Move X_LOOPS, Y_LOOPS, and offsets into the class definition. (randomPoint): Scale the grid down a little bit so that the lines along the edge of the canvas are not cut off when the stroke size is thick. (CanvasQuadraticSegment): Added. (CanvasBezierSegment): Added. (SimpleCanvasStage): Pass in an array of the different segment types. Since line segments are short compared to the curved ones, make it twice as likely to render a line segment. (SimpleCanvasStage.animate): Update the drawing code so that we render all line segments. Add a helper method that selects a random element from an array. * Animometer/tests/resources/main.js: (Stage.randomElementInArray): Select a random element from the provided array. * Animometer/tests/bouncing-particles/resources/bouncing-tagged-images.js: Refactor. * Animometer/tests/dom/resources/leaves.js: Ditto. * Animometer/tests/master/resources/dom-particles.js: Ditto. * Animometer/tests/master/resources/image-data.js: Ditto. * Animometer/tests/master/resources/leaves.js: Ditto. * Animometer/tests/simple/resources/simple-canvas-paths.js: Ditto. Add canvas tests that includes all stroke and fill paths. This makes it possible to avoid having to include the full simple canvas suite for perf testing. * Animometer/resources/debug-runner/tests.js: Add new tests. Move the canvas test into the Canvas suite. * Animometer/tests/simple/resources/simple-canvas-paths.js: Add a CanvasStroke and CanvasFill particle that random selects an object to render. * Animometer/resources/debug-runner/tests.js: Move 3D suite before basic canvas suite. When updating the perf bot script, we will include the suites up to this one, but exclude the basic canvas suite. Move compositing transforms test to HTML suite and remove the empty Miscellaneous suite. * Animometer/resources/debug-runner/tests.js: * Animometer/tests/dom/compositing-transforms.html: Renamed from PerformanceTests/Animometer/tests/misc/compositing-transforms.html. * Animometer/tests/dom/resources/compositing-transforms.js: Renamed from PerformanceTests/Animometer/tests/misc/resources/compositing-transforms.js. Clean up miscellaneous test suite. Add a canvas ellipse test, and remove the other canvas tests. * Animometer/resources/debug-runner/tests.js: Add ellipse tests to the simple suite. * Animometer/tests/misc/canvas-electrons.html: Removed. * Animometer/tests/misc/canvas-stars.html: Removed. * Animometer/tests/misc/resources/canvas-electrons.js: Removed. * Animometer/tests/misc/resources/canvas-stars.js: Removed. * Animometer/tests/simple/resources/simple-canvas-paths.js: Add ellipse primitives. Merge text tests together into one. * Animometer/resources/runner/tests.js: Remove international.html. * Animometer/tests/master/international.html: Removed. * Animometer/tests/master/resources/text.js: (animate): Update styling. Manually calculate gradients for the shadow particles. Reduce the step size for y direction to avoid cutting text off at the margins. Increase step for x since there will be a little more room. * Animometer/tests/master/text.html: Add more translations and lay it out in a table. 2016-03-20 Jon Lee Add a link to show debug data https://bugs.webkit.org/show_bug.cgi?id=155724 Reviewed by Simon Fraser. * Animometer/developer.html: Attach the onclick handler to the score. * Animometer/index.html: Ditto. 2016-03-18 Dean Jackson Add a basic WebGL test to Animometer https://bugs.webkit.org/show_bug.cgi?id=155475 Reviewed by Simon Fraser and Jon Lee. Add a pretty simple WebGL test to Animometer which tries to draw a number of animated triangles. The result still needs a bit of tuning. * Animometer/resources/debug-runner/tests.js: Add a new Suite for "3D" tests. * Animometer/tests/3d/resources/webgl.js: Added. * Animometer/tests/3d/webgl.html: Added. 2016-03-18 Jon Lee Add support for statically linking to a specific test https://bugs.webkit.org/show_bug.cgi?id=155631 Rubber-stamped by Darin Adler. * Animometer/developer.html: Update to call restartBenchmark instead so that it works for both the preset and the manually set test sessions. * Animometer/resources/debug-runner/animometer.css: (.tree .link): Style the "link" UI. * Animometer/resources/debug-runner/animometer.js: Move updateDisplay from suitesManager to optionsManager since this is a visual option and has nothing to do with the suites settings. Update the construction of the test UI by including a "link" after each test. Clicking on that link brings up a JS prompt with a URL and a query string with the current parameters of the controller, and selected test. Pasting this URL into the location bar will automatically start running the selected test. (suitesManager.suitesFromQueryString): Iterate through the Suites and tests and find the one that matches the provided parameters. Returns an object similar to the form in suitesManager.updateLocalStorageFromUI. (benchmarkController.initialize): After settings up the events and options, try parsing the query string and running the benchmark immediately. Otherwise, fall back to the form. (benchmarkController.startBenchmark): Store the options and suites into member variables for reuse in restartBenchmark. (benchmarkController.startBenchmarkImmediatelyIfEncoded): Convert the query string to an object. If that's successful, find the suite and test referenced in the query string. Start the benchmark if the search for the test succeeded. * Animometer/resources/extensions.js: (Utilities.stripNonASCIICharacters): Helper method to convert the name of the suite and test into a query-string-friendly version. (Utilities.convertObjectToQueryString): Helper method to convert an object to query string format. (Utilities.convertQueryStringToObject): Helper method to convert query string into an object with properties and values. 2016-03-16 Jon Lee Add a new benchmark test https://bugs.webkit.org/show_bug.cgi?id=155570 Reviewed by Simon Fraser. New Leaves test includes various image sizes and opacity. * Animometer/resources/debug-runner/tests.js: Add it to the HTML test suite. * Animometer/tests/dom/leaves.html: Added. * Animometer/tests/dom/resources/leaves.js: Added. Override the (Particle.call.reset): Uses a range of sizes, and opacity. (Particle.call.animate): Opacity goes up then down. When it hits 0, reset the particle. (Particle.call.move): Set transform and opacity. * Animometer/tests/master/resources/leaves.js: Get rid of the closure so that it can be used in this test. Update the relative path so that it works in both the master and dom test suite. 2016-03-15 Simon Fraser Add developer Animometer test that bounces P3-tagged images https://bugs.webkit.org/show_bug.cgi?id=155511 Reviewed by Tim Horton. Add a test for rendering performance of tagged images. The 5 images are tagged with the Display P3 colorspace. * Animometer/resources/debug-runner/tests.js: * Animometer/tests/bouncing-particles/bouncing-tagged-images.html: Added. * Animometer/tests/bouncing-particles/resources/bouncing-tagged-images.js: Added. * Animometer/tests/bouncing-particles/resources/image1.jpg: Added. * Animometer/tests/bouncing-particles/resources/image2.jpg: Added. * Animometer/tests/bouncing-particles/resources/image3.jpg: Added. * Animometer/tests/bouncing-particles/resources/image4.jpg: Added. * Animometer/tests/bouncing-particles/resources/image5.jpg: Added. 2016-03-09 Jon Lee Enhance existing Animometer tests https://bugs.webkit.org/show_bug.cgi?id=155261 Reviewed by Simon Fraser. * Animometer/tests/master/resources/canvas-tests.js: Add a gradient to the filled circles. To expose more of the gradient, add another circle. (SimpleCanvasStage.call.animate): For each frame, create a gradient with undulating stop points and colors. Fill the circles twice; once with the solid color, and once with the gradient. * Animometer/tests/master/resources/dom-particles.js: Refactor the emission variables into a separate stage for this test. Add a colorOffset variable to make the colors of each particle slightly different, since the ramp controller can add large numbers of particles all at once, which would otherwise get all the same color. * Animometer/tests/master/resources/particles.js: (initialize): Remove the code specific to the SVG mask test. * Animometer/tests/master/resources/image-data.js: (initialize): Remove unused local variable. * Animometer/tests/master/resources/multiply.js: (initialize): Make the test harder by adding more total particles. 2016-03-09 Jon Lee Add text tests https://bugs.webkit.org/show_bug.cgi?id=155257 Reviewed by Simon Fraser. * Animometer/resources/extensions.js: (UnitBezier.Utilities.createClass): Add a class that computes Bezier points assuming that two of the control points are at (0,0) and (1,1). Taken from WebCore/platform/graphics/UnitBezier.h * Animometer/resources/runner/tests.js: Add a test for English text and one for international text. * Animometer/tests/master/international.html: Added. * Animometer/tests/master/resources/text.js: Added. The test assumes there is #template div which it will copy. The copies are placed behind the template, and are set with different colors each frame. They are moved around with CSS transform. * Animometer/tests/master/text.html: Added. Remove the other text tests, since these ones cover the same techniques. * Animometer/tests/text/layering-text.html: Removed. * Animometer/tests/text/resources/layering-text.js: Removed. * Animometer/tests/text/resources/text-boxes.js: Removed. * Animometer/tests/text/text-boxes.html: Removed. * Animometer/resources/debug-runner/tests.js: 2016-03-09 Jon Lee Add a new image test https://bugs.webkit.org/show_bug.cgi?id=155232 Reviewed by Dean Jackson. Provisionally reviewed by Said Abou-Hallawa. The image test renders PNGs and moves them with translate and rotate transforms. Each particle has a lifetime, and when the lifetime ends or the particle goes offscreen, it resets itself somewhere on the stage. * Animometer/resources/debug-runner/tests.js: Remove the CSS bouncing PNG images test, because this one tests the same technique. * Animometer/resources/runner/tests.js: Added here as "Leaves". * Animometer/tests/master/leaves.html: Added. * Animometer/tests/master/resources/particles.js: Refactor out the parts specific to the DOM particles test. Consequently make velocity a public member. (initialize): The options parameter is never used, so remove it. (animate): Remove unused local variable. * Animometer/tests/master/resources/leaves.js: Maintains a focal point that moves back and forth across the canvas. That point affects the velocity of the particles. When the focal point is on the leftmost side, it is between [-6, -2], and set in reset(). When the focal point is on the rightmost side, it will be from [2, 6]. * Animometer/tests/master/resources/dom-particles.js: Move JS specific to this test here from particles.js. New images. * Animometer/tests/master/resources/compass100.png: Added. * Animometer/tests/master/resources/console100.png: Added. * Animometer/tests/master/resources/contribute100.png: Added. * Animometer/tests/master/resources/debugger100.png: Added. * Animometer/tests/master/resources/inspector100.png: Added. * Animometer/tests/master/resources/layout100.png: Added. * Animometer/tests/master/resources/performance100.png: Added. * Animometer/tests/master/resources/script100.png: Added. * Animometer/tests/master/resources/shortcuts100.png: Added. * Animometer/tests/master/resources/standards100.png: Added. * Animometer/tests/master/resources/storage100.png: Added. * Animometer/tests/master/resources/styles100.png: Added. * Animometer/tests/master/resources/timeline100.png: Added. 2016-03-03 Jon Lee Add ability to retrieve raw data from release harness https://bugs.webkit.org/show_bug.cgi?id=155026 Reviewed by Simon Fraser. * Animometer/developer.html: Remove the special UI in the debug harness. * Animometer/resources/runner/animometer.css: Add styles for the overlay. * Animometer/resources/runner/animometer.js: Let 'j' show the JSON results, but only if the overlay doesn't exist. Add 'esc' key to dismiss the overlay. (window.benchmarkController.selectResults): Cycle the cases around so that the first 's' press selects both the benchmark score and the individual test scores. * Animometer/resources/debug-runner/animometer.css: Remove unneeded rules. * Animometer/resources/debug-runner/animometer.js: Make the same call to handleKeyPress. 2016-03-03 Jon Lee Make sure multiply test particles have at least some opacity https://bugs.webkit.org/show_bug.cgi?id=155027 Reviewed by Simon Fraser. * Animometer/tests/master/resources/multiply.js: (initialize): Have the elements spin a little faster to make it more obvious when the system is being stressed. (_addTile): (animate): Make sure each element being animated has at least 1% opacity. 2016-03-03 Jon Lee Update image test https://bugs.webkit.org/show_bug.cgi?id=154962 Rubber-stamped by Darin Adler. * Animometer/tests/master/image-data.html: Make each canvas have a compositing layer. * Animometer/tests/master/resources/image-data.js: (initialize): Update to load multiple images serially. (_loadImage): (tune): Use display instead of visibility. When showing an element anew, move it somewhere else. (_createTestElement): Set up the element, refactor out placement of element to _refreshElement. (_refreshElement): Place element in a tile grid. (animate): (_getRandomNeighboringPixelIndex): Use a more conservative distribution to make the effect last a little longer. * Animometer/tests/master/resources/compass.svg: Added. * Animometer/tests/master/resources/console.svg: Added. * Animometer/tests/master/resources/contribute.svg: Added. * Animometer/tests/master/resources/debugger.svg: Added. * Animometer/tests/master/resources/inspector.svg: Added. * Animometer/tests/master/resources/layout.svg: Added. * Animometer/tests/master/resources/performance.svg: Added. * Animometer/tests/master/resources/script.svg: Added. * Animometer/tests/master/resources/shortcuts.svg: Added. * Animometer/tests/master/resources/standards.svg: Added. * Animometer/tests/master/resources/storage.svg: Added. * Animometer/tests/master/resources/styles.svg: Added. * Animometer/tests/master/resources/timeline.svg: Added. 2016-03-02 Jon Lee Add some new controllers, and refine tests https://bugs.webkit.org/show_bug.cgi?id=154914 Reviewed by Simon Fraser. Improve tests. * Animometer/tests/master/focus.html: Move each particle into a layer. Put the particle in a container element. Expand the container element by the max blur radius, and clip overflow. This way, when the blur is applied, it avoids causing layer resizes. * Animometer/tests/master/resources/focus.js: (FocusElement.Utilities.createClass): Create a container element, and put the particle inside. (hide): Set display:none. (show): Set display:block. (animate): Apply filters to the container element. (FocusStage.call.initialize): Instead of inserting and removing elements from the DOM, keep them in the stage, but set the display style instead. Use this._offsetIndex to keep track of which elements are displayed. (FocusStage.call.animate): Move some calculations around to avoid doing unneeded math. (FocusStage.call.getBlurValue): Make sure elements are always blurred. (FocusStage.call.getOpacityValue): Make sure elements have some opacity. * Animometer/tests/master/resources/multiply.js: Have the particles on the edge of the stage appear less black when the complexity gets large enough. (tune): Have this._distanceFactor calculate the factor. Avoid calculating square root each frame. 2016-03-02 Jon Lee Add some new controllers, and refine tests https://bugs.webkit.org/show_bug.cgi?id=154914 Reviewed by Simon Fraser. Add a controller that centers around 30 fps instead of 60 fps. * Animometer/developer.html: Add a new option. * Animometer/resources/debug-runner/animometer.js: * Animometer/resources/runner/animometer.js: (this._processData.findRegression): When calculating the complexity-frameLength regression, check the controller, and use a 30 fps baseline if needed. * Animometer/resources/statistics.js: (Regression.Utilities.createClass): Update to allow clients to specify the baseline frame length. * Animometer/tests/resources/main.js: (tune): Override some of the constants in RampController. Move those constants out for easier reading. Add a fixed controller, with no step. * Animometer/developer.html: Add a controller that takes no step. * Animometer/resources/debug-runner/animometer.js: * Animometer/tests/resources/main.js: (Rotater.Utilities.createClass): Switch to ramp controller as default. * Animometer/developer.html: Increase the test length to 20 seconds. * Animometer/resources/debug-runner/animometer.js: Rename the "adjustment" field to "controller" since that is a more accurate description. * Animometer/resources/debug-runner/graph.js: * Animometer/resources/runner/animometer.js: Update preferences for release suite. 2016-02-26 Jon Lee Address Dean's comments in 154673. * Animometer/developer.html: * Animometer/resources/debug-runner/animometer.js: * Animometer/resources/debug-runner/graph.js: 2016-02-25 Jon Lee Update animation benchmark and tests https://bugs.webkit.org/show_bug.cgi?id=154673 Reviewed by Dean Jackson. Update test visuals. * Animometer/tests/master/resources/canvas-tests.js: (CanvasLineSegment.Utilities.createClass): Line segments near the edge of the stage get clipped. Update circle position and radius to minimize impact. * Animometer/tests/master/resources/particles.js: Get rid of rotating gradient background, and have 3 locations for emitting particles. * Animometer/tests/master/resources/multiply.js: Update distance metric so that fringe tiles get more color. (initialize): Fix some of the math for laying out the tiles. (animate): When a tile isn't used, set visibility: hidden. 2016-02-24 Jon Lee Update animation benchmark and tests https://bugs.webkit.org/show_bug.cgi?id=154673 Reviewed by Dean Jackson. Update the ramp controller. The controller refines the complexity interval to test across. * Animometer/resources/statistics.js: Add functions that estimate cumulative distribution function. (Regression): For the flat regression, force the first segment to be at 60 fps. (valueAt): Add convenience function to return interpolated value based on the regression used. (_calculateRegression): Include the number of points included for both segments, and the piecewise errors. * Animometer/tests/resources/math.js: Make the Kalman estimator subclass Experiment, and allow it to be reset. * Animometer/tests/resources/main.js: Initialize the tier such that it starts at 10^0 = 1. Increase the number of ramps. Maintain three FPS thresholds-- the frame rate of interest, a limit on the lowest FPS we care to go for later interpolation, and a minimum FPS threshold we want to aim for each ramp. Also keep three estimators: a running average of the change point, a minimum boundary for each ramp, and an estimator for all the frames within an interval. The first two are used to determine the parameters of the next ramp, and the latter allows us to refine the parameters. (update): During the tier phase, it is possible that the highest complexity possible for a test won't stress the system enough to trigger stopping the tier phase and transitioning to the ramps. If the complexity doesn't change when going to the next tier, we've maxed the test out, and move on. When the tier phase completed, turn off Controller.frameLengthEstimator, which estimates the FPS at each tier. (tune): At each interval, look at the confidence distribution of being on the 60 FPS side or the slow side. If the slowest FPS we achieve at the ramp's maximum complexity is not at least _fpsRampSlowThreshold, then increase the maximum complexity. If we ever achieve 60 FPS, increase the ramp's minimum complexity to that level. If, at an even lower complexity, a glitch causes the FPS to drop, we reset the minimum complexity. Have the bootstrap calculation occur between tests. Clean up harness. * Animometer/resources/debug-runner/animometer.js: Run bootstrap after a test has completed to avoid doing all of it at the end before showing the results. Clean up parameters being passed around. * Animometer/resources/debug-runner/tests.js: (text): * Animometer/resources/runner/animometer.js: (this._processData.calculateScore): Save the results to the same object holding the data. (this._processData._processData): In the case where a file is dragged, calculate the score serially. Grab the results object and move it to the results variable and remove it from the data object. This avoids serializing the results into the JSON. (this._processData.findRegression): Include the samples used for bootstrapping. Reduce the resample size to shorten the wait. * Animometer/resources/runner/benchmark-runner.js: * Animometer/resources/statistics.js: (bootstrap): Update how bootstrapData is sorted. In some regression results the mix of floats and integers causes an alphabetical sort to occur. * Animometer/resources/strings.js: Add meta charset so that encodings between harness and test match. * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: * Animometer/tests/bouncing-particles/bouncing-css-images.html: * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: * Animometer/tests/bouncing-particles/bouncing-svg-images.html: * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: * Animometer/tests/master/canvas-stage.html: * Animometer/tests/master/focus.html: * Animometer/tests/master/image-data.html: * Animometer/tests/master/multiply.html: * Animometer/tests/master/particles.html: * Animometer/tests/misc/canvas-electrons.html: * Animometer/tests/misc/canvas-stars.html: * Animometer/tests/misc/compositing-transforms.html: * Animometer/tests/simple/simple-canvas-paths.html: * Animometer/tests/simple/tiled-canvas-image.html: * Animometer/tests/template/template-canvas.html: * Animometer/tests/template/template-css.html: * Animometer/tests/template/template-svg.html: * Animometer/tests/text/layering-text.html: * Animometer/tests/text/text-boxes.html: Update test harness reporting. * Animometer/developer.html: Add missing meta charset. * Animometer/index.html: Remove unnecessary utf-8 declaration. * Animometer/resources/debug-runner/animometer.css: Add convenience classes for formatting the results table. * Animometer/resources/debug-runner/animometer.js: Adjust which stats are shown. * Animometer/resources/debug-runner/tests.js: Display bootstrapping statistics. * Animometer/resources/strings.js: Move strings not used by the release harness. Switch to a pseudo-random number generator. * Animometer/resources/statistics.js: Add a Pseudo class, with a simple pseudo-random number generator. (_calculateRegression): Reset the generator before running bootstrap. (bootstrap): Deleted. Replace Math.random with Pseudo.random. * Animometer/tests/master/resources/canvas-tests.js: * Animometer/tests/master/resources/focus.js: * Animometer/tests/master/resources/particles.js: * Animometer/tests/resources/main.js: Use bootstrapping to get confidence interval in the breakpoint. For the ramp controller, calculate the piecewise regression, and then use bootstrapping in order to find the 95% confidence interval. Use the raw data. * Animometer/developer.html: Default to the complexity graph. Add a legend checkbox to toggle visibility of the bootstrap score and histogram. * Animometer/resources/debug-runner/animometer.css: Make some more space to show the old raw and average scores in the legend. Add new styles for the data. * Animometer/resources/debug-runner/graph.js: (_addRegressionLine): Allow passing an array for the variance bar tied to the regression line. Now |stdev| is |range|. (createComplexityGraph): Add bootstrap median, and overlay a histogram of the bootstrap samples. Switch raw samples from circles to X's. (onComplexityGraphOptionsChanged): Allow toggling of the bootstrap data. (onGraphTypeChanged): Move the regressions for the raw and average samples to the legend. In the subtitle use the bootstrap median, and include the 95% confidence interval. * Animometer/resources/runner/animometer.js: (this._processData.findRegression): Factor out the code that determines which samples to include when calculating the piecewise regression. For series that have many samples, or a wider range of recorded complexities, throw away the 2.5% lowest and highest samples before calculating the regression. Keep all samples if the number of samples to regress is small or the range of complexities is narrow. (this._processData._calculateScore): Factor out regression calculation to findRegression(). Bootstrap the change point of the regression. The score is the median. * Animometer/resources/statistics.js: (_calculateRegression): Correct an issue in the calculation of the regression, where the denominator can be 0. (bootstrap): Template for bootstrapping. Create a bootstrap sample array, Create re-samples by random selection with replacement. Return the 95% confidence samples, the bootstrap median, mean, and the data itself. * Animometer/resources/strings.js: Add bootstrap. * Animometer/tests/resources/main.js: (processSamples): Don't prematurely cut the sample data. Fix graph drawing. * Animometer/resources/debug-runner/animometer.js: Add spacing in the JSON output. Multiple tests output a lot of JSON and can hang when selecting JSON with no whitespace. * Animometer/resources/debug-runner/animometer.css: (#complexity-graph .series.raw circle): Update the color. * Animometer/resources/debug-runner/graph.js: Use the FPS axis instead of the complexity axis, which can vary in domain. For determining the complexity domain, only use samples after samplingTimeOffset. Allow dropping results JSON. * Animometer/developer.html: Add a button. * Animometer/resources/debug-runner/animometer.css: * Animometer/resources/debug-runner/animometer.js: Read the data and go straight to the dashboard. With JSON output, write out only the options and the raw data. Teach the harness to evaluate the samples and determine the test score. This will allow us to update how the score is calculated separately from the samples recorded. This also prepares the harness to be able to accept JSON of prior runs. * Animometer/resources/strings.js: Clean up and remove unneeded strings and reduce some of the hierarchy. * Animometer/resources/debug-runner/tests.js: Update to use the new strings. * Animometer/tests/resources/main.js: Allow all controllers to show a complexity-FPS graph. (_processComplexitySamples): Factor out some of the sample processing done in the ramp controller for the benefit of the other controllers. |complexitySamples| contains a list of samples. Sort the samples by complexity. Optionally remove the top x% of samples. Group them, and calculate distribution of samples within the same complexity, and add those as new entries into |complexityAverageSamples|. (Controller.processSamples): Move the code responsible for determining the complexity and FPS scores out to ResultsDashboard. The structure of the data returned by the controller is: { controller: [time-regression, time-regression, ...], // optional, data specific to controller marks: [...], samples: { // all of the sample data controller: [...], complexity: [...], // processed from controller samples complexityAverage: [...], // processed from complexity samples } } (AdaptiveController.processSamples): Adding the target frame length is no longer necessary; we now pass the test options to the graph. (Regression): Move to statistics.js. * Animometer/resources/statistics.js: Move Regression to here. Add a check if the sampling range only contains one sample, since we cannot calculate a regression from one sample point. Teach the test harness to evaluate the data. * Animometer/resources/runner/animometer.js: (ResultsDashboard): Store the options used to run the test and the computed results/score separately from the data. The results are stored as: { score: /* geomean of iteration score */, iterationsResults: [ { score: /* geomean of tests */, testsResults: { suiteName: { testName: { controller: { average: concern: stdev: percent: }, frameLength: { ... }, complexity: { complexity: stdev: segment1: segment2: }, complexityAverage: { ... } }, testName: { ... }, }, ... next suite ... } }, { ...next iteration... } ] } * Animometer/resources/debug-runner/animometer.js: Pass options around instead of relying on what was selected in the form. This will later allow for dropping previous results, and using those runs' options when calculating scores. (ResultsTable._addGraphButton): Simplify button action by using attached test data. * Animometer/resources/debug-runner/graph.js: Refactor to use the data. Consolidate JS files, and move statistics out to a separate JS. Preparation for having the Controller only handle recording and storage of the samples, and leave the evaluation of the test score out to the harness. Move Experiment to a new statistics.js, where Regression will also eventually go. Get rid of algorithm.js and move it to utilities.js since the Heap is used only for Experiments. * Animometer/tests/resources/algorithm.js: Removed. Heap is in utilities.js. * Animometer/tests/resources/sampler.js: Removed. Experiment is in statistics.js, Sampler in main.js. * Animometer/tests/resources/main.js: Move Sampler here. * Animometer/resources/statistics.js: Added. Move Statistics and Experiment here. * Animometer/resources/extensions.js: Move Heap here. Attach static method to create a max or min heap to Heap, instead of a new Algorithm object. Update JS files. * Animometer/developer.html: * Animometer/index.html: * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: * Animometer/tests/bouncing-particles/bouncing-css-images.html: * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: * Animometer/tests/bouncing-particles/bouncing-svg-images.html: * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: * Animometer/tests/master/canvas-stage.html: * Animometer/tests/master/focus.html: * Animometer/tests/master/image-data.html: * Animometer/tests/master/multiply.html: * Animometer/tests/master/particles.html: * Animometer/tests/misc/canvas-electrons.html: * Animometer/tests/misc/canvas-stars.html: * Animometer/tests/misc/compositing-transforms.html: * Animometer/tests/simple/simple-canvas-paths.html: * Animometer/tests/simple/tiled-canvas-image.html: * Animometer/tests/template/template-canvas.html: * Animometer/tests/template/template-css.html: * Animometer/tests/template/template-svg.html: * Animometer/tests/text/layering-text.html: * Animometer/tests/text/text-boxes.html: Fix the cursor in the graph analysis when the min complexity is not 0. * Animometer/resources/debug-runner/graph.js: (_addRegression): (createComplexityGraph): 2016-02-23 Geoffrey Garen Fix some issues in MallocBench https://bugs.webkit.org/show_bug.cgi?id=154600 Reviewed by Oliver Hunt. * MallocBench/MallocBench.xcodeproj/project.pbxproj: Make nimlang.ops a part of the build so that it copies to the right place for execution. * MallocBench/MallocBench/Interpreter.cpp: (Interpreter::Interpreter): Don't try to open .ops files for writing because we're only going to read and we might need extra permissions to write. (Interpreter::~Interpreter): Give more context when opening a file fails to help with debugging. * MallocBench/MallocBench/stress.cpp: (benchmark_stress): Reduce iterations to complete in less than 10 seconds. 2016-02-23 Michael Saboff Unreviewed change to revert extraneous changes made part of change set 196955. * MallocBench/MallocBench/Interpreter.cpp: (Interpreter::doMallocOp): (Interpreter::Thread::switchTo): (writeData): Deleted. 2016-02-19 Michael Saboff MallocBench: Added recording for nimlang website, new recording details and added new options https://bugs.webkit.org/show_bug.cgi?id=154485 Reviewed by Geoff Garen. Added new capabilities to MallocBench. These include: Added a recording of http://nim-lang.org/docs/lib.html. Added thread id to the recording and the ability to playback switching threads in MallocBench Added aligned allocations to recordings and the ability to playback Added --use-thread-id option to honor recorded thread ids Added --detailed-report to output remaining allocations by size after playback Added --no-warmup to not run the warm up iteration Changed the way that options are passed down to the benchmarks. Instead of passing individual boolean or numeric option values, just pass a reference the CommandLine itself. Each benchmark can access the options that are appropriate. The Benchmark class also uses the options for is parallel, run counts and warm up. Added thread id and aligned malloc to the Op by noticing that structure padding and Opcode allowed for another 32 bits of data. Breaking that unused 32 bits into a 16 bit thread id value and a 16 bit log base 2 of the alignment for aligned malloc allowed for existing recordings to playback without any incompatibilities. Threaded operation is simulated by creating threads as needed. As long as the next Op's thread id is the same as the last, operation continues as normal. When the next Op has a different thread id, we switch to that thread using the shared Op stream to continue playing back. There is a mutex to assure that only one thread is really running at a time and a condition variable used to wait that the current thread id matches each block thread's thread id. This doesn't simulate true concurrent threading, but is instead plays back Ops recorded for multiple thread faithfully. * MallocBench/MallocBench.xcodeproj/project.pbxproj: * MallocBench/MallocBench/Benchmark.cpp: (deallocateHeap): (Benchmark::Benchmark): (Benchmark::runOnce): (Benchmark::run): * MallocBench/MallocBench/Benchmark.h: (Benchmark::isValid): * MallocBench/MallocBench/CommandLine.cpp: (CommandLine::printUsage): * MallocBench/MallocBench/CommandLine.h: (CommandLine::isValid): (CommandLine::benchmarkName): (CommandLine::isParallel): (CommandLine::useThreadID): (CommandLine::detailedReport): (CommandLine::warmUp): (CommandLine::heapSize): (CommandLine::runs): * MallocBench/MallocBench/Interpreter.cpp: (Interpreter::Interpreter): (Interpreter::run): (Interpreter::readOps): (Interpreter::doOnSameThread): (Interpreter::switchToThread): (Interpreter::detailedReport): (compute2toPower): (writeData): (Interpreter::doMallocOp): (Interpreter::Thread::Thread): (Interpreter::Thread::stop): (Interpreter::Thread::~Thread): (Interpreter::Thread::runThread): (Interpreter::Thread::waitToRun): (Interpreter::Thread::switchTo): * MallocBench/MallocBench/Interpreter.h: (Interpreter::Thread::isMainThread): * MallocBench/MallocBench/alloc_free.cpp: Added. (benchmark_alloc_free): * MallocBench/MallocBench/alloc_free.h: Added. * MallocBench/MallocBench/balloon.cpp: (benchmark_balloon): * MallocBench/MallocBench/balloon.h: * MallocBench/MallocBench/big.cpp: (benchmark_big): * MallocBench/MallocBench/big.h: * MallocBench/MallocBench/churn.cpp: (benchmark_churn): * MallocBench/MallocBench/churn.h: * MallocBench/MallocBench/facebook.cpp: (benchmark_facebook): * MallocBench/MallocBench/facebook.h: * MallocBench/MallocBench/flickr.cpp: (benchmark_flickr): (benchmark_flickr_memory_warning): * MallocBench/MallocBench/flickr.h: * MallocBench/MallocBench/fragment.cpp: (validate): (benchmark_fragment): (benchmark_fragment_iterate): * MallocBench/MallocBench/fragment.h: * MallocBench/MallocBench/list.cpp: (benchmark_list_allocate): (benchmark_list_traverse): * MallocBench/MallocBench/list.h: * MallocBench/MallocBench/main.cpp: (main): * MallocBench/MallocBench/medium.cpp: (benchmark_medium): * MallocBench/MallocBench/medium.h: * MallocBench/MallocBench/memalign.cpp: (test): (benchmark_memalign): * MallocBench/MallocBench/memalign.h: * MallocBench/MallocBench/message.cpp: (benchmark_message_one): (benchmark_message_many): * MallocBench/MallocBench/message.h: * MallocBench/MallocBench/nimlang.cpp: Added. (benchmark_nimlang): * MallocBench/MallocBench/nimlang.h: Added. * MallocBench/MallocBench/nimlang.ops: Added. * MallocBench/MallocBench/realloc.cpp: (benchmark_realloc): * MallocBench/MallocBench/realloc.h: * MallocBench/MallocBench/reddit.cpp: (benchmark_reddit): (benchmark_reddit_memory_warning): * MallocBench/MallocBench/reddit.h: * MallocBench/MallocBench/stress.cpp: (deallocate): (benchmark_stress): * MallocBench/MallocBench/stress.h: * MallocBench/MallocBench/stress_aligned.cpp: (benchmark_stress_aligned): * MallocBench/MallocBench/stress_aligned.h: * MallocBench/MallocBench/theverge.cpp: (benchmark_theverge): (benchmark_theverge_memory_warning): * MallocBench/MallocBench/theverge.h: * MallocBench/MallocBench/tree.cpp: (benchmark_tree_allocate): (benchmark_tree_traverse): (benchmark_tree_churn): * MallocBench/MallocBench/tree.h: * MallocBench/run-malloc-benchmarks: 2016-02-11 Jon Lee Fix a missing refactoring. * Animometer/tests/master/resources/multiply.js: (animate): Move to Utilities.lerp. (_lerp): Deleted. 2016-02-10 Jon Lee Add new benchmark tests. https://bugs.webkit.org/show_bug.cgi?id=154063 Provisionally reviewed by Said Abou-Hallawa. Add tests for get/put image data, filters, opacity, and css transforms. * Animometer/resources/runner/benchmark-runner.js: (_runBenchmarkAndRecordResults): Update the body background color to match that of the stage. (this._runNextIteration): Clear the background color style for the results page. * Animometer/resources/runner/tests.js: * Animometer/tests/master/focus.html: Added. * Animometer/tests/master/image-data.html: Added. * Animometer/tests/master/multiply.html: Added. * Animometer/tests/master/resources/focus.js: Added. * Animometer/tests/master/resources/image-data.js: Added. * Animometer/tests/master/resources/multiply.js: Added. * Animometer/tests/master/resources/stage.css: Move common styles out. * Animometer/tests/resources/main.js: Update Stage.randomBool to use Math.random. Add Stage.randomSign for randomly setting a direction. Add the notion of the current timestamp of the test to Benchmark, since some animations cycle through colors and rely on an incremental counter like the time. 2016-02-09 Said Abou-Hallawa Add internal benchmark tests for CSS mix-blend-modes and filters https://bugs.webkit.org/show_bug.cgi?id=154058 Provisionally reviewed by Jon Lee. * Animometer/resources/debug-runner/tests.js: Include the new tests in the "HTML suite" of the debug runner. * Animometer/resources/extensions.js: (Utilities.browserPrefix): (Utilities.setElementPrefixedProperty): Utility functions to allow setting prefixed style properties. * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: Set the mix-blend-mode and the filter to some random values if the options of the test requested that. * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: (parseShapeParameters): Parse the url options "blend" and "filter" and set the corresponding flags. * Animometer/tests/resources/main.js: (randomStyleMixBlendMode): (randomStyleFilter): Return random mix-blend-mode and filter. 2016-02-08 Jon Lee Add a ramp controller https://bugs.webkit.org/show_bug.cgi?id=154028 Provisionally reviewed by Said Abou-Hallawa. Enhance the graph to include a complexity-fps graph, in addition to the time graph. * Animometer/developer.html: Add a ramp option. * Animometer/resources/debug-runner/animometer.css: Update the style. * Animometer/resources/strings.js: Flatten the Strings.text constants. * Animometer/resources/debug-runner/animometer.js: (ResultsTable.call._addGraphButton): Refactor. (ResultsTable.call._addTest): Add regression data. (benchmarkController): Add a form that allows the user to switch between the two forms, Add a form that allows the user to toggle different data. Hide certain header columns depending on the selected controller. * Animometer/resources/debug-runner/graph.js: Add the complexity regressions. * Animometer/resources/debug-runner/tests.js: Add headers for the ramp results. * Animometer/resources/runner/animometer.js: (ResultsTable): If a header is disabled don't include them in _flattenedHeaders. * Animometer/tests/resources/main.js: (Controller): Allow options to specify the capacity for sample arrays. (Regression): A piecewise regression that tries to fit a slope and a flat profile. (_calculateRegression): Options can fix the slope and bias when calculating the minimal error. Sweep across the samples in time (which could be backward depending on the controller) and calculate the intersection point. (RampController): This controller assumes that the target frame rate is below 58 FPS. It runs in two stages. The first stage quickly determines the order of magnitude of objects needed to stress the system by the setting the complexity to increasingly difficult tiers. Perform a series of ramps descending from a high-water mark of complexity. The complexity needed to reach the target frame length is done by performing a piecewise regression on each ramp, and track a running average of these values. For the next ramp, make that running average the center of the ramp. With a minimum complexity of 0, the high-water mark is twice that average. The score is based on the highest complexity that can reach 60 fps. 2016-02-08 Jon Lee Address Said's comments on the benchmark, and do some clean up. * Animometer/developer.html: * Animometer/resources/debug-runner/animometer.css: Add styles for averages. * Animometer/resources/debug-runner/animometer.js: Use the right Strings constants. * Animometer/resources/debug-runner/graph.js: (_addRegressionLine): Add missing code to draw the line and standard deviation highlight. (onGraphTypeChanged): Remove unneeded variables (onTimeGraphOptionsChanged): * Animometer/resources/runner/benchmark-runner.js: (_runBenchmarkAndRecordResults): Rename samplers to suiteResults and _suitesSamplers to _suitesResults. * Animometer/tests/resources/main.js: (results): Call processSamples(). (update): Change sampling timestamp comparison. (_animateLoop): Move shouldStop call to before the update. * Animometer/tests/resources/sampler.js: (process): Rename to processSamples(). 2016-02-07 Jon Lee Teach Controller to measure intervals, and turn off the frame length estimator. * Animometer/tests/resources/main.js: Default interval length is 100 ms. (start): Set the first interval. (_measureAndResetInterval): Reports the average frame length of the interval that just completed, and sets up the next interval. (update): If there is no length, then just use the estimator per frame, otherwise the estimator measures per interval. Add a didFinishInterval for subclasses to process prior to recording the sample. Update tune() to include whether an interval had finished. (StepController): Step controllers don't measure on an interval basis. 2016-02-07 Jon Lee Minor refactoring. Rename Controller._estimator to Controller._frameLengthEstimator and switch the parameters for start(), update(), and tune(), so that the timestamp is first and stage is second. * Animometer/tests/resources/main.js: 2016-02-07 Jon Lee Move ResultsTable functionality not needed for release tests out. Move reporting of score and mean to selection of the time-based graph. * Animometer/developer.html: Rename graph-options to time-graph-options. * Animometer/resources/debug-runner/animometer.js: (DeveloperResultsTable): Moved from runner/animometer.js. Switch from mean values to "average" objects which can hold stdev. Move graph button and calculation of noisy measurements here. Sophisticated header processing is not needed in release suite. (populateTable): Use DeveloperResultsTable. * Animometer/resources/debug-runner/graph.js: Pull time graph creation to its own function, and add a new onGraphTypeChanged handler in preparation of a complexity graph to be added later. * Animometer/resources/runner/animometer.js: (ResultsTable): Simplify to just handle test names and scores. 2016-02-07 Jon Lee Tests: reuse objects already made. Avoid thrash of object creation and removal by maintaining an index that moves along the array as the adjust values change. If the tune value requires more objects than the maximum size of the object array, then create new objects. This means that the object array size never decreases. * Animometer/tests/master/resources/canvas-stage.js: Maintain a separate offsetIndex. For these tests, we want to avoid drawing the oldest objects, so the scene will draw the object at offsetIndex to the end of the array. (tune): Reverse the logic since "removal" of objects is much simpler and involves simply changing the offsetIndex. (animate): Update the for loop to draw from offsetIndex to the end. (complexity): Update the definition. * Animometer/tests/master/resources/canvas-tests.js: Maintain a separate offsetIndex. For these tests, we want to avoid drawing the newest objects, so the scene will draw the object at index 0 to the object at offsetIndex. (SimpleCanvasStage.animate): Fly-by removal of local stage variable, which is unneeded. Update the for loop to draw from offsetIndex to the end. * Animometer/tests/simple/resources/simple-canvas-paths.js: (SimpleCanvasStage.animate): Update the for loop to draw from 0 to offsetIndex. * Animometer/tests/simple/resources/simple-canvas.js: (tune): Update logic. Here, offsetIndex represents the boundary of the last index to render. (animate): Update the for loop to draw from 0 to offsetIndex. (complexity): Update the definition. 2016-02-07 Jon Lee Tests: refactor and update styles. * Animometer/tests/resources/main.js: Add helper methods that return a color that hue rotates based on the date, and a counter value that increases based on the date. Fix randomInt() to not bias against the min and max values. * Animometer/tests/master/resources/canvas-tests.js: Use new helper methods. * Animometer/tests/master/resources/dom-particles.js: Ditto. * Animometer/tests/master/resources/particles.js: Ditto. * Animometer/tests/simple/resources/simple-canvas-paths.js: Refactor to use a rotating color instead of a random color. The fast switching of color is too vivid to watch. * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js: (BouncingSvgParticlesStage.call.createGradient): Fix the gradient so that the last stop is located at the end. 2016-02-07 Jon Lee Refactor tune() to not return the complexity of the scene. We have stage.complexity() now, so returning the complexity through tune is unnecessary. * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: * Animometer/tests/master/resources/canvas-stage.js: * Animometer/tests/master/resources/particles.js: * Animometer/tests/misc/resources/canvas-electrons.js: * Animometer/tests/misc/resources/canvas-stars.js: * Animometer/tests/resources/main.js: * Animometer/tests/simple/resources/simple-canvas.js: * Animometer/tests/simple/resources/tiled-canvas-image.js: * Animometer/tests/template/resources/template-canvas.js: * Animometer/tests/template/resources/template-css.js: * Animometer/tests/template/resources/template-svg.js: * Animometer/tests/text/resources/layering-text.js: 2016-02-07 Jon Lee Make the fixed controller a step controller instead. Halfway through the test it will bump up the complexity 4-fold. Calculate the step timestamp using options instead of a separate parameter to the Controller constructor. * Animometer/developer.html: Change value to "step" * Animometer/resources/debug-runner/animometer.js: (window.suitesManager.updateEditsElementsState): Show number inputs when set to "step". * Animometer/tests/resources/main.js: (update): Provide a hook for subclasses to tune. (StepController): Maintain a flag determining whether we've stepped, and the time we should step. (Benchmark): Use the new StepController. 2016-02-07 Jon Lee Adjust the FPS graph scale. Instead of making the FPS graph linearly scale, scale it based on the frame length, but show the data in terms of FPS. Because it is inversely proportional, and most of the data never gets below 20, concentrate the axis from 20-60 FPS, since otherwise over half of the available graph space ends up blank. This means we should convert all of the FPS data to frame length data. * Animometer/resources/debug-runner/graph.js: Update the domain to be based on frame length in milliseconds instead of FPS. Update the cursor to consider all of the values being shown, and then pick the min and max values to represent the length of the cursor. * Animometer/resources/runner/animometer.js: * Animometer/resources/strings.js: * Animometer/tests/resources/main.js: (processSamples): Add the ability to only sample a range of the data instead of everything after an offset index. Update sampler to record the frame lengths instead of the frame rate. 2016-02-07 Jon Lee Add option to use different methods for retrieving a timestamp. * Animometer/developer.html: Add performance.now and Date.now options. * Animometer/resources/runner/animometer.js: Default to performance.now. (window.benchmarkController.startBenchmark): * Animometer/tests/resources/main.js: Tie the desired method to _getTimestamp. (run): Use _getTimestamp. (_animateLoop): Ditto. 2016-02-07 Jon Lee Allow adding any number of markers to the graph. The markers can be labeled and contain timestamp and sample index data. Make it a part of the controller rather than keeping it in the sampler. * Animometer/resources/debug-runner/animometer.css: Add styles for markers * Animometer/resources/debug-runner/graph.js: Create the markers and add text labels. * Animometer/resources/runner/animometer.js: Assume the samplingTimeOffset is just one of the marks provided. * Animometer/resources/strings.js: Add Strings.json.marks. * Animometer/tests/resources/main.js: (Controller): Keep marks here. They are keyed by the marker name, so no two markers should have the same name. (recordFirstSample): Refactor to use mark. (mark): Allows for arbitrary data if needed later. The timestamp maintained is relative to the absolute start timestamp. (containsMark): Checks whether a mark with a specific comment exists. (processSamples): Removes the _startTimestamp offset from the marks before setting it in results. * Animometer/tests/resources/sampler.js: Remove marks. 2016-02-07 Jon Lee Get rid of options member variable in Benchmark. Options are only needed when initializing the stage or benchmark, so there's no need to also keep a reference to it. * Animometer/tests/resources/main.js: Get rid of options variable in Benchmark. Pass options to Controllers and Stages. (Controller.Utilities.createClass): (Benchmark.Utilities.createClass): (get options): Deleted. * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js: * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js: * Animometer/tests/master/resources/canvas-stage.js: * Animometer/tests/master/resources/canvas-tests.js: * Animometer/tests/master/resources/particles.js: * Animometer/tests/misc/resources/canvas-electrons.js: * Animometer/tests/misc/resources/canvas-stars.js: * Animometer/tests/misc/resources/compositing-transforms.js: * Animometer/tests/simple/resources/simple-canvas-paths.js: * Animometer/tests/simple/resources/tiled-canvas-image.js: * Animometer/tests/template/resources/template-canvas.js: * Animometer/tests/template/resources/template-css.js: * Animometer/tests/template/resources/template-svg.js: * Animometer/tests/text/resources/layering-text.js: 2016-02-07 Jon Lee Update how the benchmark is run https://bugs.webkit.org/show_bug.cgi?id=153960 Provisionally reviewed by Said Abou-Hallawa. Introduce the notion of a Controller. It is responsible for recording, updating, and processing the statistics and complexity of the benchmark. This allows plugging in different Controllers. This strips most of the functionality from Animator and BenchmarkState, so fold what's left into Benchmark. Now, Benchmarks only own a stage and a controller, but are responsible for driving the animation loop. Rewrite Animator._shouldRequestAnotherFrame into two different Controllers. One maintains a fixed complexity, and the other adapts the complexity to meet a fixed FPS. Fix the Kalman estimator to be modeled on a scalar variable with no model. * Animometer/tests/resources/main.js: Remove BenchmarkState and Animator, and replace it with a Controller. Add a FixedController and refactor the previous controller to an AdaptiveController. (Controller): Controllers own the estimator and the sampler. When a new frame is displayed, the animation loop calls update(). The estimator and sampler record stats, then tune. Samplers can track multiple series of data. The basic controller tracks timestamp, complexity, and estimated frame rate. The Kalman estimation is based on the frame length rather than the frame rate. Because FPS is inverse proportional to frame length, in the case where the measured frame length is very small, the FPS ends up being a wildly large number (in the order of 600-1000 "FPS"), and it pulls the estimator up drastically enough that it takes a while for it to settle back down. Using frame length reduces the impact of these spikes. Converging the estimation takes enough time to avoid initializing it immediately when the benchmark starts. Instead, the benchmark runs for a brief period of time (100ms) before running it in earnest. Allow controllers an opportunity to set the complexity before starting recording. When the benchmark is complete, the controller has an opportunity to process the samples. The default implementation calculates the raw FPS based on the time difference of the samples, and calculates the complexity score. This is moved from Benchmark.processSamples. (Controller): Initialize timestamps. These are at first relative to the start of the benchmark, but are offset by the absolute start time during start(). By default maintain 3 data series, but subclasses can override. (start): Calls recordFirstSample() for subclasses to override if needed. (recordFirstSample): For basic controller, start sampling at the beginning. (update): Update the frame length estimator and sample. (shouldStop): Checks that the time is before _endTimestamp. (results): Returns the processed samples. (processSamples): Iterate through the sample data and collate them. Include scores. (FixedComplexityController): Controller that tunes the stage to the desired complexity prior to starting, and keeps it at that complexity. (AdaptiveController): Have the estimator estimate the interval frame rate instead of the raw frame rate. The previous version of this controller ignored the frame that came after the adjustment. The raw FPS show that whatever noise the scene change adds is negligible compared to the noise of the system overall. Stop ignoring that frame and include all frames in the measurements. (Benchmark): Remove dependency on animator, and instantiate a runner based on what is selected. Most of the loop's functionality is in Controller, so remove here. (Benchmark.run): Remove start() since it is only called from run(), and fold it in here. (Benchmark._animateLoop): Fold in from Animator.animateLoop. Let the benchmark run for a brief period before calling Controller.start(). * Animometer/tests/resources/math.js: Fix the Kalman estimator. The filter estimates a scalar variable, and makes basic assumptions regarding the model. As a result none of the linear algebra classes are needed, so remove Matrix, Vector3, and Matrix3. (SimpleKalmanEstimator): Calculate the gain based on the provided process and measurement errors. (KalmanEstimator): Deleted. (IdentityEstimator): Deleted. (PIDController): Refactor to use the Utilities.createClass() helper. The Kalman filter algorithm is explained here http://greg.czerniak.info/guides/kalman1/. The state, represented by a scalar, is the estimated frame length. There is no user transition of the state, and the state is the same as the measurement. With this model, the estimation error converges, so calculate the gain ahead of time. * Animometer/developer.html: Remove fixed-after-warmup since it is not useful. Replace the option to toggle the estimator, and make it possible to customize the estimator's error parameters. Show raw FPS by default, and remove interval FPS, which will be shown instead of the filtered raw FPS. * Animometer/resources/debug-runner/animometer.css: Put the header behind the graph. Remove #intervalFPS rules; move the color to #filteredFPS. * Animometer/resources/debug-runner/graph.js: (updateGraphData): Update the hr style to force the layout to be calculated correctly. Change the tick format to be in terms of seconds, since the timestamps are in milliseconds. Remove interval data. * Animometer/resources/runner/animometer.js: (window.benchmarkController.startBenchmark): Set Kalman parameters. * Animometer/resources/runner/benchmark-runner.js: (_runBenchmarkAndRecordResults): When a benchmark completes, expect it to return the final data, rather than passing a sampler from the controller. This avoids needing to expose the sampler variable in the benchmark. * Animometer/tests/resources/sampler.js: (process): Move the setting of the target frame rate to AdaptiveController. 2016-02-06 Jon Lee Code clean up: Move Rotater function closer to Stage static methods. The Rotater is used together with those methods; keep them close. * Animometer/tests/resources/main.js: 2016-02-06 Jon Lee Update the JS includes due to ResultsTable move. * Animometer/developer.html: * Animometer/index.html: 2016-02-06 Jon Lee Move createElement and createSVGElement to Utilities. * Animometer/resources/extensions.js: (Utilities.createElement): Added. (Utilities.createSVGElement): Added. (DocumentExtension.createElement): Deleted. (DocumentExtension.createSvgElement): Deleted. * Animometer/resources/debug-runner/animometer.js: * Animometer/resources/runner/animometer.js: * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js: 2016-02-06 Jon Lee Add a convenience function for creating a class. The pattern for creating a class is common enough to add as a Utilities helper function. It also makes it easy to collapse class definitions when editing. * Animometer/resources/debug-runner/animometer.js: Move ProgressBar definition, since it is only used here. * Animometer/resources/runner/animometer.js: Move ResultsDashboard and ResultsTable definition, since it is only used here. * Animometer/resources/extensions.js: Move Utilities definition to the top. Convert Point, Insets, SimplePromise. (ProgressBar): Moved to animometer.js. (ResultsDashboard): Moved to animometer.js. (ResultsTable): Moved to animometer.js. * Animometer/resources/runner/benchmark-runner.js: Convert BenchmarkRunnerState, BenchmarkRunner. * Animometer/tests/resources/main.js: Convert Rotater, Stage, Animator, Benchmark. * Animometer/tests/resources/sampler.js: Convert Experiment, Sampler. Convert test primitives. * Animometer/tests/master/resources/canvas-tests.js: Convert CanvasLineSegment, CanvasArc, CanvasLinePoint. * Animometer/tests/simple/resources/simple-canvas-paths.js: Convert CanvasLineSegment, CanvasLinePoint, CanvasQuadraticSegment, CanvasQuadraticPoint, CanvasBezierSegment, CanvasBezierPoint, CanvasArcToSegment, CanvasArcToSegmentFill, CanvasArcSegment, CanvasArcSegmentFill, CanvasRect, CanvasRectFill. * Animometer/tests/simple/resources/tiled-canvas-image.js: Convert CanvasImageTile. 2016-02-06 Jon Lee Minor improvements to debug harness. * Animometer/developer.html: * Animometer/resources/debug-runner/animometer.css: (#suites): Put the complexity text boxes closer to the test names. (#options): (#rawFPS circle): Make the interval FPS appear as a separate data series, with a line. (#intervalFPS path): (#intervalFPS circle): * Animometer/resources/debug-runner/animometer.js: (window.optionsManager.updateLocalStorageFromUI): Convert number inputs from text. (window.suitesManager._onChangeTestCheckbox): Refactor to take a checkbox. (window.suitesManager._createTestElement): Enhance such that typing into the complexity input will automatically select that test for running. (window.suitesManager.updateLocalStorageFromJSON): Make the harness work for private browsing. * Animometer/resources/debug-runner/graph.js: Separate the intervalFPS data, and show more accuracy in timestamps. 2016-02-06 Jon Lee Refactor helper methods for getting random values for a stage. Instead of requiring a Stage instance, just attach it to the Stage object. * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js: * Animometer/tests/master/resources/canvas-tests.js: * Animometer/tests/master/resources/particles.js: * Animometer/tests/misc/resources/canvas-electrons.js: * Animometer/tests/misc/resources/canvas-stars.js: * Animometer/tests/misc/resources/compositing-transforms.js: * Animometer/tests/resources/main.js: * Animometer/tests/simple/resources/simple-canvas-paths.js: 2016-02-05 Said Abou-Hallawa Add a new graphics test for CanvasRenderingContext2D functions: getImageData and putImageData https://bugs.webkit.org/show_bug.cgi?id=151716 Reviewed by Darin Adler. The purpose of this test is to measure the performance of getImageData and putImageData functions. This test draws a background on the canvas and then gets some random tiles from this background and draw them in destinations different from their original sources. * Animometer/resources/debug-runner/tests.js: Adding the new test to the canvas simple tests suite. * Animometer/resources/extensions.js: (Array.prototype.shuffle): Shuffles the elements of an array. (Point.zero): Returns a new Point object whose x and y are equal zero. (Point.prototype.str): Used for debugging the Point object. * Animometer/tests/simple/resources/tiled-canvas-image.js: Added. (CanvasImageTile): (CanvasImageTile.prototype.getImageData): (CanvasImageTile.prototype.putImageData): (Stage.call.initialize): (Stage.call._createTiles): (Stage.call._nextTilePosition): (Stage.call.tune): (Stage.call._drawBackground): (Stage.call.animate): (Stage.call.complexity): (Stage.call): * Animometer/tests/simple/tiled-canvas-image.html: Added. 2016-01-07 Jon Lee Fix new test. * Animometer/resources/runner/tests.js: Wrong URL from an old patch. * Animometer/tests/master/particles.html: * Animometer/tests/master/resources/dom-particles.js: (Particle.call.reset): Figured out a simpler way to set up the particles. (this.move.reset): Deleted. (this.move._applyAttributes): Deleted. * Animometer/tests/master/resources/particles.js: (Particle): Call move() after reset(). 2016-01-07 Jon Lee Update benchmark test suite https://bugs.webkit.org/show_bug.cgi?id=152679 Reviewed by Simon Fraser. Add a new test. The test has a rotating background gradient, and does a better job physically simulating particles. * Animometer/resources/extensions.js: Teach Point to take constants as well as other Points. (Point.prototype.length): Added. (Point.prototype.normalize): Added. * Animometer/resources/runner/tests.js: Add the test to the master suite. * Animometer/tests/master/particles.html: Added. * Animometer/tests/master/resources/particles.js: Added. Parent class for different kinds of particles. (Particle): (Particle.prototype.reset): If the particle starts slowing down in terms of its animation, reset it. (Particle.prototype.animate): Bounce off the walls elastically, and include gravity. (Particle.prototype.move): Subclasses should override. (ParticlesStage): Stage includes a rotating gradient background. * Animometer/tests/master/resources/dom-particles.js: Added. Creates a
and adds it to the stage. * Animometer/tests/resources/star.svg: Added. 2016-01-03 Jon Lee Update benchmark test suite https://bugs.webkit.org/show_bug.cgi?id=152679 Reviewed by Simon Fraser. Move algorithm.js and sampler.js to tests/ and benchmark-runner.js to runner/. Needed by both harnesses. * Animometer/resources/runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/resources/debug-runner/benchmark-runner.js. * Animometer/developer.html: * Animometer/index.html: Needed only by the tests. Move to tests/. Statistics, in sampler.js, is used by ResultsDashboard, so move that into extensions.js. * Animometer/resources/extensions.js: * Animometer/tests/resources/algorithm.js: Renamed from PerformanceTests/Animometer/resources/algorithm.js. * Animometer/tests/resources/sampler.js: Renamed from PerformanceTests/Animometer/resources/sampler.js. * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: * Animometer/tests/bouncing-particles/bouncing-css-images.html: * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: * Animometer/tests/bouncing-particles/bouncing-svg-images.html: * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: * Animometer/tests/master/canvas-stage.html: * Animometer/tests/misc/canvas-electrons.html: * Animometer/tests/misc/canvas-stars.html: * Animometer/tests/misc/compositing-transforms.html: * Animometer/tests/simple/simple-canvas-paths.html: * Animometer/tests/template/template-canvas.html: * Animometer/tests/template/template-css.html: * Animometer/tests/template/template-svg.html: * Animometer/tests/text/layering-text.html: * Animometer/tests/text/text-boxes.html: 2016-01-07 Jon Lee Update benchmark test suite https://bugs.webkit.org/show_bug.cgi?id=152679 Reviewed by Simon Fraser. Fix tests for other browsers. * Animometer/resources/extensions.js: (Point.elementClientSize): Some browsers return 0 for SVG clientWidth and clientHeight. Use getBoundingClientRect() instead. * Animometer/tests/misc/resources/canvas-electrons.js: (CanvasElectron.prototype._draw): Some browsers don't support ellipse. 2016-01-07 Jon Lee Add a waitUntilReady() step https://bugs.webkit.org/show_bug.cgi?id=152862 Reviewed by Simon Fraser. Add a waitUntilReady() callback that lets the benchmark complete its setup before running the benchmark. * Animometer/tests/resources/main.js: (Benchmark.prototype.run): First call waitUntilReady, which returns a promise. When the promise resolves, run everything that was in this function. (Benchmark.prototype.waitUntilReady): Default implementation returns a resolved promise. (Benchmark.prototype.resolveWhenFinished): Deleted. * Animometer/tests/template/resources/template-canvas.js: (new.TemplateCanvasStage.waitUntilReady): Example on how to override. 2016-01-03 Jon Lee Update data reporting and analysis https://bugs.webkit.org/show_bug.cgi?id=152670 Reviewed by Simon Fraser. Show new graph data. Provide controls to show different series data. Provide an interactive cursor that shows the data at a given sample. * Animometer/developer.html: Add a nav section in #results. Each part of the graph has a checkbox for visual toggling, as well as companion spans to contain the data. The numbers will always be shown even if the SVG isn't. * Animometer/resources/debug-runner/animometer.css: (#suites): Adjust spacing when doing fixed complexity. (#test-graph nav): Place the nav in the upper right corner. (#test-graph-data > svg): Fix the FPS scale from 0-60. It makes the raw FPS goes past that scale. Allow it to show. (.target-fps): Add a dotted line for where the benchmark is supposed to settle for FPS. (#cursor line): The cursor contains a line and highlight circles for the data being shown. (#cursor circle): (#complexity path): This and rules afterward are named by series type. (#complexity circle): (#filteredFPS path): (#filteredFPS circle): (#rawFPS path): (#intervalFPS circle): (.left-samples): Deleted. (.right-samples): Deleted. * Animometer/resources/debug-runner/animometer.js: (initialize): Add a "changed" listener when the checkboxes change in the nav. (onBenchmarkOptionsChanged): Renamed. (showTestGraph): All graph data is passed in as graphData instead of as arguments. * Animometer/resources/debug-runner/graph.js: Extend BenchmarkController. When showing a new graph, call updateGraphData(). It creates all of the d3 graphs. onGraphOptionsChanged() toggles the data on and off. (updateGraphData): Add the axes. Add the average lines and markers for sample time and target FPS. Add the cursor group. Use helper function addData() to add the data. On top of everything add a transparent area which will catch all of the mouse events. When the mouse moves in the graph, find the closest data point, show the data in the nav area, and highlight the data points. (addData): Adds a line and circle for each data point. Also adds a highlight cursor with a size a little larger than the circle radius for the data points. (onGraphOptionsChanged): Called when data is visually toggled. (showOrHideNodes): Helper function to toggle the .hidden class. * Animometer/resources/extensions.js: (ResultsDashboard.prototype.get data): Get rid of the arguments for _processData. (ResultsTable.prototype._addGraphButton): Shove all of the graph data into a singular object. Producing the JSON can take a while with all of the data. Make it on-demand with a button. * Animometer/resources/debug-runner/animometer.js: (showResults): When showing the results, don't serialize the JSON data. Move that to... (showJSONResults): ...here. Remove the button. * Animometer/developer.html: Add a button. The button will remove itself and populate the textarea with the JSON data. * Animometer/resources/debug-runner/animometer.css: (.hidden): Add a universal hidden class. (#results button.small-button): Promote the small-button styles to the whole results section for use in the JSON button. (#results button.small-button:active): (#results-data button.small-button): Deleted. (#results-data button.small-button:active): Deleted. Refactor how Animator does its recording. * Animometer/tests/resources/math.js: Create a new, simple estimator that just returns the same interval frame rate for adjustment. * Animometer/tests/resources/main.js: (Animator): Remove _dropFrameCount, and make variables more accurate described. (Animator.prototype.initialize): Use the identity estimator instead of using a bool. (Animator.prototype._intervalTimeDelta): Rename, only used internally. (Animator.prototype._shouldRequestAnotherFrame): Assume we drop one frame for adjustment of the scene. If we are within the number of frames to measure for the interval, just record the timestamp. Otherwise we are ready to evaluate and adjust the scene. Record the interval frame rate and the estimator's frame rate. Avoid processing the data through the Experiment while the test is running. Reconfigure the sampler to just record the raw samples. After the test is done, run the samples through the Experiment to get the score. * Animometer/resources/sampler.js: (Experiment): Fold _init() into the constructor since nobody else will call it. This is not needed until the test concludes, so remove startSampling(). Clients should just call sample(). (Sampler): Pre-allocate arrays given the number of data points being recorded, and a capacity of how many samples will be used. The processor is a called when it's time to process the data since that is the client also telling the Sampler what to record. Introduce the notion of marks as well, which allows the client to mark when an event occurs. When we mark sample start, we can attach the timestamp there, instead of storing it separately. (Sampler.prototype.startSampling): Deleted. Clients should just call record(). (Sampler.prototype.record): The data to record is passed in as variable arguments. (Sampler.prototype.mark): When adding a mark, a client needs to provide a unique string, and can provide extra data object for later retrieval. (Sampler.prototype.process): Renamed from toJSON. Trim the sampling arrays to what was used. Call the processor to process the samples. * Animometer/resources/debug-runner/benchmark-runner.js: (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Call process(). * Animometer/resources/strings.js: Add some new strings, remove the graph ones since they are not used. * Animometer/tests/resources/main.js: (Benchmark): Create a sampler with 4 series. The maximum number of points expected is the number of seconds multiplied by 60 fps. Benchmark, as a client of the Sampler, knows about all of the data being added to the Sampler. It is added through record(), and processed through processSamples(). (Benchmark.prototype.update): Mark when we've passed warmup and are starting to sample. Include the timestamp in the custom data for the mark. This avoids the need to store is separately in the Sampler. Fold what was in record() here, since nothing else needs this functionality. record() now just relays the information to the sampler. (Benchmark.prototype.record): Called by Animator, which provides the data to the sampler. Animator's calls to this is part of a later patch. Requires each stage to return its complexity. (Benchmark.prototype.processSamples): If the sampling mark exists, add it to the results. Go through all of the samples. All samples contain a timestamp and complexity. We calculate "raw FPS" which is the time differential from the previous sample. At regular intervals the Kalman-filtered FPS and the interval average FPS are also recorded. We also create two experiments, to get the scores for the complexity and smoothed FPS, and add those samples to the experiments. Grab those scores and add them into results also. Add complexity() to the tests for Benchmark.record(). * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: * Animometer/tests/misc/resources/canvas-electrons.js: * Animometer/tests/misc/resources/canvas-stars.js: * Animometer/tests/text/resources/layering-text.js: 2015-12-27 Jon Lee Simplify the test harness https://bugs.webkit.org/show_bug.cgi?id=152562 Reviewed by Simon Fraser. Update the simple canvas tests. For the paths, start from the center instead of the top-left corner. Instead of using a coordinate limit, use a canonized factor, and use that along both the x and y axes, so that more capable tests use more of the canvas. * Animometer/tests/simple/resources/simple-canvas-paths.js: (CanvasLinePoint): Rewrite to use the coordinate maximum factor. (CanvasQuadraticPoint): Ditto. (CanvasBezierPoint): Ditto. * Animometer/tests/simple/resources/simple-canvas.js: (tune): Calculate a factor instead of a maximum coordinate. 2015-12-27 Jon Lee Simplify the test harness https://bugs.webkit.org/show_bug.cgi?id=152562 Reviewed by Simon Fraser. All of the benchmarks use the default Animator(). Don't require new tests to pass a new instance, and instead just make one in the Benchmark constructor. * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js: * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js: * Animometer/tests/master/resources/canvas-tests.js: * Animometer/tests/misc/resources/canvas-electrons.js: * Animometer/tests/misc/resources/canvas-stars.js: * Animometer/tests/misc/resources/compositing-transforms.js: * Animometer/tests/resources/main.js: * Animometer/tests/simple/resources/simple-canvas-paths.js: * Animometer/tests/template/resources/template-canvas.js: * Animometer/tests/template/resources/template-css.js: * Animometer/tests/template/resources/template-svg.js: * Animometer/tests/text/resources/layering-text.js: * Animometer/tests/text/resources/text-boxes.js: Refactor the template. * Animometer/tests/template/resources/template-canvas.js: * Animometer/tests/template/resources/template-css.js: * Animometer/tests/template/resources/template-svg.js: * Animometer/tests/template/template-canvas.html: * Animometer/tests/template/template-css.html: * Animometer/tests/template/template-svg.html: Refactor the SVG suite. * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Move scripts to the end. * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto. * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Remove extraneous includes to stage.js. * Animometer/tests/text/text-boxes.html: Ditto. BouncingCanvasParticlesBenchmark is not necessary. Use Benchmark directly when subclassing. * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Remove BouncingCanvasParticlesBenchmark. * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Use Benchmark. * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Ditto. * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: Require the shape in the constructor instead of having subclasses set the private variable. * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: Refactor. * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js: Refactor the HTML suite. Move scripts to the end. * Animometer/tests/bouncing-particles/bouncing-css-images.html: * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: * Animometer/tests/text/layering-text.html: * Animometer/tests/text/text-boxes.html: Refactor to use the new variables. * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js: * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: * Animometer/tests/text/resources/layering-text.js: * Animometer/tests/text/resources/text-boxes.js: Refactor the bouncing canvas tests. * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Move scripts to the end. * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Move scripts to the end. * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Promote a few properties to "public" since they are used by subclasses. (BouncingParticlesStage): Fix the constructor, which was missing "this". Make particles "public" for subclasses. (BouncingParticlesStage.initialize): Fix the max velocity, which was accidentally changed. * Animometer/tests/misc/resources/compositing-transforms.js: Refactor. * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: BouncingCanvasParticlesAnimator is no longer needed. (BouncingCanvasParticle): Change constructor to take a shape as a parameter instead of having subclasses set the variable. * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Refactor. * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Refactor. Move example/ files into misc/. * Animometer/tests/misc/canvas-electrons.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-electrons.html. * Animometer/tests/misc/canvas-stars.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-stars.html. * Animometer/tests/misc/resources/canvas-electrons.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-electrons.js. * Animometer/tests/misc/resources/canvas-stars.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-stars.js. * Animometer/resources/debug-runner/tests.js: Update test URLs. Refactor miscellaneous suite. * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Remove BouncingParticlesAnimator and BouncingParticleBenchmark, which are not needed. (tune): Remove console assert. * Animometer/tests/resources/main.js: Add Rotater back in from stage.js. * Animometer/tests/examples/resources/canvas-electrons.js: Remove CanvasElectronsAnimator. * Animometer/tests/examples/resources/canvas-stars.js: Remove CanvasStarsAnimator. * Animometer/tests/misc/resources/compositing-transforms.js: * Animometer/tests/examples/canvas-electrons.html: Move scripts to the end. * Animometer/tests/examples/canvas-stars.html: Ditto. * Animometer/tests/misc/compositing-transforms.html: Ditto. Refactor the simple suite. * Animometer/tests/master/resources/canvas-stage.js: (tune): Remove coordinateMaximum since it is not needed in any of the master tests. * Animometer/tests/simple/resources/simple-canvas.js: SimpleCanvasAnimator and SimpleCanvasBenchmark are no longer needed. (tune): Manage the objects differently, but instead of duplicating all of SimpleCanvasStage here, just replace tune(). Include coordinateMaximum, and remove items from the end of the list instead of the beginning. (StageBenchmark.call.createAnimator): Deleted. (StageBenchmark.call): Deleted. * Animometer/tests/simple/resources/simple-canvas-paths.js: * Animometer/tests/simple/simple-canvas-paths.html: Move scripts to the end. Get rid of stage.js, StageAnimator, and StageBenchmark. Don't have the progress bar update during the test. * Animometer/resources/debug-runner/animometer.js: (initialize): Move the setting of testsCount to the debug runner. (didRunTest): Nicer name. * Animometer/resources/debug-runner/benchmark-runner.js: (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Don't pass in the progress bar to benchmarks. * Animometer/resources/extensions.js: (ProgressBar): Refactor. Make variables "private". Resetting the progress when instantiating. (ProgressBar.prototype.incrementRange): This is called every time a benchmark completes. * Animometer/resources/runner/animometer.js: (window.benchmarkRunnerClient.initialize): Remove unneeded setting of testsCount. * Animometer/resources/strings.js: These are no longer needed. * Animometer/tests/master/canvas-stage.html: Remove script inclusion. Other tests will follow. * Animometer/tests/master/resources/canvas-tests.js: Use Benchmark instead of StageBenchmark. * Animometer/tests/resources/main.js: Messages are no longer needed (Animator.prototype._shouldRequestAnotherFrame): Rename from animate(), since this method returns a boolean indicating whether another frame should be requested. Collapse the logic from StageAnimator into animateLoop. (BenchmarkState.prototype.currentStage): Deleted. (BenchmarkState.prototype.currentMessage): Deleted. (BenchmarkState.prototype.currentProgress): Deleted. (Animator.prototype.animate): Deleted. (Animator.prototype.animateLoop): The stage is animated only when we have another frame to draw. (Benchmark.prototype.record): No need to update the progress bar. * Animometer/tests/resources/stage.js: Removed. Rotater will appear in a later patch, in main.js. * Animometer/resources/debug-runner/benchmark-runner.js: (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Each test is run as a benchmark. Remove the call to runBenchmark by merging the options here, and calling benchmark.run() directly. Make the class relationships more easily understandable. The benchmark owns the stage, animator, and options. Make the stage and animator no longer have their own references to the options. Make Stage a first-class citizen by promoting it to main.js. Later patches will try to get rid of stage.js altogether. * Animometer/tests/resources/main.js: (Stage): Moved from stage.js. (Animator): Don't pass in benchmark and options in its constructor. It will get initialized by benchmark-related parameters in initialize(). (Animator.prototype.initialize): Add a back-reference to benchmark and cache an option. (Animator.prototype.get benchmark): (Animator.prototype.animate): Refactor to use the cached option, to remove its dependency on the options dictionary. (Benchmark): Require all benchmarks to have a stage and animator. The instance will initialize them. (Benchmark.prototype.get options): (Benchmark.prototype.get stage): BenchmarkStates.stages will need to be renamed to avoid confusion. (Benchmark.prototype.get animator): (Benchmark.prototype.start): (Benchmark.prototype.update): Ask the stage directly to tune or clear instead of adding another level of indirection. (window.runBenchmark): Deleted. Remove the need for a benchmarkClient. Also remove the standalone path, since tests can be individually selected, and remove the need for runBenchmark since that is handled in BenchmarkRunner._runBenchmarkAndRecordResults. * Animometer/tests/resources/stage.js: (Stage): Deleted. Moved to main.js. (StageBenchmark): What's left is updating the progress bar; to be removed. (StageAnimator): What's left can be folded in Animator. Refactor master suite. * Animometer/tests/master/resources/canvas-stage.js: This now only has SimpleCanvasStage. (animate): Push the clearRect() into each stage. (complexity): (StageBenchmark.call.createAnimator): Deleted. (StageBenchmark.call): Deleted. * Animometer/tests/master/resources/canvas-tests.js: SimpleCanvasPathStrokeStage is no longer needed. (CanvasLineSegment.prototype.draw): (CanvasArc): (CanvasLinePoint): Remove the draw call because depending on its index it either needs to be moveTo or lineTo, and it is otherwise a very small draw operation that doesn't need the overhead of the function call. Do all of the drawing through the stage. Refactor the subclass pattern. Introduce Utilities.createSubclass(). * Animometer/resources/debug-runner/benchmark-runner.js: * Animometer/resources/extensions.js: (window.Utilities.createSubclass): Takes the super class, a function representing the class's constructor, and additional methods to attach to the new class's prototype object. * Animometer/tests/text/text-boxes.html: Remove unneeded reference to utilities.js. Refactor tests. * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js: * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js: * Animometer/tests/examples/resources/canvas-electrons.js: * Animometer/tests/examples/resources/canvas-stars.js: * Animometer/tests/master/resources/canvas-stage.js: * Animometer/tests/master/resources/canvas-tests.js: * Animometer/tests/misc/resources/compositing-transforms.js: * Animometer/tests/resources/stage.js: * Animometer/tests/simple/resources/simple-canvas-paths.js: * Animometer/tests/simple/resources/simple-canvas.js: * Animometer/tests/template/resources/template-canvas.js: * Animometer/tests/template/resources/template-css.js: * Animometer/tests/template/resources/template-svg.js: * Animometer/tests/text/resources/layering-text.js: Reorder some of the methods and properties since they rely on each other. * Animometer/tests/text/resources/text-boxes.js: * Animometer/resources/debug-runner/animometer.js: Arrange calls in the order they are evoked. * Animometer/resources/debug-runner/benchmark-runner.js: (BenchmarkRunnerState.prototype.next): Get rid of return value since no caller to next() uses it. (BenchmarkRunnerState.prototype.prepareCurrentTest): Refactor the promise to resolve simply when onload() is called instead of looking for #stage. (BenchmarkRunner.prototype._runTestAndRecordResults): Suite.run simply calls runBenchmark(). Call it directly rather than through the Suite. (BenchmarkRunner.prototype.step): Remove unused parameter in resolve callback. (BenchmarkRunner.prototype.runMultipleIterations): Use this instead of self since it is outside of the closure which needed the self variable. (resolveIfReady): Deleted. (BenchmarkRunner.prototype.waitForElement): Deleted. * Animometer/resources/runner/tests.js: prepare() and run() are no longer needed. (Suite.prototype.prepare): Deleted. (Suite.prototype.run): Deleted. * Animometer/tests/master/canvas-stage.html: Move all scripts to the end of the page. 2015-12-23 Simon Fraser Add an Animometer developer test which animates text-rich boxes https://bugs.webkit.org/show_bug.cgi?id=152544 Reviewed by Zalan Bujtas. Add a test that draws lots of international text. This is a particle test, moving the boxes around with absolution positioning. * Animometer/resources/debug-runner/tests.js: * Animometer/tests/text/resources/text-boxes.js: Added. (BouncingTextBox): (BouncingTextBox.prototype._move): (BouncingTextBox.prototype.animate): (BouncingTextBoxStage): (BouncingTextBoxStage.prototype.createParticle): (BouncingTextBoxStage.prototype.particleWillBeRemoved): (BouncingTextBoxsBenchmark): (BouncingTextBoxsBenchmark.prototype.createStage): (window.benchmarkClient.create): * Animometer/tests/text/text-boxes.html: Added. 2015-12-23 Jon Lee Split benchmark into two different pages https://bugs.webkit.org/show_bug.cgi?id=152458 Reviewed by Simon Fraser. Add tests to 'animometer' suite. * Animometer/resources/runner/tests.js: * Animometer/tests/master/canvas-stage.html: Added. * Animometer/tests/master/resources/canvas-stage.js: Added. * Animometer/tests/master/resources/canvas-tests.js: Added. * Animometer/tests/master/resources/stage.css: Added. 2015-12-23 Jon Lee Split benchmark into two different pages https://bugs.webkit.org/show_bug.cgi?id=152458 Reviewed by Simon Fraser. Address comments. * Animometer/resources/debug-runner/benchmark-runner.js: (BenchmarkRunner.prototype._runTestAndRecordResults): When the testing is complete the frame owning the sampler goes away, and a later call to get the JSON data is no longer available. Process the data right here, instead, and just reference it when displaying the results in ResultsDashboard.prototype._processData. * Animometer/resources/extensions.js: (Array.prototype.fill.Array.prototype.fill): Add a null check. Remove braces around single-line clause. (Array.prototype.find.Array.prototype.find): Update the null check. (ResultsDashboard.prototype._processData): Use the already-processed data. * Animometer/resources/runner/animometer.css: (.frame-container > iframe): Remove calc(). Move Array functions to extensions.js since that is included by the harness. Add ES6 Array polyfills. * Animometer/resources/algorithm.js: (Array.prototype.swap): Moved to extensions.js. * Animometer/resources/extensions.js: (Array.prototype.swap): (Array.prototype.fill): Added. (Array.prototype.find): Added. Adjust styles for iPad. * Animometer/resources/runner/animometer.css: (@media screen and (min-device-width: 768px)): Apply to iPad as well. (@media screen and (max-device-width: 1024px)): Update width for iPads. Adjustment styles for iOS. * Animometer/developer.html: Different divs contain the iframe, so use a class instead and update the style rules. * Animometer/index.html: * Animometer/resources/debug-runner/animometer.css: Remove extraneous rules. (@media screen and (min-device-width: 1800px)): Move this up. * Animometer/resources/runner/animometer.css: Add rules to accomodate iOS. Get rid of prefixed flex properties for now. * Animometer/resources/debug-runner/animometer.css: * Animometer/resources/runner/animometer.css: Update the structure of the harness. Remove the JSON-per-test but keep the JSON of the whole test run. Use the full page in order to display the graph. * Animometer/developer.html: Update several of the JS file includes to UTF-8. Remove header and footer. Test results screen includes score, average, and worst 5% statistics. * Animometer/index.html: Make structure similar to developer.html. * Animometer/resources/debug-runner/animometer.css: Remove most of the button rules since they are superfluous. Move the progress bar to the top, fixed. Update the results page rules. * Animometer/resources/debug-runner/animometer.js: Remove most of the additions to sectionsManager since they are no longer needed. (setSectionHeader): Updates header of the section. (window.suitesManager._updateStartButtonState): Update selector. (showResults): Add keypress event for selecting different data for copy/paste. Update how the results are populated. Include full test JSON in a textarea, rather than requiring a button press. (showTestGraph): * Animometer/resources/debug-runner/tests.js: Update structure of Headers. Define different kinds of headers. Headers can control their title, and the text used as the cell contents, including class name. * Animometer/resources/extensions.js: (ResultsTable): Update to include a flattened version of the headers, used while populating table contents. Remove unneeded helper functions for creating the table. Rename "show" to "add". * Animometer/resources/runner/animometer.css: Update rules to accommodate the new structure. * Animometer/resources/runner/animometer.js: (window.sectionsManager.setSectionScore): Helper function to set the score and mean for a section. (window.sectionsManager.populateTable): Helper function to set the table. (window.benchmarkController.showResults): Refactor. (window.benchmarkController.selectResults): Update selectors. * Animometer/resources/runner/tests.js: Set Headers. Debug harness extends it. Update debug runner to have similar names to the basic runner. Include that page's CSS and remove extraneous CSS rules. Get rid of the statistics table #record. * Animometer/developer.html: Rename #home to #intro. Rename .spacer to hr. * Animometer/resources/debug-runner/animometer.css: Set to flexbox when selected. * Animometer/resources/debug-runner/animometer.js: Remove recordTable. (window.suitesManager._updateStartButtonState): Update selector to #intro. (setupRunningSectionStyle): Deleted. * Animometer/resources/runner/animometer.css: (#test-container.selected): Change to flex-box only when visible. Remove recordTable. * Animometer/resources/debug-runner/benchmark-runner.js: (BenchmarkRunner.prototype._runTestAndRecordResults): * Animometer/resources/runner/tests.js: * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js: * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js: * Animometer/tests/examples/resources/canvas-electrons.js: * Animometer/tests/examples/resources/canvas-stars.js: * Animometer/tests/misc/resources/compositing-transforms.js: * Animometer/tests/resources/main.js: * Animometer/tests/resources/stage.js: (StageBenchmark): Remove _recordTable. * Animometer/tests/simple/resources/simple-canvas-paths.js: * Animometer/tests/simple/resources/simple-canvas.js: * Animometer/tests/template/resources/template-canvas.js: * Animometer/tests/template/resources/template-css.js: * Animometer/tests/template/resources/template-svg.js: * Animometer/tests/text/resources/layering-text.js: * Animometer/resources/debug-runner/animometer.js: (willStartFirstIteration): Fix selector, since results-table is used in multiple places, so it cannot be an id. Make it possible to select the scores, or the whole table data, by cycling through different selections through key press of 's'. * Animometer/resources/runner/animometer.js: (window.benchmarkController.showResults): Attach a keypress handler if it hasn't been added already. (window.benchmarkController.selectResults): * Animometer/resources/runner/tests.js: Cycle through different ranges. Fix a few fly-by errors. * Animometer/resources/debug-runner/benchmark-runner.js: (BenchmarkRunnerState.prototype.prepareCurrentTest): Update the frame relative path since the files are now in the top directory instead of inside runner/. (BenchmarkRunner.prototype._runTestAndRecordResults): Incorrect reference to function. (BenchmarkRunner.prototype.step): Member variable is never used. A little stylistic cleanup. * Animometer/resources/debug-runner/benchmark-runner.js: * Animometer/resources/extensions.js: (window.DocumentExtension.createElement): * Animometer/tests/resources/main.js: (Benchmark.prototype.record): * Animometer/tests/resources/stage.js: (StageBenchmark.prototype.showResults): Reverse progress and message. The message appears less frequently than the progress. * Animometer/tests/simple/resources/simple-canvas.js: (SimpleCanvasBenchmark): Remove unused options. Add newer version of harness in a new page. Consolidate differences between the two pages. * Animometer/developer.html: Include runner/animometer.js. Rename the JS function to run the benchmark to startBenchmark() instead of startTest(). Rename #running to #test-container. * Animometer/index.html: Added. Similarly calls startBenchmark() and has #test-container. * Animometer/resources/debug-runner/animometer.css: Make the canvas 2:1 (1200px x 800px) instead of 4:3. Split out benchmarkRunnerClient and benchmarkController. * Animometer/resources/debug-runner/animometer.js: Move needed functions out of benchmarkRunnerClient, and leave the rest here to extend that object. Get rid of _resultsTable and move populating the results table into benchmarkController. Rename _resultsDashboard to results and make it accessible for other objects to use. (willAddTestFrame): This is unnecessary. Remove. (window.sectionsManager.showScore): Grab it from the results object instead of benchmarkRunnerClient. (window.sectionsManager.showSection): Deleted. Moved to runner/animometer.js. (window.benchmarkController._runBenchmark): Deleted. Mostly moved into _startBenchmark. (window.benchmarkController.startBenchmark): Refactor to call _startBenchmark. (window.benchmarkController.showResults): Include most of benchmarkRunnerClient.didFinishLastIteration() here. * Animometer/resources/debug-runner/benchmark-runner.js: (BenchmarkRunner.prototype._appendFrame): Remove unneeded call to willAddTestFrame. * Animometer/resources/extensions.js: (ResultsDashboard): Change the class to process the sampler data on-demand and hold onto that data for later referencing. (ResultsDashboard.prototype.toJSON): Deleted. (ResultsDashboard.prototype._processData): Rename toJSON to _processData since it's not really outputting JSON. Store the processed data into a member variable that can be referenced later. (ResultsDashboard.prototype.get data): Process the data if it hasn't already. (ResultsDashboard.prototype.get score): Process the data if it hasn't already, then return the aggregate score. (ResultsTable.prototype._showHeader): When outputting the results to a table, don't force the need for an empty children array. This was to allow for a header row in the table that spanned multiple columns. In the simpler harness, this is not needed. (ResultsTable.prototype._showEmptyCells): (ResultsTable.prototype._showTest): This hardcoded the columns. At least for the name and score, which is the bare minimum needed for the simpler harness, key off of the header name provided. * Animometer/resources/runner/animometer.css: Added. Use a similar 2:1 ratio. The score tables are split into the data and the headers, and are also displayed RTL so that a later patch allows a user to copy-paste the data easily. * Animometer/resources/runner/animometer.js: Added. Use a simpler version of benchmarkRunnerClient. The debug harness will extend these classes. (window.benchmarkController._startBenchmark): Used by both harnesses. (window.benchmarkController.startBenchmark): Set hard-coded options. (window.benchmarkController.showResults): Includes most of benchmarkRunnerClient.didFinishLastIteration() here. Get rid of utilities.js. Move it all into extensions.js. * Animometer/resources/extensions.js: * Animometer/tests/resources/utilities.js: Removed. * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Remove script link. * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Ditto. * Animometer/tests/bouncing-particles/bouncing-css-images.html: Ditto. * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: Ditto. * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Ditto. * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto. * Animometer/tests/examples/canvas-electrons.html: Ditto. * Animometer/tests/examples/canvas-stars.html: Ditto. * Animometer/tests/misc/compositing-transforms.html: Ditto. * Animometer/tests/simple/simple-canvas-paths.html: Ditto. * Animometer/tests/template/template-canvas.html: Ditto. * Animometer/tests/template/template-css.html: Ditto. * Animometer/tests/template/template-svg.html: Ditto. * Animometer/tests/text/layering-text.html: Ditto. Split tests.js into two. Add a new suite to runner/tests.js. * Animometer/developer.html: Update the script order. Scripts from debug-runner/ will always build on those from runner/, and have the same name. * Animometer/resources/debug-runner/tests.js: Move "complex examples" suite into "miscellaneous tests". (Suite): Deleted. (Suite.prototype.prepare): Deleted. (Suite.prototype.run): Deleted. (suiteFromName): Deleted. * Animometer/resources/runner/tests.js: Added. Take definitions and functions needed by the test harness. Leave the test suites behind. (Suite): Moved from debug script. (Suite.prototype.prepare): Ditto. (Suite.prototype.run): Ditto. (suiteFromName): Ditto. (testFromName): Ditto. Move benchmark resources out into resources/debug-runner, and update URLs. * Animometer/developer.html: Renamed from PerformanceTests/Animometer/runner/animometer.html. * Animometer/resources/debug-runner/animometer.css: Renamed from PerformanceTests/Animometer/runner/resources/animometer.css. * Animometer/resources/debug-runner/animometer.js: Renamed from PerformanceTests/Animometer/runner/resources/animometer.js. * Animometer/resources/debug-runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/runner/resources/benchmark-runner.js. * Animometer/resources/debug-runner/d3.min.js: Renamed from PerformanceTests/Animometer/runner/resources/d3.min.js. * Animometer/resources/debug-runner/graph.js: Renamed from PerformanceTests/Animometer/runner/resources/graph.js. * Animometer/resources/debug-runner/tests.js: Renamed from PerformanceTests/Animometer/runner/resources/tests.js. 2015-12-11 Jon Lee Improve Animometer on iOS https://bugs.webkit.org/show_bug.cgi?id=152180 Reviewed by Simon Fraser. Improve experience on phones. Make the canvas take up the whole screen. * Animometer/runner/animometer.html: Add meta viewport. Remove the container div. * Animometer/runner/resources/animometer.css: Have buttons lay out vertically. Update detail arrow glyph. Make the suites and options section lay out vertically. Remove the top spacers since we want the canvas to take over the whole screen. Minimal display is recommended for use. 2015-12-07 Jon Lee Update suites for benchmark https://bugs.webkit.org/show_bug.cgi?id=151957 Reviewed by Simon Fraser. * Animometer/runner/animometer.html: Use spacers instead of relying on justify-content center to center the content. That allows the opening screen to grow downward when expanding the list of choices, otherwise it expands from the center, and off the top edge of the screen. * Animometer/runner/resources/animometer.css: (.tree): Don't overflow scroll. (.tree > li > label.tree-label:before): Use better glyphs. (.tree > li > :checked ~ label.tree-label:before): (main): Using flex-start for justify-content so that if the section grows too big it gets pinned to the top edge of the document instead of growing past it. (.spacer): Make the spacers have a minimum 20px and grow evenly. (section#home): Add a min-height so that the border will expand if the suite tests shown make the section grow past the height. * Animometer/runner/resources/animometer.js: Update the selectors. (window.suitesManager._treeElement): (window.suitesManager._suitesElements): (window.suitesManager._editsElements): 2015-12-07 Jon Lee Update options for benchmark https://bugs.webkit.org/show_bug.cgi?id=151956 Reviewed by Simon Fraser. Move "Fix test complexity" and "Adaptive" checkboxes into a radio group. Move "Show running results" into a radio group, and add options to remove the HUD. * Animometer/runner/animometer.html: Get rid of the preamble. Wrap the options in a form for easier referencing in JS. * Animometer/runner/resources/animometer.css: Show the surrounding border if the body's display-minimal class name is set. * Animometer/runner/resources/animometer.js: Update the way optionsManager gets and sets default values. Include support for radio groups. (window.optionsManager.valueForOption): (window.optionsManager.updateUIFromLocalStorage): (window.optionsManager.updateLocalStorageFromUI): (window.benchmarkRunnerClient.willStartFirstIteration): (window.sectionsManager.setupRunningSectionStyle): (window.suitesManager._treeElement): Fly-by whitespace fix. (window.suitesManager._suitesElements): Ditto. (window.suitesManager.updateEditsElementsState): Update options check. (window.suitesManager.updateDisplay): Add a new update function for the HUD. Attach a class to the body depending on the user's choice. (window.benchmarkController.initialize): Add an event listener when the form radio buttons update. (window.benchmarkController.onFormChanged): (window.optionsManager._optionsElements): Deleted. (window.optionsManager._adaptiveTestElement): Deleted. (window.benchmarkController.onChangeAdaptiveTestCheckbox): Deleted. * Animometer/tests/resources/main.js: (Benchmark.prototype.update): Update options checks. * Animometer/tests/resources/stage.js: Update option check. (StageBenchmark.prototype.showResults): 2015-12-01 Simon Fraser Add a basic compositing Animometer test https://bugs.webkit.org/show_bug.cgi?id=151724 Reviewed by Dean Jackson. Add a "bouncing particles" test that moves composited layers around, optionally with a filter. This is added under a new "Miscellaneous" category. Remove the test templates category from the UI. * Animometer/runner/resources/tests.js: * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: (BouncingCssShape.prototype.animate): * Animometer/tests/misc/compositing-transforms.html: Added. * Animometer/tests/misc/resources/compositing-transforms.js: Added. (BouncingCompositedImage): (BouncingCompositedImage.prototype._move): (BouncingCompositedImage.prototype.animate): (CompositingTransformsStage): (CompositingTransformsStage.prototype.createParticle): (CompositingTransformsStage.prototype.particleWillBeRemoved): (CompositedTransformsBenchmark): (CompositedTransformsBenchmark.prototype.createStage): (window.benchmarkClient.create): 2015-11-30 Said Abou-Hallawa Fix the graphics benchmark complexity bounds adjustment https://bugs.webkit.org/show_bug.cgi?id=151670 Reviewed by Simon Fraser. Make sure the graphics benchmark complexity bounds adjustment is applied to the absolute lower bound. * Animometer/tests/resources/math.js: (PIDController.prototype._saturate): 2015-11-30 Said Abou-Hallawa Add an option to select the results form the graphics benchmark https://bugs.webkit.org/show_bug.cgi?id=151666 Reviewed by Ryosuke Niwa. We need an easy way to select the graphics benchmark results table such that when it is copied to the clipboard, rich text format is set to the clipboard. * Animometer/runner/animometer.html: Add a new button to select the results table or JSON. * Animometer/runner/resources/animometer.js: (window.sectionsManager._sectionDataElement): Selects the container element. (window.sectionsManager._sectionDataDivElement): Replace a literal string with a string table entry. (window.sectionsManager.showTestName): Replace a literal string with a string table entry. (window.sectionsManager.selectData): Selects the container element in a selection. (window.sectionsManager.selectDataContents): Select the contents of container element in a selection. (window.benchmarkController.selectResults): Selects the results table. (window.benchmarkController.showJSON): Function rename. (window.benchmarkController.selectJSON): Selects the contents of the results JSON. (window.benchmarkController.showJson): Deleted. 2015-11-20 Simon Fraser Animometer: graphs should not do interpolation https://bugs.webkit.org/show_bug.cgi?id=151526 Reviewed by Simon Fraser. Having the graphs do interpolation is misleading, because you can't see the actual data. Also remove "shape-rendering: crispEdges;" so the lines get antialiased. * Animometer/runner/resources/animometer.css: (section#test-graph > data > svg): Deleted. * Animometer/runner/resources/graph.js: (graph): Deleted. 2015-11-19 Said Abou-Hallawa Calculate the graphics benchmark test gain adaptively https://bugs.webkit.org/show_bug.cgi?id=151208 Reviewed by Darin Adler. We need to calculate the gain of the graphics benchmark tests adaptively and get rid of the gain and limits parameters we have to choose manually for every test. We are going to use the classic Ziegler–Nichols method for calculating the gain and integral and derivative times. We are going to try moving on a cubic curve during the manual stage from y0 to reach ysp. We also going to use a saturation actuator to ensure the system does not fluctuate. * Animometer/resources/extensions.js: (ResultsTable.prototype._isNoisyMeasurement): Fix a parameter name. (ResultsTable.prototype._isNoisyTest): Since score is a member of testResults, we need to limit our search to frame rate and complexity. (ResultsTable.prototype._showTest): Pass the correct parameter to _isNoisyMeasurement(). * Animometer/resources/strings.js: Fix the indentation and name and value of a string. * Animometer/runner/resources/tests.js: Remove all the manual gains and limits parameters which had to be passed to every test. * Animometer/tests/resources/main.js: (BenchmarkState.prototype.currentStage): Fix an enum name. (Benchmark): Get rid of manual gain and limits. (Benchmark.prototype.update): Simplify the calculation by having all the times in ms. * Animometer/tests/resources/math.js: (PIDController): Get rid of the manual gain and limits and the magic numbers for Ti and Td. (PIDController.prototype._yPosition): Tells whether the test current output is moving towards the set-point or away from it. (PIDController.prototype._distanceUltimate): Calculates the ultimate distance from y0 after time t using a cubic formula. (PIDController.prototype._distance): Calculates the distance of y relative to y0. (PIDController.prototype._gainIncrement): Decides how much the proportional gain should be increased during the manual gain stage. (PIDController.prototype._updateStage): Updates the stage of the controller based on its current stage and the system output. (PIDController.prototype._tuneP): Tunes the system before calculating the PID controller gains. (PIDController.prototype._tunePID): PID tuning function. (PIDController.prototype._tune): (PIDController.prototype._saturate): (PIDController.prototype.tune): Manages calculating the controller parameters. It then returns a PID tuning value. (PIDController.prototype._sat): Deleted. We may need to return it back but the limits have to be calculated adaptively not manually. 2015-11-17 Said Abou-Hallawa Reorganize the graphics benchmark string table https://bugs.webkit.org/show_bug.cgi?id=151334 Reviewed by Simon Fraser. Make the graphics benchmark string table be an object of sub-objects. Each sub-object represents an associative array, the key is the string name and the value is the string data. * Animometer/resources/extensions.js: (ResultsDashboard.prototype.toJSON): (ResultsTable.prototype._showGraph): (ResultsTable.prototype._showJSON): (ResultsTable.prototype._isNoisyMeasurement): (ResultsTable.prototype._isNoisyTest): (ResultsTable.prototype._showTest): (ResultsTable.prototype._showSuite): (ResultsTable.prototype._showIteration): * Animometer/resources/sampler.js: (Sampler.prototype.toJSON): * Animometer/resources/strings.js: * Animometer/runner/resources/animometer.js: (window.benchmarkRunnerClient.didFinishLastIteration): (window.suitesManager.updateLocalStorageFromJSON): (window.benchmarkController.showResults): (window.benchmarkController.showJson): (window.benchmarkController.showTestGraph): (window.benchmarkController.showTestJSON): * Animometer/runner/resources/tests.js: * Animometer/tests/resources/main.js: 2015-11-17 Said Abou-Hallawa Disable flattening the stage iframe of the graphics benchmark when running on iOS https://bugs.webkit.org/show_bug.cgi?id=151361 Reviewed by Simon Fraser. Use fixed size for stage iframe of the graphics benchmark to disable flattening the iframe while animating the particles. Also ensure the bouncing particles do not go outside the iframe's boundaries. * Animometer/runner/resources/animometer.css: (section#running > #running-test > iframe): (@media screen and (min-device-width: 1800px)): * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: (BouncingParticle.prototype.animate): 2015-11-17 Said Abou-Hallawa Use the media queries to dynamically set the stage for the graphics benchmark https://bugs.webkit.org/show_bug.cgi?id=151327 Reviewed by Simon Fraser. Clean setting the benchmark css rules by using the media queries. Accessing document.stylesheets.cssRules seems to be unreliable. Fix the test harness load event listener invocation. And also remove the options for normalizing the stage resolution for retina display. * Animometer/resources/extensions.js: (window.DocumentExtension.insertCssRuleAfter): Deleted. * Animometer/runner/animometer.html: * Animometer/runner/resources/animometer.css: (@media screen and (min-device-width: 1800px)): * Animometer/runner/resources/animometer.js: (window.sectionsManager.setupRunningSectionStyle): (window.benchmarkController.initialize): (window.sectionsManager.setupSectionStyle): Deleted. * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: (BouncingParticlesStage): * Animometer/tests/text/layering-text.html: * Animometer/tests/text/resources/layering-text.js: (LayeringTextStage): (LayeringTextStage.prototype._setFontSize): Deleted. 2015-11-16 Said Abou-Hallawa Remove the option for animating using setInterval from the graphics benchmark https://bugs.webkit.org/show_bug.cgi?id=151283 Reviewed by Darin Adler. Get rid of the option to run animation using setInterval(). * Animometer/tests/resources/main.js: (Animator.prototype.animate): (Benchmark): (Benchmark.prototype.start): (Animator.prototype.start): Deleted. 2015-11-16 Said Abou-Hallawa Highlight the alarming test results in the graphics benchmark results page https://bugs.webkit.org/show_bug.cgi?id=151286 Reviewed by Simon Fraser. When showing the results of a test in the graphics benchmark the following criteria is going to be applied: 1. If the standard deviation of the test complexity or the frame rate is equal to or more than 10%, the standard deviation and the test name will be displayed in red. 2. If the average frame rate is not in the range = [(desired_frame_rate - 2) .. (desired_frame_rate + 2)], the average frame rate and the test name will be displayed in red. * Animometer/resources/extensions.js: (ResultsTable.prototype._showHeaderRow): (ResultsTable.prototype._showHeader): (ResultsTable.prototype._showEmptyCell): (ResultsTable.prototype._showText): (ResultsTable.prototype._showFixedNumber): (ResultsTable.prototype.): (ResultsTable.prototype._showGraph): (ResultsTable.prototype._showJSON): (ResultsTable.prototype._isAlarmingMeasurement): (ResultsTable.prototype._isAlarmingTestResults): (ResultsTable.prototype._showEmptyCells): (ResultsTable.prototype._showEmptyRow): (ResultsTable.prototype._showTest): (ResultsTable.prototype._showSuite): (ResultsTable.prototype._showIteration): (ResultsTable.prototype.showRecord): (ResultsTable.prototype.showIterations): (ResultsTable.prototype._showEmpty): Deleted. * Animometer/runner/resources/animometer.js: (window.benchmarkRunnerClient.didFinishLastIteration): * Animometer/tests/resources/stage.js: (StageBenchmark.prototype.showResults): 2015-11-16 Said Abou-Hallawa Clean referencing the options object in the graphics benchmark https://bugs.webkit.org/show_bug.cgi?id=151284 Reviewed by Simon Fraser. Get rid of the Benchmark.options member and rely only on the private member Benchmark._options. The animator need to have its own options member instead of accessing it from its reference to Benchmark object. * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: (BouncingCanvasParticlesAnimator): (BouncingCanvasParticlesBenchmark.prototype.createAnimator): * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: (BouncingParticle.prototype.animate): (BouncingParticlesAnimator): (BouncingParticlesBenchmark.prototype.createAnimator): * Animometer/tests/examples/resources/canvas-electrons.js: (CanvasElectronsStage.prototype.animate): (CanvasElectronsAnimator): (CanvasElectronsBenchmark.prototype.createAnimator): (window.benchmarkClient.create): * Animometer/tests/examples/resources/canvas-stars.js: (CanvasStarsStage.prototype.animate): (CanvasStarsAnimator): (CanvasStarsBenchmark.prototype.createAnimator): (window.benchmarkClient.create): * Animometer/tests/resources/main.js: (BenchmarkState.prototype.currentProgress): (Animator): (Animator.prototype.animate): (Benchmark): (Benchmark.prototype.update): * Animometer/tests/resources/stage.js: (Stage.prototype.clear): (StageAnimator): (StageBenchmark.prototype.createAnimator): (StageBenchmark.prototype.tune): (StageBenchmark.prototype.showResults): * Animometer/tests/simple/resources/simple-canvas.js: (SimpleCanvasStage.prototype.animate): (SimpleCanvasAnimator): (SimpleCanvasAnimator.prototype.animate): (SimpleCanvasBenchmark.prototype.createAnimator): * Animometer/tests/template/resources/template-canvas.js: (TemplateCanvasStage.prototype.animate): (TemplateCanvasBenchmark.prototype.createAnimator): (window.benchmarkClient.create): 2015-11-13 Said Abou-Hallawa Eliminate a request for layout every time an item is added to the stage of the graphics benchmark https://bugs.webkit.org/show_bug.cgi?id=151289 Reviewed by Simon Fraser. Cache the stage size when it is created instead of requesting every time an object is added via clientWidth and clientHeight. * Animometer/resources/extensions.js: (Insets.elementPadding): * Animometer/tests/resources/stage.js: (Stage): (Stage.prototype.get size): 2015-11-06 Said Abou-Hallawa Initialize the graphics benchmark's Kalman filter with estimated 60 FPS https://bugs.webkit.org/show_bug.cgi?id=150965 Reviewed by Darin Adler. This should give the benchmark more accurate reading at warmup time. And hence we can safely reduce the test running time to be 10 seconds. * Animometer/runner/animometer.html: Add "defer" back when loading resources/animometer.js since this script depends on many other scripts and we need to wait till the page is parsed. Also change the default test interval to be 10 seconds. * Animometer/runner/resources/graph.js: (graph): Make the test results curves smoother. * Animometer/tests/resources/main.js: (Animator): Initialize the Kalman filter with 60 FPS which should be true if the test page is empty. (Animator.prototype.animate): * Animometer/tests/resources/math.js: (KalmanEstimator): Fix the initial value of _vecX_est. _vecX_est[0] = current FPS (= 60FPS when the test page is empty) _vecX_est[1] = first time derivative of FPS (=0; FPS has been constant). _vecX_est[2] = second time derivative of FPS (=0; since _vecX_est[1]=0). (KalmanEstimator.prototype.estimate): Add some comments. 2015-11-04 Said Abou-Hallawa Remove "defer" from the scripts' references in the graphics benchmark home page https://bugs.webkit.org/show_bug.cgi?id=150915 Reviewed by Simon Fraser. It causes the benchmark to be very flakey. * Animometer/runner/animometer.html: 2015-11-01 Said Abou-Hallawa Add an option to make the graphics benchmark runs a specific test with fixed complexity https://bugs.webkit.org/show_bug.cgi?id=150529 Reviewed by Darin Adler. Beside each test in the suites tree, we are going to show the complexity arithmetic mean of the of the last run in an edit control. Based on a new option these edit controls will all be visible or hidden. If they are visible their values can be changed. The benchmark runner if it run in the non-adaptive mode will set the complexity of the test to the passed value and will not change it ever. The animator will animate the test and frame rate will also be measured. * Animometer/runner/animometer.html: Add a new option for the non-adaptive mode. * Animometer/runner/resources/animometer.css: (section#home input[type="number"]): Define the width of all the edit control in the section. (section#home > suites input[type="number"]): The edit controls in the box will be right aligned and hidden by default. (section#home > suites input[type="number"].selected): When the class "selected" is added, the edit controls will be visible. (section#home > options > label > input[type="number"]): Deleted. * Animometer/runner/resources/animometer.js: (window.benchmarkRunnerClient.didFinishLastIteration): Update the local storage with the results of each test. (window.optionsManager._adaptiveTestElement): Returns the checkbox for setting the adaptive test option. (window.suitesManager._editElement): Returns the edit element associated with each test element in the suites tree. (window.suitesManager._editsElements): Returns a list of all the elements in the box. (window.suitesManager._localStorageNameForTest): Change this function to take strings. (window.suitesManager._createTestElement): Adds an edit control beside each test. (window.suitesManager.updateEditsElementsState): Adds/Removes the 'selected' class to/from all the tests edit elements. (window.suitesManager.updateUIFromLocalStorage): Reads the edit control value from the local storage. (window.suitesManager.updateLocalStorageFromUI): Saves the edit control value to the local storage. (window.suitesManager.updateLocalStorageFromJSON): Saves the last run results to the local storage. (window.benchmarkController.initialize): Shows/Hides the test edit controls based on the adaptive test option. (window.benchmarkController.onChangeAdaptiveTestCheckbox): An onchange event handler for the adaptive test checkbox. * Animometer/tests/resources/main.js: (Benchmark.prototype.update): Fix the complexity of the test if the running mode is non-adaptive test and desired complexity is not zero. (window.runBenchmark): Add the test complexity as a new benchmark option. 2015-11-01 Said Abou-Hallawa Make the size of the benchmark canvas adaptive to the screen size and screen resolution https://bugs.webkit.org/show_bug.cgi?id=150530 Reviewed by Darin Adler. We want to set the size of the benchmark stage dynamically such that it depends on the screen resolution and the device scale factor. This patch does more than that because the home page css was not done properly. To use the flex box layout, the animometer.css has to be rewritten almost from scratch. The suites tree has to be rewritten also because it was not collapsing and with the flex box layout it was going outside of the window area. The options handling and the local storage handling had to be rewritten to allow more flexibility with this patch and the future patches. The code in animometer.js was reorganized into objects to allow distributing the code nicely among separate entities. * Animometer/resources/extensions.js: (Point.elementClientSize): Returns the client size of an HTMLElement as a Point object. (Insets.prototype.get width): Follow the function opening brace style guidelines. (Insets.prototype.get height): (Insets.prototype.get size): Returns the size of an Insets as a Point object. (window.DocumentExtension): Provides document helper functions. It should be assailable from the runner and the tests. (window.DocumentExtension.createElement): Creates an HTMLElement given its name, attributes and parentElement. (window.DocumentExtension.createSvgElement): Creates an SVGElement given its name, attributes and parentElement (moved from utilities.js). (window.DocumentExtension.insertCssRuleAfter): Inserts a CSS rule after an exiting rule given its text. (ResultsTable.prototype._showHeader): Use DocumentExtension functions. (ResultsTable.prototype._showGraph): Use DocumentExtension functions and create a real button for "Graph..." option. (ResultsTable.prototype._showJSON): Use DocumentExtension functions and create a real button for "JSON..." option. (Options): Deleted. * Animometer/runner/animometer.html: Restructure the page to use the flex box layout. * Animometer/runner/resources/animometer.css: (html,body): (button): (button.large-button):The large button appears in the animometer.html. (button.large-button:active): (button.large-button:disabled): (button.small-button): The small button appears in the results table. (button.small-button:active): (.tree): The tree class is used to list the suites and their tests. (.tree .expand-button): This button expands a tree element. (.tree .expand-button ~ ul): Hide the children (
    ...
) of a parent node by default. (.tree .expand-button:checked ~ ul): Show the children of a parent node only when checked. (.tree ul): Hide the list bullets. (.tree li): Indent every node in the tree relative to its parent. (.tree ul li): Indent all the non top level nodes only (the tests nodes in our case). (.tree > li:last-child): Do not indent the bottom of the last child node. (.tree-label): Style for all the labels in the tree. (label.tree-label): Style for the labels in the top level only (the suites nodes in our case). (label.tree-label:before): Style the unchecked case of the expand-button. (:checked ~ label.tree-label:before): Style the checked case of the expand-button. (table.results-table): The results table appears while running the test and at the end. (.results-table td): (.results-table th): (div.results-json): The JSON div appears per test or for the whole run. (main): This is the flex box container. (section): A section is displayed exclusively inside the
. It is hidden by default. (section.selected): When it is selected, its layout is flex layout. (section > footer): The header or the footer of a section should not take more than 15% of the container. (section#home): The home section has and parts to be laid out in the middle. (section#home > options): (section#home > suites): The should not take more than 40% of the width. (section#home > options > label): The benchmark title. (section#home > header > h2): The benchmark title. (section#home > options > label > input[type="number"]): Sets the width of the option edit control. (section#running): The running section contain the runner