From 81e791abec9529b7b4b0d1f4a61ca2b2159aca4e Mon Sep 17 00:00:00 2001 From: AndyGrant Date: Mon, 21 Oct 2019 02:46:17 -0400 Subject: [PATCH] Add support for engine specific settings for testing --- OpenBench/config.py | 71 +++++++--------- OpenBench/static/style.css | 24 +++--- Templates/OpenBench/base.html | 6 +- Templates/OpenBench/newTest.html | 135 ++++++++++++++++--------------- 4 files changed, 117 insertions(+), 119 deletions(-) diff --git a/OpenBench/config.py b/OpenBench/config.py index eea00d3..df191ca 100644 --- a/OpenBench/config.py +++ b/OpenBench/config.py @@ -1,74 +1,61 @@ + +# Workers will use FRAMEWORK_REPO_URL to determine the location +# for the Cutechess binary and DLLs, as well as any of the books +# which are being used in the testing framework. The main OpenBench +# repo should suffice, but new books require this to be redirected. FRAMEWORK_REPO_URL = 'http://github.com/AndyGrant/OpenBench/' FRAMEWORK_DEFAULTS = { 'config' : { - # Framework source, must be changed for your instance - 'framework' : 'http://github.com/AndyGrant/OpenBench/', + # Controls the Link on the sidebar + 'framework' : FRAMEWORK_REPO_URL, - # Default to uci since everyone uses it - 'protocol' : 'uci', - - # Defaults for Short Time Control tests - 'stc' : { - 'threads' : 1, - 'hash' : 8, - 'timecontrol' : '10.0+0.1', + # SPRT Elo bounds and type I/II errors + 'sprt' : { + 'elolower' : 0.00, 'eloupper' : 5.00, + 'alpha' : 0.05, 'beta' : 0.05, }, - # Defaults for Long Time Control tests - 'ltc' : { - 'threads' : 1, - 'hash' : 64, - 'timecontrol' : '60.0+0.6', - }, - - # Defaults for Short Time Control tests with SMP - 'smpstc' : { - 'threads' : 8, - 'hash' : 64, - 'timecontrol' : '5.0+0.05', - }, - - # Defaults for Long Time Control tests with SMP - 'smpltc' : { - 'threads' : 8, - 'hash' : 256, - 'timecontrol' : '20.0+0.2', - }, - - # SPRT bounds and confidence values - 'elolower' : 0.0, - 'eloupper' : 5.0, - 'alpha' : 0.05, - 'beta' : 0.05, - - # 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 1,500,000 + # Engine Configuration. All engines must have a name, a source repo, + # a set of paramaters for each standard test type, as well as a scaled + # NPS value, which is used to normalize speed across all workers. 'engines' : { 'Ethereal' : { 'name' : 'Ethereal', 'source' : 'https://github.com/AndyGrant/Ethereal', + 'stc' : { 'threads' : 1, 'hash' : 8, 'timecontrol' : '10.0+0.1' }, + 'ltc' : { 'threads' : 1, 'hash' : 64, 'timecontrol' : '60.0+0.6' }, + 'smpstc' : { 'threads' : 8, 'hash' : 64, 'timecontrol' : '5.0+0.05' }, + 'smpltc' : { 'threads' : 8, 'hash' : 256, 'timecontrol' : '20.0+0.2' }, 'nps' : 1500000, + 'proto' : 'uci', 'default' : True, }, 'Laser' : { 'name' : 'Laser', 'source' : 'https://github.com/jeffreyan11/uci-chess-engine', + 'stc' : { 'threads' : 1, 'hash' : 8, 'timecontrol' : '10.0+0.1' }, + 'ltc' : { 'threads' : 1, 'hash' : 64, 'timecontrol' : '60.0+0.6' }, + 'smpstc' : { 'threads' : 8, 'hash' : 64, 'timecontrol' : '5.0+0.05' }, + 'smpltc' : { 'threads' : 8, 'hash' : 256, 'timecontrol' : '20.0+0.2' }, 'nps' : 625000, + 'proto' : 'uci', 'default' : False, }, 'Weiss' : { 'name' : 'Weiss', 'source' : 'https://github.com/TerjeKir/weiss', + 'stc' : { 'threads' : 1, 'hash' : 32, 'timecontrol' : '10.0+0.1' }, + 'ltc' : { 'threads' : 1, 'hash' : 128, 'timecontrol' : '60.0+0.6' }, + 'smpstc' : { 'threads' : 8, 'hash' : 128, 'timecontrol' : '5.0+0.05' }, + 'smpltc' : { 'threads' : 8, 'hash' : 512, 'timecontrol' : '20.0+0.2' }, 'nps' : 4000000, + 'proto' : 'uci', 'default' : False, }, }, diff --git a/OpenBench/static/style.css b/OpenBench/static/style.css index 39f5003..75f71f5 100644 --- a/OpenBench/static/style.css +++ b/OpenBench/static/style.css @@ -4,6 +4,11 @@ body { background: #2A2A2A; } +a:link, a:visited, a:hover, a:active { + text-decoration: none; + color: #FFFFFF; +} + #sidebar { float: left; margin: 20px; @@ -14,13 +19,14 @@ body { padding: 0px; } -#sidebar .header { - font-weight: bold; - color: #AAAAAA; +#sidebar li a { + font-size: 18px; + color: #A2A2A2; } -#sidebar li { - font-size: 18px; +#sidebar .header { + font-weight: bold; + color: #008888; } #content { @@ -36,6 +42,7 @@ body { } #content input, #content select { + background-color: #BBBBBB; padding: 8px; margin: 2px 0px; display: inline-block; @@ -238,9 +245,4 @@ body { text-align: center; font-weight: bold; font-size: 20px; -} - -a:link, a:visited, a:hover, a:active { - text-decoration: none; - color: #FFFFFF; -} +} \ No newline at end of file diff --git a/Templates/OpenBench/base.html b/Templates/OpenBench/base.html index 1496a59..f198a76 100644 --- a/Templates/OpenBench/base.html +++ b/Templates/OpenBench/base.html @@ -41,12 +41,12 @@
  • Users
  • Events
  • Machines
  • +
  • OpenBench
  • {% endblock %} diff --git a/Templates/OpenBench/newTest.html b/Templates/OpenBench/newTest.html index 7d6de6c..c0f0ba2 100644 --- a/Templates/OpenBench/newTest.html +++ b/Templates/OpenBench/newTest.html @@ -1,36 +1,64 @@ {% extends "OpenBench/base.html" %} - {% block scripts %} - function setupSTC() { - document.getElementById("devoptions").value = "Threads={{config.stc.threads}} Hash={{config.stc.hash}}"; - document.getElementById("baseoptions").value = "Threads={{config.stc.threads}} Hash={{config.stc.hash}}"; - document.getElementById("timecontrol").value = "{{config.stc.timecontrol}}" - } - function setupLTC() { - document.getElementById("devoptions").value = "Threads={{config.ltc.threads}} Hash={{config.ltc.hash}}"; - document.getElementById("baseoptions").value = "Threads={{config.ltc.threads}} Hash={{config.ltc.hash}}"; - document.getElementById("timecontrol").value = "{{config.ltc.timecontrol}}" - } + var testMode = "stc"; - function setupSMPSTC() { - document.getElementById("devoptions").value = "Threads={{config.smpstc.threads}} Hash={{config.smpstc.hash}}"; - document.getElementById("baseoptions").value = "Threads={{config.smpstc.threads}} Hash={{config.smpstc.hash}}"; - document.getElementById("timecontrol").value = "{{config.smpstc.timecontrol}}" - } + var configurations = { + {% for name, data in config.engines.items %} + '{{name}}' : { + 'proto' : "{{data.proto}}", + 'stc' : { + "threads" : "{{data.stc.threads}}", + "hash" : "{{data.stc.hash}}", + "timecontrol" : "{{data.stc.timecontrol}}" + }, + 'ltc' : { + "threads" : "{{data.ltc.threads}}", + "hash" : "{{data.ltc.hash}}", + "timecontrol" : "{{data.ltc.timecontrol}}" + }, + 'smpstc' : { + "threads" : "{{data.smpstc.threads}}", + "hash" : "{{data.smpstc.hash}}", + "timecontrol" : "{{data.smpstc.timecontrol}}" + }, + 'smpltc' : { + "threads" : "{{data.smpltc.threads}}", + "hash" : "{{data.smpltc.hash}}", + "timecontrol" : "{{data.smpltc.timecontrol}}" + }, + }, + {% endfor %} + }; - function setupSMPLTC() { - document.getElementById("devoptions").value = "Threads={{config.smpltc.threads}} Hash={{config.smpltc.hash}}"; - document.getElementById("baseoptions").value = "Threads={{config.smpltc.threads}} Hash={{config.smpltc.hash}}"; - document.getElementById("timecontrol").value = "{{config.smpltc.timecontrol}}" + function configure(mode) { + + // Update global test mode + testMode = mode; + + // Find the selected engine + var selection = document.getElementById("enginename"); + var engine = selection.options[selection.selectedIndex].value; + + // Parse out the needed configuration settings + var threads = configurations[engine][mode]["threads"]; + var hash = configurations[engine][mode]["hash"]; + var timecontrol = configurations[engine][mode]["timecontrol"]; + var protocol = configurations[engine]["proto"]; + + // Adjust all the fields to auto-fill the settings + document.getElementById("devoptions").value = "Threads=" + threads + " Hash=" + hash; + document.getElementById("baseoptions").value = "Threads=" + threads + " Hash=" + hash; + document.getElementById("timecontrol").value = timecontrol; + document.getElementById("devprotocol").value = protocol; + document.getElementById("baseprotocol").value = protocol; } {% endblock %} - {% block content %}
    {% csrf_token %} - {% for name, data in config.engines.items %} {% if data.default %} @@ -38,35 +66,25 @@ {% endif %} {% endfor %} - -
    +
    - -
    +
    - -
    +
    - -
    +
    - -
    +
    - -
    +
    - -
    +
    - -
    +
    - -
    +
    - -
    +
    -
    +
    - -
    +
    - -
    +
    - -
    +
    - -
    +
    - -
    +
    - -
    +
    - -
    +
    - - -
    - - + +
    + + {% endblock %}