Add report_rate and workload_size options to Tests

This commit is contained in:
andrew committed 2023-04-06 01:12:02 -04:00
1 parent e229b26f9d
commit c32dbef9dd
7 files changed
+85 -52

No files matched your search

+4
View File
@@ -106,6 +106,10 @@ class Test(Model):
win_adj = CharField(max_length=64, default='movecount=3 score=400')
draw_adj = CharField(max_length=64, default='movenumber=40 movecount=8 score=10')
# Client configuration
report_rate = IntegerField(default=8)
workload_size = IntegerField(default=32)
# Only for SPRT Tests
elolower = FloatField(default=0.0)
eloupper = FloatField(default=0.0)
+11 -6
View File
@@ -17,14 +17,14 @@ a:link, a:visited, a:hover, a:active {
#sidebar ul {
list-style-type: none;
padding: 0px 16px 0px 8px;
line-height: 1.75;
padding: 0px 0px 0px 8px;
line-height: 1.50;
}
#sidebar li a {
color: #A2A2A2;
padding: 0px 16px;
font-size: 1.0rem;
font-size: 16px;
}
#sidebar li:hover {
@@ -35,7 +35,7 @@ a:link, a:visited, a:hover, a:active {
#sidebar .header {
color: #00AF00;
padding: 0px 16px;
font-size: 1.0rem;
font-size: 16px;
}
#sidebar .header:hover {
@@ -58,14 +58,19 @@ a:link, a:visited, a:hover, a:active {
}
#content input, #content select {
background-color: #BBBBBB;
color: #000000;
padding: 10px;
margin: 1px 0px;
width: 320px;
box-sizing: border-box;
width: 340px;
border: 2px solid black;
border-radius: 6px;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
#content button {
+46 -32
View File
@@ -288,9 +288,9 @@ def verifyNewTest(request):
try: int(request.POST[field])
except: errors.append('"{0}" is not an Integer'.format(fieldName))
def verifyGreaterThan(field, fieldName, value, valueName):
def verifyGreaterThan(field, fieldName, value):
if not float(request.POST[field]) > value:
errors.append('"{0}" is not greater than {1}'.format(fieldName, valueName))
errors.append('"{0}" is not greater than {1}'.format(fieldName, value))
def verifyOptions(field, option, fieldName):
if extractOption(request.POST[field], option) == None:
@@ -317,9 +317,18 @@ def verifyNewTest(request):
except: errors.append('"{0}" is not a parsable Draw Adjudication Seting'.format(content))
verifications = [
(verifyInteger, 'priority', 'Priority'),
(verifyInteger, 'throughput', 'Throughput'),
(verifyGreaterThan, 'throughput', 'Throughput', 0, '0'),
# Must have all of these values for test settings
(verifyInteger, 'priority', 'Priority' ),
(verifyInteger, 'throughput', 'Throughput' ),
(verifyInteger, 'report_rate', 'Report Rate' ),
(verifyInteger, 'workload_size', 'Workload Size'),
# Can't allow non-natural values for any of these fields
(verifyGreaterThan, 'throughput', 'Throughput', 0),
(verifyGreaterThan, 'report_rate', 'Report Rate', 0),
(verifyGreaterThan, 'workload_size', 'Workload Size', 0),
(verifyOptions, 'devoptions', 'Threads', 'Dev Options'),
(verifyOptions, 'devoptions', 'Hash', 'Dev Options'),
(verifyOptions, 'baseoptions', 'Threads', 'Base Options'),
@@ -346,23 +355,25 @@ def createNewTest(request):
baseinfo, base_has_all = collect_github_info(request, errors, 'base')
if errors != []: return None, errors
test = Test()
test.author = request.user.username
test.engine = request.POST['enginename']
test.test_mode = request.POST['test_mode']
test.source = request.POST['source']
test.devoptions = request.POST['devoptions'].rstrip(' ')
test.baseoptions = request.POST['baseoptions'].rstrip(' ')
test.devnetwork = request.POST['devnetwork']
test.basenetwork = request.POST['basenetwork']
test.bookname = request.POST['bookname']
test.timecontrol = parseTimeControl(request.POST['timecontrol'])
test.priority = int(request.POST['priority'])
test.throughput = int(request.POST['throughput'])
test.syzygy_wdl = request.POST['syzygy_wdl']
test.syzygy_adj = request.POST['syzygy_adj']
test.win_adj = request.POST['win_adj']
test.draw_adj = request.POST['draw_adj']
test = Test()
test.author = request.user.username
test.engine = request.POST['enginename']
test.test_mode = request.POST['test_mode']
test.source = request.POST['source']
test.devoptions = request.POST['devoptions'].rstrip(' ')
test.baseoptions = request.POST['baseoptions'].rstrip(' ')
test.devnetwork = request.POST['devnetwork']
test.basenetwork = request.POST['basenetwork']
test.bookname = request.POST['bookname']
test.timecontrol = parseTimeControl(request.POST['timecontrol'])
test.priority = int(request.POST['priority'])
test.throughput = int(request.POST['throughput'])
test.syzygy_wdl = request.POST['syzygy_wdl']
test.syzygy_adj = request.POST['syzygy_adj']
test.win_adj = request.POST['win_adj']
test.draw_adj = request.POST['draw_adj']
test.report_rate = int(request.POST['report_rate'])
test.workload_size = int(request.POST['workload_size'])
if request.POST['test_mode'] == 'SPRT':
test.elolower = float(request.POST['bounds'].split(',')[0].lstrip('['))
@@ -531,18 +542,21 @@ def workload_to_dictionary(test, result, machine):
'test' : {
'id' : test.id,
'engine' : test.engine,
'timecontrol' : test.timecontrol,
'syzygy_wdl' : test.syzygy_wdl,
'id' : test.id,
'engine' : test.engine,
'timecontrol' : test.timecontrol,
'syzygy_wdl' : test.syzygy_wdl,
'syzygy_adj' : test.syzygy_adj,
'win_adj' : test.win_adj,
'draw_adj' : test.draw_adj,
'syzygy_adj' : test.syzygy_adj,
'win_adj' : test.win_adj,
'draw_adj' : test.draw_adj,
'nps' : OPENBENCH_CONFIG['engines'][test.engine]['nps'],
'build' : OPENBENCH_CONFIG['engines'][test.engine]['build'],
'book' : OPENBENCH_CONFIG['books'][test.bookname],
'report_rate' : test.report_rate,
'workload_size' : test.workload_size,
'nps' : OPENBENCH_CONFIG['engines'][test.engine]['nps'],
'build' : OPENBENCH_CONFIG['engines'][test.engine]['build'],
'book' : OPENBENCH_CONFIG['books'][test.bookname],
'dev' : {
'id' : test.dev.id, 'name' : test.dev.name,
+7 -5
View File
@@ -420,9 +420,9 @@ def test(request, id, action=None):
return django.http.HttpResponseRedirect('/index/')
if action not in ['APPROVE', 'RESTART', 'STOP', 'DELETE', 'MODIFY']:
test = Test.objects.get(id=id)
test = Test.objects.get(id=id)
results = Result.objects.filter(test=test).order_by('machine_id')
data = {'test' : test, 'results': results}
data = {'test' : test, 'results': results}
return render(request, 'test.html', data)
if not request.user.is_authenticated:
@@ -445,11 +445,13 @@ def test(request, id, action=None):
if action == 'DELETE' : test.deleted = True; test.save()
if action == 'MODIFY':
test.priority = int(request.POST['priority'])
test.throughput = max(1, int(request.POST['throughput']))
test.priority = int(request.POST['priority'])
test.throughput = max(1, int(request.POST['throughput']))
test.report_rate = max(1, int(request.POST['report_rate']))
test.workload_size = max(1, int(request.POST['workload_size']))
test.save()
action += " P={0} TP={1}".format(test.priority, test.throughput)
action += " P=%d TP=%d RR=%d WS=%d" % (test.priority, test.throughput, test.report_rate, test.workload_size)
LogEvent.objects.create(author=user.username, summary=action, log_file='', test_id=test.id)
return django.http.HttpResponseRedirect('/index/')