diff --git a/Client/OpenBench.py b/Client/OpenBench.py index 7ccc0a5..c5b70b1 100644 --- a/Client/OpenBench.py +++ b/Client/OpenBench.py @@ -339,7 +339,7 @@ def completeWorkload(data): # Compute and report CPU scaling factor avgnps = (devnps + basenps) / 2.0 reportNPS(data, avgnps) - scalefactor = 2650000 / avgnps + scalefactor = int(data['test']['nps']) / avgnps print ('\nFACTOR : {0}'.format(round(1 / scalefactor, 2))) # Compute and report cutechess-cli string diff --git a/OpenBench/config.py b/OpenBench/config.py index 4345897..3a3aa66 100644 --- a/OpenBench/config.py +++ b/OpenBench/config.py @@ -11,15 +11,6 @@ FRAMEWORK_DEFAULTS = { 'source' : 'http://github.com/AndyGrant/EtherealDev/', 'homepage' : 'http://github.com/AndyGrant/Ethereal', - # Configured engines for the framework. To scale NPS for your engine, - # in order to match the time controls used here, do the following. - # Average a few bench runs for the latest version of Ethereal. Now - # take a few bench runs for the latest version of the new engine. - # Scale your NPS to match Ethereal's NPS of 2,500,000 - 'engines' : { - 'Ethereal' : {'nps' : 2500000}, - }, - # Default engine test options 'protocol' : 'uci', 'threads' : 1, @@ -33,6 +24,27 @@ FRAMEWORK_DEFAULTS = { 'alpha' : 0.10, 'beta' : 0.10, + # Configured engines for the framework. To scale NPS for your engine, + # in order to match the time controls used here, do the following. + # Average a few bench runs for the latest version of Ethereal. Now + # take a few bench runs for the latest version of the new engine. + # Scale your NPS to match Ethereal's NPS of 2,500,000 + 'engines' : { + 'Ethereal' : { + 'name' : 'Ethereal', + 'source' : 'https://github.com/AndyGrant/Ethereal', + 'nps' : 2500000, + 'default' : True, + }, + + 'Laser' : { + 'name' : 'Laser', + 'source' : 'https://github.com/jeffreyan11/uci-chess-engine', + 'nps' : 875000, + 'default' : False, + }, + }, + # Book confgiruation. When addding a book, follow the provided template. # The SHA is defined by hashlib.sha256(book).hexdigest(). OpenBench.py # (Client File) has an example to show you how to find a hash digest diff --git a/OpenBench/models.py b/OpenBench/models.py index 9290cda..25cc4b4 100644 --- a/OpenBench/models.py +++ b/OpenBench/models.py @@ -56,6 +56,7 @@ class Result(Model): class Test(Model): author = CharField(max_length=64) + engine = CharField(max_length=64) dev = ForeignKey('Engine', PROTECT, related_name='dev') base = ForeignKey('Engine', PROTECT, related_name='base') diff --git a/OpenBench/utils.py b/OpenBench/utils.py index 4e039ff..050da7a 100644 --- a/OpenBench/utils.py +++ b/OpenBench/utils.py @@ -55,6 +55,7 @@ def newTest(request): test = Test() # New Test, saved only after parsing test.author = request.user.username + test.engine = request.POST['enginename'] # Extract Development Fields devname = request.POST['devbranch'] @@ -204,6 +205,7 @@ def workloadDictionary(machine, result, test): 'result' : { 'id' : result.id, }, 'test' : { 'id' : test.id, + 'nps' : FRAMEWORK_DEFAULTS['config']['engines'][test.engine]['nps'], 'book' : FRAMEWORK_DEFAULTS['config']['books'][test.bookname], 'timecontrol' : test.timecontrol, 'dev' : { diff --git a/Templates/OpenBench/base.html b/Templates/OpenBench/base.html index 61d174c..a168981 100644 --- a/Templates/OpenBench/base.html +++ b/Templates/OpenBench/base.html @@ -35,7 +35,10 @@ {% endblock %} diff --git a/Templates/OpenBench/newTest.html b/Templates/OpenBench/newTest.html index cf11063..9fa58d7 100644 --- a/Templates/OpenBench/newTest.html +++ b/Templates/OpenBench/newTest.html @@ -4,6 +4,17 @@
{% csrf_token %}
+ + +