Title: [185833] trunk
Revision
185833
Author
[email protected]
Date
2015-06-22 10:11:54 -0700 (Mon, 22 Jun 2015)

Log Message

Run CDjs as part of JSC stress testing
https://bugs.webkit.org/show_bug.cgi?id=146174

Reviewed by Geoffrey Garen.

PerformanceTests:

* JetStream/cdjs/cdjs-tests.yaml: Added. This tells JSC stress tests what tests to run. It uses new syntax ("tests" being a list) that I add in this change.
* JetStream/cdjs/main.js: Mark this as a slow test.
* JetStream/create.rb: Don't copy the JSC stress tests artifacts into the JetStream bundle.

Tools:

* Scripts/run-_javascript_core-tests:
(runJSCStressTests): Make this aware of the cdjs-tests.yaml.
* Scripts/run-jsc-stress-tests:
- Teach this about tests that indicate error by returning an error code while also having lots of output even when they succeed.
- Add the ability to have "tests" be a list of tests rather than just one test. This could also be a list of directories that have tests.
- Fix a bug with bundle copying: whether the $collection should have the basename appended depends on whether we copy into bundleDir.dirname, not on whether absoluteCollection is a directory.

Modified Paths

Added Paths

Diff

Modified: trunk/PerformanceTests/ChangeLog (185832 => 185833)


--- trunk/PerformanceTests/ChangeLog	2015-06-22 17:04:08 UTC (rev 185832)
+++ trunk/PerformanceTests/ChangeLog	2015-06-22 17:11:54 UTC (rev 185833)
@@ -1,5 +1,16 @@
 2015-06-19  Filip Pizlo  <[email protected]>
 
+        Run CDjs as part of JSC stress testing
+        https://bugs.webkit.org/show_bug.cgi?id=146174
+
+        Reviewed by Geoffrey Garen.
+
+        * JetStream/cdjs/cdjs-tests.yaml: Added. This tells JSC stress tests what tests to run. It uses new syntax ("tests" being a list) that I add in this change.
+        * JetStream/cdjs/main.js: Mark this as a slow test.
+        * JetStream/create.rb: Don't copy the JSC stress tests artifacts into the JetStream bundle.
+
+2015-06-19  Filip Pizlo  <[email protected]>
+
         Unreviewed, fix a small indentation goof.
 
         * JetStream/cdjs/motion.js:

Added: trunk/PerformanceTests/JetStream/cdjs/cdjs-tests.yaml (0 => 185833)


--- trunk/PerformanceTests/JetStream/cdjs/cdjs-tests.yaml	                        (rev 0)
+++ trunk/PerformanceTests/JetStream/cdjs/cdjs-tests.yaml	2015-06-22 17:11:54 UTC (rev 185833)
@@ -0,0 +1,31 @@
+# Copyright (C) 2015 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer. 
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution. 
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+- path: .
+  tests:
+    - red_black_tree_test.js
+    - motion_test.js
+    - reduce_collision_set_test.js
+    - main.js
+  cmd: defaultRunNoisyTest unless parseRunCommands
+

Modified: trunk/PerformanceTests/JetStream/cdjs/main.js (185832 => 185833)


--- trunk/PerformanceTests/JetStream/cdjs/main.js	2015-06-22 17:04:08 UTC (rev 185832)
+++ trunk/PerformanceTests/JetStream/cdjs/main.js	2015-06-22 17:11:54 UTC (rev 185833)
@@ -23,6 +23,9 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+// This is run as a JSC stress test. Let the harness know that this is a slow test.
+//@ slow!
+
 load("constants.js");
 load("util.js");
 load("red_black_tree.js");

Modified: trunk/PerformanceTests/JetStream/create.rb (185832 => 185833)


--- trunk/PerformanceTests/JetStream/create.rb	2015-06-22 17:04:08 UTC (rev 185832)
+++ trunk/PerformanceTests/JetStream/create.rb	2015-06-22 17:11:54 UTC (rev 185833)
@@ -29,12 +29,32 @@
 VERSION = "1.1-alpha2"
 DIRECTORY_NAME = "JetStream-#{VERSION}"
 
+CDJS_FILES = [
+    "constants.js",
+    "util.js",
+    "red_black_tree.js",
+    "call_sign.js",
+    "vector_2d.js",
+    "vector_3d.js",
+    "motion.js",
+    "reduce_collision_set.js",
+    "simulator.js",
+    "collision.js",
+    "collision_detector.js",
+    "benchmark.js"
+]
+
 raise unless system("rm -rf " + DIRECTORY_NAME)
 raise unless system("mkdir -p " + DIRECTORY_NAME)
 raise unless system("mkdir -p #{DIRECTORY_NAME}/sunspider")
 raise unless system("mkdir -p #{DIRECTORY_NAME}/sources")
 raise unless system("cp sunspider/*.js #{DIRECTORY_NAME}/sunspider")
-raise unless system("cp -r JetStream.css JetStreamDriver.js LLVM-test-suite-LICENSE.txt simple Octane2 Octane2Setup.js SimpleSetup.js SunSpiderSetup.js Octane OctaneSetup.js CDjsSetup.js cdjs Reference.js TestingSetup.js JetStream-Logo.png [email protected] Swoosh.png [email protected] " + DIRECTORY_NAME)
+raise unless system("mkdir -p #{DIRECTORY_NAME}/cdjs")
+CDJS_FILES.each {
+    | filename |
+    raise unless system("cp cdjs/#{filename} #{DIRECTORY_NAME}/cdjs")
+}
+raise unless system("cp -r JetStream.css JetStreamDriver.js LLVM-test-suite-LICENSE.txt simple Octane2 Octane2Setup.js SimpleSetup.js SunSpiderSetup.js Octane OctaneSetup.js CDjsSetup.js Reference.js TestingSetup.js JetStream-Logo.png [email protected] Swoosh.png [email protected] " + DIRECTORY_NAME)
 
 def detemplatize(basename)
     File.open(DIRECTORY_NAME + "/#{basename}.html", "w") {
@@ -116,7 +136,7 @@
 transferSource("box2d", "Octane2/box2d.js")
 transferSource("zlib", "Octane2/zlib.js", "Octane2/zlib-data.js")
 transferSource("typescript", "Octane2/typescript.js", "Octane2/typescript-compiler.js", "Octane2/typescript-input.js")
-transferSource("cdjs", "cdjs/constants.js", "cdjs/util.js", "cdjs/red_black_tree.js", "cdjs/call_sign.js", "cdjs/vector_2d.js", "cdjs/vector_3d.js", "cdjs/motion.js", "cdjs/reduce_collision_set.js", "cdjs/simulator.js", "cdjs/collision.js", "cdjs/collision_detector.js", "cdjs/benchmark.js")
+transferSource("cdjs", *(CDJS_FILES.collect { | filename | "cdjs/#{filename}" }))
 
 puts "You can now run JetStream by navigating to file://" + (Pathname.new(DIRECTORY_NAME) + "index.html").realpath.to_s
 

Modified: trunk/Tools/ChangeLog (185832 => 185833)


--- trunk/Tools/ChangeLog	2015-06-22 17:04:08 UTC (rev 185832)
+++ trunk/Tools/ChangeLog	2015-06-22 17:11:54 UTC (rev 185833)
@@ -1,3 +1,17 @@
+2015-06-19  Filip Pizlo  <[email protected]>
+
+        Run CDjs as part of JSC stress testing
+        https://bugs.webkit.org/show_bug.cgi?id=146174
+
+        Reviewed by Geoffrey Garen.
+
+        * Scripts/run-_javascript_core-tests:
+        (runJSCStressTests): Make this aware of the cdjs-tests.yaml.
+        * Scripts/run-jsc-stress-tests:
+        - Teach this about tests that indicate error by returning an error code while also having lots of output even when they succeed.
+        - Add the ability to have "tests" be a list of tests rather than just one test. This could also be a list of directories that have tests.
+        - Fix a bug with bundle copying: whether the $collection should have the basename appended depends on whether we copy into bundleDir.dirname, not on whether absoluteCollection is a directory.
+
 2015-06-21  Alexey Proskuryakov  <[email protected]>
 
         REGRESSION (r172975): navigator.language unable to tell region for Traditional Chinese users

Modified: trunk/Tools/Scripts/run-_javascript_core-tests (185832 => 185833)


--- trunk/Tools/Scripts/run-_javascript_core-tests	2015-06-22 17:04:08 UTC (rev 185832)
+++ trunk/Tools/Scripts/run-_javascript_core-tests	2015-06-22 17:11:54 UTC (rev 185833)
@@ -272,6 +272,7 @@
         "/usr/bin/env", "ruby", "Tools/Scripts/run-jsc-stress-tests",
         "-j", jscPath($productDir), "-o", $jscStressResultsDir,
         "PerformanceTests/SunSpider/tests/sunspider-1.0",
+        "PerformanceTests/JetStream/cdjs/cdjs-tests.yaml",
         "Source/_javascript_Core/tests/executableAllocationFuzz.yaml",
         "Source/_javascript_Core/tests/exceptionFuzz.yaml",
         "PerformanceTests/SunSpider/no-architecture-specific-optimizations.yaml",

Modified: trunk/Tools/Scripts/run-jsc-stress-tests (185832 => 185833)


--- trunk/Tools/Scripts/run-jsc-stress-tests	2015-06-22 17:04:08 UTC (rev 185832)
+++ trunk/Tools/Scripts/run-jsc-stress-tests	2015-06-22 17:11:54 UTC (rev 185833)
@@ -426,6 +426,23 @@
     }
 end
 
+# Error handler for tests that fail exactly when they return non-zero exit status and produce
+# lots of spew. This will echo that spew when the test fails.
+def noisyErrorHandler
+    Proc.new {
+        | outp, plan |
+        outputFilename = Shellwords.shellescape((Pathname("..") + (plan.name + ".out")).to_s)
+    
+        outp.puts "if test -e #{plan.failFile}"
+        outp.puts "then"
+        outp.puts "    (cat #{outputFilename} && echo ERROR: Unexpected exit code: `cat #{plan.failFile}`) | " + redirectAndPrefixCommand(plan.name)
+        outp.puts "    " + plan.failCommand
+        outp.puts "else"
+        outp.puts "    " + plan.successCommand
+        outp.puts "fi"
+    }
+end
+
 # Error handler for tests that diff their output with some expectation.
 def diffErrorHandler(expectedFilename)
     Proc.new {
@@ -992,6 +1009,35 @@
     end
 end
 
+def runNoisyTest(kind, *options)
+    addRunCommand(kind, [pathToVM.to_s] + BASE_OPTIONS + options + [$benchmark.to_s], noisyOutputHandler, noisyErrorHandler)
+end
+
+def runNoisyTestDefault
+    runNoisyTest("default")
+end
+
+def runNoisyTestDefaultFTL
+    runNoisyTest("ftl", *FTL_OPTIONS) if $enableFTL
+end
+
+def runNoisyTestNoCJIT
+    runNoisyTest($enableFTL ? "ftl-no-cjit" : "no-cjit", "--validateBytecode=true", "--validateGraphAtEachPhase=true", *(($enableFTL ? FTL_OPTIONS : []) + NO_CJIT_OPTIONS))
+end
+
+def runNoisyTestEagerNoCJIT
+    runNoisyTest($enableFTL ? "ftl-eager-no-cjit" : "eager-no-cjit", "--validateBytecode=true", "--validateGraphAtEachPhase=true", *(($enableFTL ? FTL_OPTIONS : []) + NO_CJIT_OPTIONS + EAGER_OPTIONS))
+end
+
+def defaultRunNoisyTest
+    runNoisyTestDefault
+    if $jitTests
+        runNoisyTestDefaultFTL
+        runNoisyTestNoCJIT
+        runNoisyTestEagerNoCJIT
+    end
+end
+
 def skip
     $didAddRunCommand = true
     puts "Skipping #{$collectionName}/#{$benchmark}"
@@ -1056,18 +1102,13 @@
         FileUtils.mkdir_p bundleDir
         if bundleDir.basename == $collection.basename
             FileUtils.cp_r absoluteCollection, bundleDir.dirname
+            $collection = bundleDir
         else
             FileUtils.cp_r absoluteCollection, bundleDir
+            $collection = bundleDir + $collection.basename
         end
 
         $extraFilesBaseDir = absoluteCollection
-
-        # Redirect the collection's location to the newly constructed bundle.
-        if absoluteCollection.directory?
-            $collection = bundleDir
-        else
-            $collection = bundleDir + $collection.basename
-        end
     }
 end
 
@@ -1113,18 +1154,28 @@
         prepareCollection($collectionName)
       
         Dir.chdir($outputDir) {
-            directoryToSearch = $collection
+            pathsToSearch = [$collection]
             if entry["tests"]
-                directoryToSearch += entry["tests"]
+                if entry["tests"].is_a? Array
+                    pathsToSearch = entry["tests"].map {
+                        | testName |
+                        pathsToSearch[0] + testName
+                    }
+                else
+                    pathsToSearch[0] += entry["tests"]
+                end
             end
-            allJSFiles(directoryToSearch).each {
-                | path |
-               
-                $benchmark = path.basename
-                $benchmarkDirectory = path.dirname
-                
-                $runCommandOptions = {}
-                eval entry["cmd"]
+            pathsToSearch.each {
+                | pathToSearch |
+                allJSFiles(pathToSearch).each {
+                    | path |
+                    
+                    $benchmark = path.basename
+                    $benchmarkDirectory = path.dirname
+                    
+                    $runCommandOptions = {}
+                    eval entry["cmd"]
+                }
             }
         }
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to