Unify create_test and create_tune

This commit is contained in:
andrew authored and Andrew Grant committed 2023-11-16 20:25:11 -05:00
1 parent 6a53772659
commit 0b17de9426
9 files changed
+342 -538

No files matched your search

+18 -8
View File
@@ -48,24 +48,34 @@
"tune_presets" : {
"default" : {
"book_name" : "UHO_4060_v2.epd",
"win_adj" : "movecount=3 score=400",
"draw_adj" : "movenumber=40 movecount=8 score=10",
"spsa_reporting_type" : "BULK",
"spsa_distribution_type" : "MULTIPLE",
"spsa_iterations" : 25000,
"spsa_pairs_per" : 8
},
"STC" : {
"options" : "Threads=1 Hash=8",
"timecontrol" : "10.0+0.10"
"dev_options" : "Threads=1 Hash=8",
"dev_time_control" : "10.0+0.10"
},
"MTC" : {
"options" : "Threads=1 Hash=32",
"timecontrol" : "30.0+0.30"
"dev_options" : "Threads=1 Hash=32",
"dev_time_control" : "30.0+0.30"
},
"LTC" : {
"options" : "Threads=1 Hash=64",
"timecontrol" : "60.0+0.60"
"dev_options" : "Threads=1 Hash=64",
"dev_time_control" : "60.0+0.60"
},
"VLTC" : {
"options" : "Threads=1 Hash=128",
"timecontrol" : "180.0+1.80"
"dev_options" : "Threads=1 Hash=128",
"dev_time_control" : "180.0+1.80"
}
}
}
+8
View File
@@ -240,6 +240,10 @@
padding-bottom: 3rem;
}
.pl-half {
padding-left: 0.125rem;
}
.pl-1 {
padding-left: 0.25rem;
}
@@ -260,6 +264,10 @@
padding-left: 3rem;
}
.pr-half {
padding-right: 0.125rem;
}
.pr-1 {
padding-right: 0.25rem;
}
-146
View File
@@ -1,146 +0,0 @@
var config = JSON.parse(document.getElementById('json-config' ).textContent);
var networks = JSON.parse(document.getElementById('json-networks').textContent);
var repos = JSON.parse(document.getElementById('json-repos' ).textContent);
function create_network_options(field_id, engine) {
var has_default = false;
var network_options = document.getElementById(field_id);
// Delete all existing Networks
while (network_options.length)
network_options.remove(0);
// Add each Network that matches the given engine
for (const network of networks) {
if (network.engine !== engine)
continue;
var opt = document.createElement('option');
opt.text = network.name;
opt.value = network.sha256;
opt.selected = network.default;
network_options.add(opt)
has_default = has_default || network.default;
}
{ // Add a None option and set it to default if there was not one yet
var opt = document.createElement('option');
opt.text = 'None';
opt.value = '';
opt.selected = !has_default;
network_options.add(opt);
}
}
function create_testmode_buttons(engine) {
// Clear out all of the existing buttons
var button_div = document.getElementById('test-mode-buttons');
while (button_div.hasChildNodes())
button_div.removeChild(button_div.lastChild);
var index = 0;
for (let mode in config.engines[engine].tune_modes) {
// Create a new button for the test mode
var btn = document.createElement('button')
btn.innerHTML = mode;
btn.onclick = function() { set_test_mode(mode); };
// Apply all of our CSS bootstrapping
btn.classList.add('anchorbutton');
btn.classList.add('btn-preset');
btn.classList.add('mt-2');
btn.classList.add('w-100');
// Put the button in a div, so we can handle padding
var div = document.createElement('div')
div.appendChild(btn)
div.classList.add('col-half');
// Left pad everything but the first
if ((index % 4) != 0)
div.classList.add('pl-1');
// Right pad everything but the last
if ((index % 4) != 3)
div.classList.add('pr-1');
button_div.append(div);
index++;
}
}
function extract_mode_config(mode_str) {
// Find test mode configuration for the engine
var selection = document.getElementById('engine');
var engine = selection.options[selection.selectedIndex].value;
return config.engines[engine].tune_modes[mode_str];
}
function set_engine_options(mode_str) {
// Extract UCI options for both the engine
var options = extract_mode_config(mode_str)['options'];
document.getElementById('options').value = options;
}
function set_test_mode(mode_str) {
const selection = document.getElementById('engine');
const engine = selection.options[selection.selectedIndex].value;
const mode = extract_mode_config(mode_str);
document.getElementById('book_name' ).value = mode['book'] || config.engines[engine].book;
document.getElementById('time_control' ).value = mode['timecontrol'] || '10.0+0.1';
set_engine_options(mode_str);
}
/* External */
function set_engine(engine) {
// Always update the Engine and Repository to the defaults
document.getElementById('engine').value = engine;
document.getElementById('repo' ).value = repos[engine] || config.engines[engine].source
// Create dropdown of all Networks associated with the engine
create_network_options('network', engine);
// Set default UCI options as if we were running an STC when changing
set_engine_options('STC');
// Engine decides the Adjudication and Book settings
document.getElementById('book_name' ).value = config.engines[engine].book;
document.getElementById('win_adj' ).value = config.engines[engine].win_adj;
document.getElementById('draw_adj' ).value = config.engines[engine].draw_adj;
set_test_mode('STC');
create_testmode_buttons(engine)
}
function enforce_default_text(id, text) {
window.addEventListener('DOMContentLoaded', function() {
var field = document.getElementById(id);
field.addEventListener('input', function() {
if (field.value.startsWith(text) || field.value === text)
return;
if (field.value.endsWith('/'))
field.value = text + field.value.substr(text.length).replace(/\/+$/, '');
else
field.value = text + field.value.substr(text.length);
});
});
}
@@ -36,15 +36,18 @@ function create_network_options(field_id, engine) {
}
}
function create_preset_buttons(engine) {
function create_preset_buttons(engine, workload_type) {
// Clear out all of the existing buttons
var button_div = document.getElementById('test-mode-buttons');
while (button_div.hasChildNodes())
button_div.removeChild(button_div.lastChild);
const presets = workload_type == 'TEST' ? config.engines[engine].test_presets
: workload_type == 'TUNE' ? config.engines[engine].tune_presets : {};
var index = 0;
for (let mode in config.engines[engine].test_presets) {
for (let mode in presets) {
// Don't include the global defaults
if (mode == 'default')
@@ -53,12 +56,12 @@ function create_preset_buttons(engine) {
// Create a new button for the test mode
var btn = document.createElement('button')
btn.innerHTML = mode;
btn.onclick = function() { apply_preset(mode); };
btn.onclick = function() { apply_preset(mode, workload_type); };
// Apply all of our CSS bootstrapping
btn.classList.add('anchorbutton');
btn.classList.add('btn-preset');
btn.classList.add('mt-2');
btn.classList.add('mt-1');
btn.classList.add('w-100');
// Put the button in a div, so we can handle padding
@@ -68,11 +71,11 @@ function create_preset_buttons(engine) {
// Left pad everything but the first
if ((index % 4) != 0)
div.classList.add('pl-1');
div.classList.add('pl-half');
// Right pad everything but the last
if ((index % 4) != 3)
div.classList.add('pr-1');
div.classList.add('pr-half');
button_div.append(div);
index++;
@@ -90,11 +93,16 @@ function get_base_engine() {
return selection.options[selection.selectedIndex].value;
}
function add_defaults_to_preset(engine, preset) {
function get_presets(engine, preset, workload_type) {
return workload_type == 'TEST' ? config.engines[engine].test_presets[preset]
: workload_type == 'TUNE' ? config.engines[engine].tune_presets[preset] : {};
}
// Use both the defaults, and this specific preset's settings
const default_settings = config.engines[engine].test_presets['default'] || {};
const preset_settings = config.engines[engine].test_presets[preset] || {};
function add_defaults_to_preset(engine, preset, workload_type) {
const default_settings = get_presets(engine, 'default', workload_type);
const preset_settings = get_presets(engine, preset, workload_type);
let settings = {}
@@ -107,7 +115,6 @@ function add_defaults_to_preset(engine, preset) {
return settings;
}
function set_engine(engine, target) {
document.getElementById(target + '_engine').value = engine;
@@ -146,7 +153,7 @@ function set_option(option_name, option_value) {
}
}
function retain_specific_options(engine, preset) {
function retain_specific_options(engine, preset, workload_type) {
// This is not applicable for self-play
if (get_dev_engine() == get_base_engine())
@@ -154,14 +161,18 @@ function retain_specific_options(engine, preset) {
// Extract the Threads and Hash settings from the Dev Options
const dev_options = document.getElementById('dev_options').value;
const dev_threads = dev_options.match(/\bThreads\s*=\s*(\d+)\b/)[1];
const dev_hash = dev_options.match(/\bHash\s*=\s*(\d+)\b/)[1];
const dev_options = document.getElementById('dev_options').value;
const threads_match = dev_options.match(/\bThreads\s*=\s*(\d+)\b/);
const hash_match = dev_options.match(/\bHash\s*=\s*(\d+)\b/);
const dev_threads = threads_match ? threads_match[1] : null;
const dev_hash = hash_match ? hash_match[1] : null;
// From the base options, replace the Threads= and Hash=
let base_options = add_defaults_to_preset(engine, preset)['base_options']
|| add_defaults_to_preset(engine, preset)['both_options'];
let base_options = add_defaults_to_preset(engine, preset, workload_type)['base_options']
|| add_defaults_to_preset(engine, preset, workload_type)['both_options'];
base_options = base_options.replace(/\bThreads\s*=\s*\d+\b/g, 'Threads=' + dev_threads);
base_options = base_options.replace(/\bHash\s*=\s*\d+\b/g, 'Hash=' + dev_hash);
@@ -170,10 +181,10 @@ function retain_specific_options(engine, preset) {
}
function apply_preset(preset) {
function apply_preset(preset, workload_type) {
// Add the defaults to the preset-specific options
const settings = add_defaults_to_preset(get_dev_engine(), preset)
const settings = add_defaults_to_preset(get_dev_engine(), preset, workload_type)
for (const option in settings) {
@@ -185,28 +196,30 @@ function apply_preset(preset) {
else {
set_option(option.replace('both_', 'dev_'), settings[option]);
set_option(option.replace('both_', 'base_'), settings[option]);
if (workload_type != 'TUNE')
set_option(option.replace('both_', 'base_'), settings[option]);
}
}
// For cross-engine, keep the original Hash/Threads, but
// For cross-engine tests, keep the original Hash/Threads, but
// add any other settings that might be specific to the engine
retain_specific_options(get_base_engine(), preset);
if (workload_type != 'TUNE') {
try {
retain_specific_options(get_base_engine(), preset, workload_type);
} catch (error) {}
}
}
function change_engine(engine, target) {
function change_engine(engine, target, workload_type) {
// Set the Engine, Repo, and init the Networks dropdown
set_engine(engine, target);
// 1. Always set base, when setting the dev engine
// 2. When changing the dev engine, update the test-mode buttons
if (target == 'dev')
create_preset_buttons(engine, workload_type);
if (target == 'dev') {
if (target == 'dev' && workload_type == 'TEST')
set_engine(engine, 'base');
create_preset_buttons(engine);
}
// Always reinit to STC for clarity to the user
apply_preset('STC');
}
apply_preset('STC', workload_type);
}
+3
View File
@@ -4,6 +4,9 @@ function enforce_default_text(id, text) {
var field = document.getElementById(id);
if (!field)
return;
field.addEventListener('input', function() {
if (field.value.startsWith(text) || field.value === text)
+20 -4
View File
@@ -35,6 +35,7 @@ import OpenBench.utils
import OpenBench.views
from OpenBench.models import *
from OpenBench.config import OPENBENCH_CONFIG
from OpenBench.workloads.verify_workload import verify_workload
def create_workload(request, workload_type):
@@ -48,9 +49,24 @@ def create_workload(request, workload_type):
return OpenBench.views.redirect(request, '/login/', error='Only enabled users can create tests')
if request.method == 'GET':
data = { 'networks' : list(Network.objects.all().values()) }
template = 'create_test.html' if workload_type == 'TEST' else 'create_tune.html'
return OpenBench.views.render(request, template, data)
data = { 'networks' : list(Network.objects.all().values()) }
if workload_type == 'TEST':
data['workload'] = workload_type
data['dev_text'] = 'Dev'
data['dev_title_text'] = 'Dev'
data['submit_text'] = 'Create Engine Test'
data['submit_endpoint'] = '/newTest/'
if workload_type == 'TUNE':
data['workload'] = workload_type
data['dev_text'] = ''
data['dev_title_text'] = 'Engine'
data['submit_text'] = 'Create SPSA Tune'
data['submit_endpoint'] = '/newTune/'
return OpenBench.views.render(request, 'create_workload.html', data)
if workload_type == 'TEST':
workload, errors = create_new_test(request)
@@ -70,7 +86,7 @@ def create_workload(request, workload_type):
summary = 'CREATE P=%d TP=%d' % (workload.priority, workload.throughput)
LogEvent.objects.create(author=username, summary=summary, log_file='', test_id=workload.id)
if not OpenBench.config.USE_CROSS_APPROVAL and profile.approver:
if not OPENBENCH_CONFIG['use_cross_approval'] and profile.approver:
workload.approved = True; workload.save()
return OpenBench.views.redirect(request, '/index/', warning=warning)
-180
View File
@@ -1,180 +0,0 @@
{% extends "OpenBench/base.html" %}
{% load static %}
{% block scripts %}
{{ config|json_script:"json-config" }}
{{ networks|json_script:"json-networks" }}
{{ profile.repos|json_script:"json-repos" }}
<script src="{% static 'create_test.js' %}"></script>
<script src="{% static 'default_text.js' %}"></script>
<script>
document.addEventListener(
'DOMContentLoaded', function () {
change_engine('{{ profile.engine }}', 'dev');
enforce_default_text('dev_repo', 'https://github.com/');
enforce_default_text('base_repo', 'https://github.com/');
}, false
);
</script>
{% endblock %}
{% block content %}
<form method="POST" action="/newTest/">
{% csrf_token %}
<div class="form w-100">
<div class="col">
<h3> Engines </h3>
<div class="row">
<label for="dev_engine"> Dev Engine </label>
<select id="dev_engine" name="dev_engine" onchange="change_engine(value, 'dev');">
{% for engine in config.engines %}
<option value="{{ engine }}">{{ engine }}</option>
{% endfor %}
</select>
</div>
<div class="row">
<label for="dev_repo"> Dev Source </label> <input id="dev_repo" name="dev_repo">
</div>
<div class="row">
<label for="base_engine"> Base Engine </label>
<select id="base_engine" name="base_engine" onchange="change_engine(value, 'base');">
{% for engine in config.engines %}
<option value="{{ engine }}">{{ engine }}</option>
{% endfor %}
</select>
</div>
<div class="row">
<label for="base_repo"> Base Source </label> <input id="base_repo" name="base_repo">
</div>
<h3> Dev Settings </h3>
<div class="row">
<label for="dev_branch" > Dev Branch </label> <input id="dev_branch" name="dev_branch" autofocus>
</div>
<div class="row">
<label for="dev_bench" > Dev Bench </label> <input value="Autofill" id="dev_bench" name="dev_bench">
</div>
<div class="row">
<label for="dev_network" > Dev Network </label> <select id="dev_network" name="dev_network"></select>
</div>
<div class="row">
<label for="dev_options"> Dev Options </label> <input id="dev_options" name="dev_options">
</div>
<div class="row">
<label for="dev_time_control"> Dev Time </label> <input id="dev_time_control" name="dev_time_control">
</div>
<h3> Base Settings </h3>
<div class="row">
<label for="base_branch"> Base Branch </label> <input id="base_branch" name="base_branch">
</div>
<div class="row">
<label for="base_bench"> Base Bench </label> <input value="Autofill" id="base_bench" name="base_bench">
</div>
<div class="row">
<label for="base_network"> Base Network </label> <select id="base_network" name="base_network"></select>
</div>
<div class="row">
<label for="base_options"> Base Options </label> <input id="base_options" name="base_options">
</div>
<div class="row">
<label for="base_time_control" > Base Time </label> <input id="base_time_control" name="base_time_control">
</div>
</div>
<div class="col">
<h3> Test Settings </h3>
<div class="row">
<label for="book_name"> Opening Book </label> <select id="book_name" name="book_name">
{% for name, data in config.books.items %}
<option value="{{ name }}">{{ name }}</option>
{% endfor %}
</select>
</div>
<div class="row">
<label for="test_mode"> Test Mode </label>
<select onchange='set_test_type()' id="test_mode" name="test_mode">
<option selected value="SPRT"> SPRT</option>
<option value="GAMES"> Fixed Games</option>
</select>
</div>
<div class="row">
<label for="test_bounds"> Bounds </label> <input id="test_bounds" name="test_bounds">
</div>
<div class="row">
<label for="test_confidence"> Confidence </label> <input id="test_confidence" name="test_confidence">
</div>
<div class="row">
<label for="test_max_games"> Max Games </label> <input id="test_max_games" name="test_max_games">
</div>
<h3> General Settings </h3>
<div class="row">
<label for="priority"> Priority </label> <input value="0" id="priority" name="priority">
</div>
<div class="row">
<label for="throughput"> Throughput </label> <input value="1000" id="throughput" , name="throughput">
</div>
<div class="row">
<label for="workload_size"> Workload Size </label> <input id="workload_size" name="workload_size">
</div>
<div class="row">
<label for="syzygy_wdl"> Syzygy WDL </label> <select id="syzygy_wdl" name="syzygy_wdl">
<option selected value="DISABLED"> Disabled </option>
<option value="OPTIONAL"> Optional </option>
<option value="7-MAN"> 7-Man </option>
<option value="6-MAN"> 6-Man </option>
<option value="5-MAN"> 5-Man </option>
<option value="4-MAN"> 4-Man </option>
<option value="3-MAN"> 3-Man </option>
</select>
</div>
<h3> Adjudication Settings </h3>
<div class="row">
<label for="syzygy_adj"> Syzygy ADJ. </label>
<select id="syzygy_adj" name="syzygy_adj">
<option value="DISABLED"> Disabled </option>
<option selected value="OPTIONAL"> Optional </option>
<option value="7-MAN"> 7-Man </option>
<option value="6-MAN"> 6-Man </option>
<option value="5-MAN"> 5-Man </option>
<option value="4-MAN"> 4-Man </option>
<option value="3-MAN"> 3-Man </option>
</select>
</div>
<div class="row">
<label for="win_adj"> Win ADJ. </label> <input id="win_adj" name="win_adj">
</div>
<div class="row">
<label for="draw_adj"> Draw ADJ. </label> <input id="draw_adj" name="draw_adj">
</div>
</div>
</div>
<input type="submit" class="anchorbutton btn-start mt-3 mw-84" name="submit" value="Create Engine Test">
</form>
<div class="form">
<div class="col-full">
<div id="test-mode-buttons">
<!-- Generated based on the selected Engine -->
</div>
</div>
</div>
{% endblock %}
-168
View File
@@ -1,168 +0,0 @@
{% extends "OpenBench/base.html" %}
{% load static %}
{% block scripts %}
{{ config|json_script:"json-config" }}
{{ networks|json_script:"json-networks" }}
{{ profile.repos|json_script:"json-repos" }}
<script src="{% static 'create_tune.js' %}"></script>
<script>
document.addEventListener(
'DOMContentLoaded', function () {
set_engine('{{ profile.engine }}');
enforce_default_text('repo', 'https://github.com/');
}, false
);
</script>
{% endblock %}
{% block content %}
<form method="POST" action="/newTune/">
{% csrf_token %}
<div class="form w-100">
<div class="col">
<h3> Engine </h3>
<div class="row">
<label> Engine </label>
<select id="engine" name="dev_engine" onchange="set_engine(value);">
{% for engine in config.engines %}
<option value="{{ engine }}">{{ engine }}</option>
{% endfor %}
</select>
</div>
<div class="row">
<label> Source </label> <input id="repo" name="dev_repo">
</div>
<h3> Engine Settings </h3>
<div class="row">
<label> Branch </label> <input id="branch" name="dev_branch" autofocus>
</div>
<div class="row">
<label> Bench </label> <input value="Autofill" name="dev_bench">
</div>
<div class="row">
<label> Network </label> <select id="network" name="dev_network"></select>
</div>
<div class="row">
<label> Options </label> <input id="options" name="dev_options">
</div>
<div class="row">
<label> Time </label> <input id="time_control" name="dev_time_control">
</div>
<h3> SPSA Methodologies </h3>
<div class="row">
<label> Reporting </label> <select name="spsa_reporting_type">
<option value="BATCHED"> Batched </option>
<option selected value="BULK"> Bulk </option>
</select>
</div>
<div class="row">
<label> Distribution </label> <select name="spsa_distribution_type">
<option selected value="SINGLE"> Single </option>
<option value="MULTIPLE"> Multiple </option>
</select>
</div>
<h3> SPSA Input </h3>
<div class="row">
<textarea style="margin-left:24px" id="spsa_inputs" name="spsa_inputs" rows=9></textarea>
</div>
</div>
<div class="col">
<h3> SPSA Settings </h3>
<div class="row">
<label> Opening Book </label> <select id="book_name" name="book_name">
{% for name, data in config.books.items %}
<option value="{{ name }}">{{ name }}</option>
{% endfor %}
</select>
</div>
<div class="row">
<label> Alpha </label> <input value="0.602" id="spsa_alpha" name="spsa_alpha">
</div>
<div class="row">
<label> Gamma </label> <input value="0.101" id="spsa_gamma" name="spsa_gamma">
</div>
<div class="row">
<label> A-Ratio </label> <input value="0.1" id="spsa_A_ratio" name="spsa_A_ratio">
</div>
<div class="row">
<label> Iterations </label> <input value="200000" id="spsa_iterations" name="spsa_iterations">
</div>
<div class="row">
<label> Pairs-Per </label> <input value="1" id="spsa_pairs_per" name="spsa_pairs_per">
</div>
<h3> General Settings </h3>
<div class="row">
<label> Priority </label> <input value="0" name="priority">
</div>
<div class="row">
<label> Throughput </label> <input value="1000" id="throughput" , name="throughput">
</div>
<div class="row">
<label> Syzygy WDL </label> <select name="syzygy_wdl">
<option selected value="DISABLED"> Disabled </option>
<option value="OPTIONAL"> Optional </option>
<option value="7-MAN"> 7-Man </option>
<option value="6-MAN"> 6-Man </option>
<option value="5-MAN"> 5-Man </option>
<option value="4-MAN"> 4-Man </option>
<option value="3-MAN"> 3-Man </option>
</select>
</div>
<h3> Adjudication Settings </h3>
<div class="row">
<label> Syzygy ADJ. </label>
<select name="syzygy_adj">
<option value="DISABLED"> Disabled </option>
<option selected value="OPTIONAL"> Optional </option>
<option value="7-MAN"> 7-Man </option>
<option value="6-MAN"> 6-Man </option>
<option value="5-MAN"> 5-Man </option>
<option value="4-MAN"> 4-Man </option>
<option value="3-MAN"> 3-Man </option>
</select>
</div>
<div class="row">
<label> Win ADJ. </label> <input id="win_adj" name="win_adj">
</div>
<div class="row">
<label> Draw ADJ. </label> <input id="draw_adj" name="draw_adj">
</div>
</div>
</div>
<input type="submit" class="anchorbutton btn-start mt-3 mw-84" name="submit" value="Create SPSA Tune">
</form>
<div class="form">
<div class="col-full">
<div id="test-mode-buttons">
<!-- Generated based on the selected Engine -->
</div>
</div>
</div>
{% endblock %}
+248
View File
@@ -0,0 +1,248 @@
{% extends "OpenBench/base.html" %}
{% load static %}
{% block scripts %}
{{ config|json_script:"json-config" }}
{{ networks|json_script:"json-networks" }}
{{ profile.repos|json_script:"json-repos" }}
<script src="{% static 'create_workload.js' %}"></script>
<script src="{% static 'default_text.js' %}"></script>
<script>
document.addEventListener(
'DOMContentLoaded', function () {
change_engine('{{ profile.engine }}', 'dev', '{{workload}}');
enforce_default_text('dev_repo', 'https://github.com/');
enforce_default_text('base_repo', 'https://github.com/');
}, false
);
</script>
{% endblock %}
{% block content %}
<form method="POST" action="{{submit_endpoint}}">
{% csrf_token %}
<div class="form w-100">
<div class="col">
<h3> Engines </h3>
<div class="row">
<label for="dev_engine"> {{dev_text}} Engine </label>
<select id="dev_engine" name="dev_engine" onchange="change_engine(value, 'dev', '{{workload}}');">
{% for engine in config.engines %}
<option value="{{ engine }}">{{ engine }}</option>
{% endfor %}
</select>
</div>
<div class="row">
<label for="dev_repo"> {{dev_text}} Source </label> <input id="dev_repo" name="dev_repo">
</div>
{% if workload == "TEST" %}
<div class="row">
<label for="base_engine"> Base Engine </label>
<select id="base_engine" name="base_engine" onchange="change_engine(value, 'base', '{{workload}}');">
{% for engine in config.engines %}
<option value="{{ engine }}">{{ engine }}</option>
{% endfor %}
</select>
</div>
<div class="row">
<label for="base_repo"> Base Source </label> <input id="base_repo" name="base_repo">
</div>
{% endif %}
<h3> {{dev_title_text}} Settings </h3>
<div class="row">
<label for="dev_branch" > {{dev_text}} Branch </label> <input id="dev_branch" name="dev_branch" autofocus>
</div>
<div class="row">
<label for="dev_bench" > {{dev_text}} Bench </label> <input value="Autofill" id="dev_bench" name="dev_bench">
</div>
<div class="row">
<label for="dev_network" > {{dev_text}} Network </label> <select id="dev_network" name="dev_network"></select>
</div>
<div class="row">
<label for="dev_options"> {{dev_text}} Options </label> <input id="dev_options" name="dev_options">
</div>
<div class="row">
<label for="dev_time_control"> {{dev_text}} Time </label> <input id="dev_time_control" name="dev_time_control">
</div>
{% if workload == "TEST" %}
<h3> Base Settings </h3>
<div class="row">
<label for="base_branch"> Base Branch </label> <input id="base_branch" name="base_branch">
</div>
<div class="row">
<label for="base_bench"> Base Bench </label> <input value="Autofill" id="base_bench" name="base_bench">
</div>
<div class="row">
<label for="base_network"> Base Network </label> <select id="base_network" name="base_network"></select>
</div>
<div class="row">
<label for="base_options"> Base Options </label> <input id="base_options" name="base_options">
</div>
<div class="row">
<label for="base_time_control" > Base Time </label> <input id="base_time_control" name="base_time_control">
</div>
{% elif workload == "TUNE" %}
<h3> SPSA Methodologies </h3>
<div class="row">
<label for="spsa_reporting_type"> Reporting </label>
<select id="spsa_reporting_type" name="spsa_reporting_type">
<option value="BATCHED"> Batched </option>
<option selected value="BULK"> Bulk </option>
</select>
</div>
<div class="row">
<label for="spsa_distribution_type"> Distribution </label>
<select id="spsa_distribution_type" name="spsa_distribution_type">
<option selected value="SINGLE"> Single </option>
<option value="MULTIPLE"> Multiple </option>
</select>
</div>
<h3> SPSA Input </h3>
<div class="row">
<textarea style="margin-left:24px" id="spsa_inputs" name="spsa_inputs" rows=9></textarea>
</div>
{% endif %}
</div>
<div class="col">
{% if workload == "TEST" %}
<h3> Test Settings </h3>
<div class="row">
<label for="test_mode"> Test Mode </label>
<select onchange='set_test_type()' id="test_mode" name="test_mode">
<option selected value="SPRT"> SPRT</option>
<option value="GAMES"> Fixed Games</option>
</select>
</div>
<div class="row">
<label for="test_bounds"> Bounds </label> <input id="test_bounds" name="test_bounds">
</div>
<div class="row">
<label for="test_confidence"> Confidence </label> <input id="test_confidence" name="test_confidence">
</div>
<div class="row">
<label for="test_max_games"> Max Games </label> <input id="test_max_games" name="test_max_games">
</div>
{% elif workload == "TUNE" %}
<h3> SPSA Settings </h3>
<div class="row">
<label for="spsa_alpha"> Alpha </label> <input value="0.602" id="spsa_alpha" name="spsa_alpha">
</div>
<div class="row">
<label for="spsa_gamma"> Gamma </label> <input value="0.101" id="spsa_gamma" name="spsa_gamma">
</div>
<div class="row">
<label for="spsa_A_ratio"> A-Ratio </label> <input value="0.1" id="spsa_A_ratio" name="spsa_A_ratio">
</div>
<div class="row">
<label for="spsa_iterations"> Iterations </label> <input value="200000" id="spsa_iterations" name="spsa_iterations">
</div>
<div class="row">
<label for="spsa_pairs_per"> Pairs-Per </label> <input value="1" id="spsa_pairs_per" name="spsa_pairs_per">
</div>
{% endif %}
<h3> General Settings </h3>
<div class="row">
<label for="book_name"> Opening Book </label> <select id="book_name" name="book_name">
{% for name, data in config.books.items %}
<option value="{{ name }}">{{ name }}</option>
{% endfor %}
</select>
</div>
<div class="row">
<label for="priority"> Priority </label> <input value="0" id="priority" name="priority">
</div>
<div class="row">
<label for="throughput"> Throughput </label> <input value="1000" id="throughput" , name="throughput">
</div>
{% if workload == "TEST" %}
<div class="row">
<label for="workload_size"> Workload Size </label> <input id="workload_size" name="workload_size">
</div>
{% endif %}
<div class="row">
<label for="syzygy_wdl"> Syzygy WDL </label> <select id="syzygy_wdl" name="syzygy_wdl">
<option selected value="DISABLED"> Disabled </option>
<option value="OPTIONAL"> Optional </option>
<option value="7-MAN"> 7-Man </option>
<option value="6-MAN"> 6-Man </option>
<option value="5-MAN"> 5-Man </option>
<option value="4-MAN"> 4-Man </option>
<option value="3-MAN"> 3-Man </option>
</select>
</div>
<h3> Adjudication Settings </h3>
<div class="row">
<label for="syzygy_adj"> Syzygy ADJ. </label>
<select id="syzygy_adj" name="syzygy_adj">
<option value="DISABLED"> Disabled </option>
<option selected value="OPTIONAL"> Optional </option>
<option value="7-MAN"> 7-Man </option>
<option value="6-MAN"> 6-Man </option>
<option value="5-MAN"> 5-Man </option>
<option value="4-MAN"> 4-Man </option>
<option value="3-MAN"> 3-Man </option>
</select>
</div>
<div class="row">
<label for="win_adj"> Win ADJ. </label> <input id="win_adj" name="win_adj">
</div>
<div class="row">
<label for="draw_adj"> Draw ADJ. </label> <input id="draw_adj" name="draw_adj">
</div>
</div>
</div>
<input type="submit" class="anchorbutton btn-start mt-3 mw-84" name="submit" value="{{submit_text}}">
</form>
<div class="form">
<div class="col-full">
<div id="test-mode-buttons">
<!-- Generated based on the selected Engine -->
</div>
</div>
</div>
{% endblock %}