Add support for engine specific settings for testing

This commit is contained in:
AndyGrant committed 2019-10-21 02:46:17 -04:00
1 parent 0ca1d4e42d
commit 81e791abec
4 files changed
+115 -117

No files matched your search

+29 -42
View File
@@ -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_REPO_URL = 'http://github.com/AndyGrant/OpenBench/'
FRAMEWORK_DEFAULTS = { FRAMEWORK_DEFAULTS = {
'config' : { 'config' : {
# Framework source, must be changed for your instance # Controls the Link on the sidebar
'framework' : 'http://github.com/AndyGrant/OpenBench/', 'framework' : FRAMEWORK_REPO_URL,
# Default to uci since everyone uses it # SPRT Elo bounds and type I/II errors
'protocol' : 'uci', 'sprt' : {
'elolower' : 0.00, 'eloupper' : 5.00,
# Defaults for Short Time Control tests 'alpha' : 0.05, 'beta' : 0.05,
'stc' : {
'threads' : 1,
'hash' : 8,
'timecontrol' : '10.0+0.1',
}, },
# Defaults for Long Time Control tests # Engine Configuration. All engines must have a name, a source repo,
'ltc' : { # a set of paramaters for each standard test type, as well as a scaled
'threads' : 1, # NPS value, which is used to normalize speed across all workers.
'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
'engines' : { 'engines' : {
'Ethereal' : { 'Ethereal' : {
'name' : 'Ethereal', 'name' : 'Ethereal',
'source' : 'https://github.com/AndyGrant/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, 'nps' : 1500000,
'proto' : 'uci',
'default' : True, 'default' : True,
}, },
'Laser' : { 'Laser' : {
'name' : 'Laser', 'name' : 'Laser',
'source' : 'https://github.com/jeffreyan11/uci-chess-engine', '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, 'nps' : 625000,
'proto' : 'uci',
'default' : False, 'default' : False,
}, },
'Weiss' : { 'Weiss' : {
'name' : 'Weiss', 'name' : 'Weiss',
'source' : 'https://github.com/TerjeKir/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, 'nps' : 4000000,
'proto' : 'uci',
'default' : False, 'default' : False,
}, },
}, },
+12 -10
View File
@@ -4,6 +4,11 @@ body {
background: #2A2A2A; background: #2A2A2A;
} }
a:link, a:visited, a:hover, a:active {
text-decoration: none;
color: #FFFFFF;
}
#sidebar { #sidebar {
float: left; float: left;
margin: 20px; margin: 20px;
@@ -14,13 +19,14 @@ body {
padding: 0px; padding: 0px;
} }
#sidebar .header { #sidebar li a {
font-weight: bold; font-size: 18px;
color: #AAAAAA; color: #A2A2A2;
} }
#sidebar li { #sidebar .header {
font-size: 18px; font-weight: bold;
color: #008888;
} }
#content { #content {
@@ -36,6 +42,7 @@ body {
} }
#content input, #content select { #content input, #content select {
background-color: #BBBBBB;
padding: 8px; padding: 8px;
margin: 2px 0px; margin: 2px 0px;
display: inline-block; display: inline-block;
@@ -239,8 +246,3 @@ body {
font-weight: bold; font-weight: bold;
font-size: 20px; font-size: 20px;
} }
a:link, a:visited, a:hover, a:active {
text-decoration: none;
color: #FFFFFF;
}
+2 -2
View File
@@ -41,10 +41,10 @@
<li><a href="/users">Users</a></li> <li><a href="/users">Users</a></li>
<li><a href="/eventLog">Events</a></li> <li><a href="/eventLog">Events</a></li>
<li><a href="/machines">Machines</a></li> <li><a href="/machines">Machines</a></li>
<li><a href="{{config.framework}}">OpenBench</a></li>
</ul> </ul>
<ul> <ul>
<li class="header">LINKS</li> <li class="header">ENGINES</li>
<li><a href="{{config.framework}}">OpenBench</a></li>
{% for engine, data in config.engines.items|dictsort:"0.lower" %} {% for engine, data in config.engines.items|dictsort:"0.lower" %}
<li><a href="{{data.source}}">{{data.name}}</a></li> <li><a href="{{data.source}}">{{data.name}}</a></li>
{% endfor %} {% endfor %}
+72 -63
View File
@@ -1,36 +1,64 @@
{% extends "OpenBench/base.html" %} {% extends "OpenBench/base.html" %}
{% block scripts %} {% 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() { var testMode = "stc";
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}}"
}
function setupSMPSTC() { var configurations = {
document.getElementById("devoptions").value = "Threads={{config.smpstc.threads}} Hash={{config.smpstc.hash}}"; {% for name, data in config.engines.items %}
document.getElementById("baseoptions").value = "Threads={{config.smpstc.threads}} Hash={{config.smpstc.hash}}"; '{{name}}' : {
document.getElementById("timecontrol").value = "{{config.smpstc.timecontrol}}" '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() { function configure(mode) {
document.getElementById("devoptions").value = "Threads={{config.smpltc.threads}} Hash={{config.smpltc.hash}}";
document.getElementById("baseoptions").value = "Threads={{config.smpltc.threads}} Hash={{config.smpltc.hash}}"; // Update global test mode
document.getElementById("timecontrol").value = "{{config.smpltc.timecontrol}}" 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 %} {% endblock %}
{% block content %} {% block content %}
<form method="POST" action="/newTest/"> <form method="POST" action="/newTest/">
{% csrf_token %} {% csrf_token %}
<label> Engine Name </label> <label> Engine Name </label>
<select name="enginename"> <select id="enginename" name="enginename" onchange="configure(testMode)">
{% for name, data in config.engines.items %} {% for name, data in config.engines.items %}
{% if data.default %} {% if data.default %}
<option selected value="{{name}}">{{data.name}}</option> <option selected value="{{name}}">{{data.name}}</option>
@@ -38,35 +66,25 @@
<option value="{{name}}">{{data.name}}</option> <option value="{{name}}">{{data.name}}</option>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</select> </select><br>
<br>
<label> Dev Branch </label> <label> Dev Branch </label>
<input name="devbranch" autofocus> <input name="devbranch" autofocus></br>
</br>
<label> Dev Bench </label> <label> Dev Bench </label>
<input name="devbench"> <input name="devbench"></br>
</br>
<label> Dev Options </label> <label> Dev Options </label>
<input id="devoptions" value="Threads={{config.stc.threads}} Hash={{config.stc.hash}}" name="devoptions"> <input id="devoptions" name="devoptions"></br>
</br>
<label> Dev Protocol </label> <label> Dev Protocol </label>
<input value="{{config.protocol}}" name="devprotocol"> <input id="devprotocol" name="devprotocol"></br>
</br>
<label> Base Branch </label> <label> Base Branch </label>
<input value="master" name="basebranch"> <input value="master" name="basebranch"></br>
</br>
<label> Base Bench </label> <label> Base Bench </label>
<input name="basebench"> <input name="basebench"></br>
</br>
<label> Base Options </label> <label> Base Options </label>
<input id="baseoptions" value="Threads={{config.stc.threads}} Hash={{config.stc.hash}}" name="baseoptions"> <input id="baseoptions" name="baseoptions"></br>
</br>
<label> Base Protocol </label> <label> Base Protocol </label>
<input value="{{config.protocol}}" name="baseprotocol"> <input id="baseprotocol" name="baseprotocol"></br>
</br>
<label> Source </label> <label> Source </label>
<input value="{{profile.repo}}" name="source"> <input value="{{profile.repo}}" name="source"></br>
</br>
<label> Opening Book </label> <label> Opening Book </label>
<select name="bookname"> <select name="bookname">
{% for name, data in config.books.items %} {% for name, data in config.books.items %}
@@ -76,34 +94,25 @@
<option value="{{name}}">{{data.name}}</option> <option value="{{name}}">{{data.name}}</option>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</select> </select></br>
</br>
<label> Time Control </label> <label> Time Control </label>
<input id="timecontrol" value="{{config.stc.timecontrol}}" name="timecontrol"> <input id="timecontrol" name="timecontrol"></br>
</br>
<label> Priority </label> <label> Priority </label>
<input value="0" name="priority"> <input value="0" name="priority"></br>
</br>
<label> Throughput </label> <label> Throughput </label>
<input value="1000" name="throughput"> <input value="1000" name="throughput"></br>
</br>
<label> Lower Bound </label> <label> Lower Bound </label>
<input value="{{config.elolower}}" name="elolower"> <input value="{{config.sprt.elolower}}" name="elolower"></br>
</br>
<label> Upper Bound </label> <label> Upper Bound </label>
<input value="{{config.eloupper}}" name="eloupper"> <input value="{{config.sprt.eloupper}}" name="eloupper"></br>
</br>
<label> Alpha </label> <label> Alpha </label>
<input value="{{config.alpha}}" name="alpha"> <input value="{{config.sprt.alpha}}" name="alpha"></br>
</br>
<label> Beta </label> <label> Beta </label>
<input value="{{config.beta}}" name="beta"> <input value="{{config.sprt.beta}}" name="beta"></br>
</br>
<input type="submit" name="submit" value="Create Engine Test"> <input type="submit" name="submit" value="Create Engine Test">
</form> </form>
<button onClick="setupSTC()">Setup STC</button> <button onClick="configure('stc')">Setup STC</button>
<button onClick="setupLTC()">Setup LTC</button> <button onClick="configure('ltc')">Setup LTC</button><br>
<br> <button onClick="configure('smpstc')">Setup SMP STC</button>
<button onClick="setupSMPSTC()">Setup SMP STC</button> <button onClick="configure('smpltc')">Setup SMP LTC</button>
<button onClick="setupSMPLTC()">Setup SMP LTC</button>
{% endblock %} {% endblock %}