From ebf73762569b82ecceaa2b8dc1dc98e40ee1505b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 2 Aug 2010 11:55:59 -0700 Subject: [PATCH] [JAEGER] Merge. --- js/src/metrics/jint/treesearch.py | 25 +++++++++----- js/src/metrics/jint/v8/deltablue.js | 2 +- js/src/metrics/jint/v8/run-deltablue.js | 44 ------------------------- 3 files changed, 18 insertions(+), 53 deletions(-) delete mode 100644 js/src/metrics/jint/v8/run-deltablue.js diff --git a/js/src/metrics/jint/treesearch.py b/js/src/metrics/jint/treesearch.py index e3147a462e5c..632717c3fea0 100644 --- a/js/src/metrics/jint/treesearch.py +++ b/js/src/metrics/jint/treesearch.py @@ -33,7 +33,7 @@ class UCT: self.maxNodes = self.numPlayouts * 20 self.loops = loops self.enableLoops = enableLoops - self.maturityThreshold = 50 + self.maturityThreshold = 20 self.originalBest = bestTime self.bestTime = bestTime self.bias = 20 @@ -76,7 +76,7 @@ class UCT: return self.zobrist[zash] self.bm.generateBanList(self.loops, queue) - result = self.bm.treeSearchRun(self.fd, ['-m', '-j'], 2) + result = self.bm.treeSearchRun(self.fd, ['-m', '-j'], 3) self.zobrist[zash] = result return result @@ -113,7 +113,7 @@ class UCT: if int(origScore) < int(self.bestTime): print('New best score: {0:f}ms'.format(origScore)) - self.combos = [] + self.combos = [history] self.bestTime = origScore elif int(origScore) == int(self.bestTime): self.combos.append(history) @@ -128,7 +128,16 @@ class UCT: self.step(loopList) # Build the expected combination vector. - print('Best time: {0:f}ms'.format(self.bestTime)) + combos = [ ] + for combo in self.combos: + vec = [ ] + for i in range(0, len(self.loops)): + vec.append(int(self.enableLoops)) + for node in combo: + vec[node.loop] = int(not self.enableLoops) + combos.append(vec) + + return [self.bestTime, combos] class Benchmark: def __init__(self, JS, fname): @@ -261,8 +270,8 @@ class Benchmark: enableLoops = False - uct = UCT(self, combinedTime, enableLoops, counters[:], fd, 100000) - result = uct.run() + uct = UCT(self, combinedTime, enableLoops, counters[:], fd, 50000) + return uct.run() def treeSearch(self): fd, counters = self.ppForTreeSearch() @@ -286,7 +295,7 @@ class Benchmark: else: upperBound = int(upperBound / 1000) delta = datetime.timedelta(seconds = upperBound) - if upperBound <= 18: + if upperBound < 180: print('Estimating {0:d}s to test, so picking exhaustive '.format(int(upperBound))) else: print('Estimating {0:s} to test, so picking tree search '.format(str(delta))) @@ -306,7 +315,7 @@ class Benchmark: print('Tracing JIT: {0:d}ms'.format(int(tracerTime))) print('Combined: {0:d}ms'.format(int(combinedTime))) - if treeSearch: + if 1 and treeSearch: results = self.internalTreeSearch(params) else: results = self.internalExhaustiveSearch(params) diff --git a/js/src/metrics/jint/v8/deltablue.js b/js/src/metrics/jint/v8/deltablue.js index ea988527e8b5..311f260fb5df 100644 --- a/js/src/metrics/jint/v8/deltablue.js +++ b/js/src/metrics/jint/v8/deltablue.js @@ -201,7 +201,7 @@ BenchmarkSuite.prototype.NotifyError = function(error) { BenchmarkSuite.prototype.RunSingleBenchmark = function(benchmark) { var elapsed = 0; var start = new Date(); - for (var n = 0; elapsed < 50; n++) { + for (var n = 0; elapsed < 200; n++) { benchmark.run(); elapsed = new Date() - start; } diff --git a/js/src/metrics/jint/v8/run-deltablue.js b/js/src/metrics/jint/v8/run-deltablue.js deleted file mode 100644 index e8d2a07ff210..000000000000 --- a/js/src/metrics/jint/v8/run-deltablue.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2008 Google 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT -// OWNER OR 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. - - -load('base.js'); -load('deltablue.js'); - -function PrintResult(name, result) { - print(name + ': ' + result); -} - - -function PrintScore(score) { - print('----'); - print('Score: ' + score); -} - - -BenchmarkSuite.RunSuites({ NotifyResult: PrintResult, - NotifyScore: PrintScore });