diff --git a/Client/Client.py b/Client/Client.py index df666fa..037108d 100644 --- a/Client/Client.py +++ b/Client/Client.py @@ -48,7 +48,7 @@ from itertools import combinations_with_replacement TIMEOUT_HTTP = 30 # Timeout in seconds for HTTP requests TIMEOUT_ERROR = 10 # Timeout in seconds when any errors are thrown TIMEOUT_WORKLOAD = 30 # Timeout in seconds between workload requests -CLIENT_VERSION = '4' # Client version to send to the Server +CLIENT_VERSION = '5' # Client version to send to the Server SYZYGY_WDL_PATH = None # Pathway to WDL Syzygy Tables BASE_GAMES_PER_CORE = 32 # Typical games played per-thread @@ -783,10 +783,13 @@ def build_cutechess_command(arguments, workload, dev_name, base_name, nps): dev_options = ' option.'.join([''] + dev_options.split()) base_options = ' option.'.join([''] + base_options.split()) + win_adj = ['', '-resign ' + workload['test']['win_adj' ]][workload['test']['win_adj' ] != 'None'] + draw_adj = ['', '-draw ' + workload['test']['draw_adj']][workload['test']['draw_adj'] != 'None'] + book_name = workload['test']['book']['name'] variant = ['standard', 'fischerandom']['FRC' in book_name.upper()] - flags = '-repeat -recover -resign %s -draw %s ' + flags = '-repeat -recover %s %s ' flags += '-srand %d -variant %s -concurrency %d -games %d ' flags += '-engine dir=Engines/ cmd=./%s proto=uci %s%s name=%s ' flags += '-engine dir=Engines/ cmd=./%s proto=uci %s%s name=%s ' @@ -805,7 +808,7 @@ def build_cutechess_command(arguments, workload, dev_name, base_name, nps): time_control = scale_time_control(workload, nps) args = ( - 'movecount=3 score=400', 'movenumber=40 movecount=8 score=10', + win_adj, draw_adj, int(time.time()), variant, concurrency, games, dev_name, time_control, dev_options, dev_name.rstrip('.exe'), base_name, time_control, base_options, base_name.rstrip('.exe'), diff --git a/OpenBench/config.py b/OpenBench/config.py index 0ee7a09..ae80a36 100644 --- a/OpenBench/config.py +++ b/OpenBench/config.py @@ -23,7 +23,7 @@ USE_CROSS_APPROVAL = False OPENBENCH_CONFIG = { # Server Client version control - 'client_version' : '4', + 'client_version' : '5', # Generic Error Messages useful to those setting up their own instance 'error' : { @@ -106,6 +106,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 3.00]', 'source' : 'https://github.com/AndyGrant/Ethereal', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : 'src', 'compilers' : ['clang', 'gcc'], @@ -113,14 +116,10 @@ OPENBENCH_CONFIG = { }, 'testmodes' : [ - { 'id' : 'STC', 'th' : 1, 'hash' : 8, 'tc' : '10.0+0.1' }, - { 'id' : 'LTC', 'th' : 1, 'hash' : 64, 'tc' : '60.0+0.6' }, - { 'id' : 'SMP STC', 'th' : 8, 'hash' : 64, 'tc' : '5.0+0.05' }, - { 'id' : 'SMP LTC', 'th' : 8, 'hash' : 256, 'tc' : '20.0+0.2' }, - { 'id' : 'STC Simplification', 'th' : 1, 'hash' : 8, 'tc' : '10.0+0.1', 'bounds' : '[-3.00, 1.00]' }, - { 'id' : 'LTC Simplification', 'th' : 1, 'hash' : 64, 'tc' : '60.0+0.6', 'bounds' : '[-3.00, 1.00]' }, - { 'id' : 'STC Regression', 'th' : 1, 'hash' : 8, 'tc' : '10.0+0.1', 'book' : '8moves_v3.epd', 'games' : 40000 }, - { 'id' : 'LTC Regression', 'th' : 1, 'hash' : 64, 'tc' : '60.0+0.6', 'book' : '8moves_v3.epd', 'games' : 40000 }, + { 'id' : 'STC', 'th' : 1, 'hash' : 8, 'tc' : '10.0+0.1' }, + { 'id' : 'LTC', 'th' : 1, 'hash' : 64, 'tc' : '60.0+0.6' }, + { 'id' : 'SMP STC', 'th' : 8, 'hash' : 64, 'tc' : '5.0+0.05' }, + { 'id' : 'SMP LTC', 'th' : 8, 'hash' : 256, 'tc' : '20.0+0.2' }, ], }, @@ -132,6 +131,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 5.00]', 'source' : 'https://github.com/jeffreyan11/uci-chess-engine', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : 'src', 'compilers' : ['g++'], @@ -154,6 +156,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[-1.00, 4.00]', 'source' : 'https://github.com/TerjeKir/weiss', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : 'src', 'compilers' : ['gcc'], @@ -176,6 +181,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 5.00]', 'source' : 'https://github.com/lucasart/Demolito', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : 'src', 'compilers' : ['clang', 'gcc'], @@ -198,6 +206,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 5.00]', 'source' : 'https://github.com/Matthies/RubiChess', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : 'src', 'compilers' : ['g++'], @@ -220,6 +231,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 5.00]', 'source' : 'https://github.com/fabianvdW/FabChess', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : '', 'compilers' : ['cargo>=1.41.0'], @@ -242,6 +256,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 3.00]', 'source' : 'https://github.com/vshcherbyna/igel', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : 'src', 'compilers' : ['g++'], @@ -264,6 +281,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 5.00]', 'source' : 'https://github.com/rosenthj/Winter', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : '', 'compilers' : ['clang++', 'g++'], @@ -286,6 +306,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 5.00]', 'source' : 'https://github.com/KierenP/Halogen', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : 'src', 'compilers' : ['g++'], @@ -308,6 +331,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 5.00]', 'source' : 'https://github.com/mhouppin/stash-bot', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : 'src', 'compilers' : ['gcc', 'clang'], @@ -330,6 +356,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 5.00]', 'source' : 'https://github.com/connormcmonigle/seer-nnue', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : 'build', 'compilers' : ['g++>=9.0.0'], @@ -352,6 +381,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 2.50]', 'source' : 'https://github.com/Luecx/Koivisto', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : 'src_files', 'compilers' : ['g++'], @@ -374,6 +406,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 5.00]', 'source' : 'https://github.com/justNo4b/Drofa', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : '', 'compilers' : ['g++'], @@ -396,6 +431,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 5.00]', 'source' : 'https://github.com/Aryan1508/Bit-Genie', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : 'src', 'compilers' : ['g++'], @@ -418,6 +456,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 3.00]', 'source' : 'https://github.com/jhonnold/berserk', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : 'src', 'compilers' : ['gcc'], @@ -440,6 +481,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 5.00]', 'source' : 'https://github.com/amanjpro/zahak', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : '', 'compilers' : ['go'], @@ -462,6 +506,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 5.00]', 'source' : 'https://github.com/dsekercioglu/blackmarlin', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : '', 'compilers': ['cargo>=1.57.0'], @@ -484,6 +531,9 @@ OPENBENCH_CONFIG = { 'bounds' : '[0.00, 5.00]', 'source' : 'https://github.com/kz04px/4ku', + 'win_adj' : 'movecount=3 score=400', + 'draw_adj' : 'movenumber=40 movecount=8 score=10', + 'build' : { 'path' : '', 'compilers' : ['g++'], diff --git a/OpenBench/models.py b/OpenBench/models.py index ef32e14..fb419ac 100644 --- a/OpenBench/models.py +++ b/OpenBench/models.py @@ -103,6 +103,9 @@ class Test(Model): syzygy_adj = CharField(max_length=16, default='OPTIONAL') syzygy_wdl = CharField(max_length=16, default='OPTIONAL') + win_adj = CharField(max_length=64, default='movecount=3 score=400') + draw_adj = CharField(max_length=64, default='movenumber=40 movecount=8 score=10') + # Only for SPRT Tests elolower = FloatField(default=0.0) eloupper = FloatField(default=0.0) diff --git a/OpenBench/utils.py b/OpenBench/utils.py index befec4a..face156 100644 --- a/OpenBench/utils.py +++ b/OpenBench/utils.py @@ -203,25 +203,35 @@ def verifyNewTest(request): def verifyInteger(field, fieldName): try: int(request.POST[field]) - except: errors.append('{0} is not an Integer'.format(fieldName)) + except: errors.append('"{0}" is not an Integer'.format(fieldName)) def verifyGreaterThan(field, fieldName, value, valueName): 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, valueName)) def verifyOptions(field, option, fieldName): if extractOption(request.POST[field], option) == None: - errors.append('{0} was not found as an option for {1}'.format(option, fieldName)) + errors.append('"{0}" was not found as an option for {1}'.format(option, fieldName)) elif int(extractOption(request.POST[field], option)) < 1: - errors.append('{0} needs to be at least 1 for {1}'.format(option, fieldName)) + errors.append('"{0}" needs to be at least 1 for {1}'.format(option, fieldName)) def verifyConfiguration(field, fieldName, parent): if request.POST[field] not in OpenBench.config.OPENBENCH_CONFIG[parent].keys(): - errors.append('{0} was not found in the configuration'.format(fieldName)) + errors.append('"{0}" was not found in the configuration'.format(fieldName)) def verifyTimeControl(field, fieldName): try: parseTimeControl(request.POST[field]) - except: errors.append('{0} is not a parsable {1}'.format(request.POST[field], fieldName)) + except: errors.append('"{0}" is not a parsable {1}'.format(request.POST[field], fieldName)) + + def verifyWinAdjudication(field): + if (content := request.POST[field]) == 'None': return + try: assert re.match('movecount=[0-9]+ score=[0-9]+', content) + except: errors.append('"{0}" is not a parsable Win Adjudication Seting'.format(content)) + + def verifyDrawAdjudication(field): + if (content := request.POST[field]) == 'None': return + try: assert re.match('movenumber=[0-9]+ movecount=[0-9]+ score=[0-9]+', content) + except: errors.append('"{0}" is not a parsable Draw Adjudication Seting'.format(content)) verifications = [ (verifyInteger, 'priority', 'Priority'), @@ -234,6 +244,8 @@ def verifyNewTest(request): (verifyConfiguration, 'enginename', 'Engine', 'engines'), (verifyConfiguration, 'bookname', 'Book', 'books'), (verifyTimeControl, 'timecontrol', 'Time Control'), + (verifyWinAdjudication, 'win_adj'), + (verifyDrawAdjudication, 'draw_adj'), ] for verification in verifications: @@ -244,7 +256,7 @@ def verifyNewTest(request): def createNewTest(request): - errors = []; verifyNewTest(request) + errors = verifyNewTest(request) if errors != []: return None, errors devinfo = getBranch(request, errors, 'dev') @@ -264,8 +276,10 @@ def createNewTest(request): test.timecontrol = parseTimeControl(request.POST['timecontrol']) test.priority = int(request.POST['priority']) test.throughput = int(request.POST['throughput']) - test.syzygy_adj = request.POST['syzygy_adj'] 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'] if request.POST['test_mode'] == 'SPRT': test.elolower = float(request.POST['bounds'].split(',')[0].lstrip('[')) @@ -430,14 +444,15 @@ def workload_to_dictionary(test, result, machine): 'test' : { - 'throughput' : 1000, # HACK: Updated Client's no longer need this value - 'id' : test.id, 'engine' : test.engine, 'timecontrol' : test.timecontrol, - 'syzygy_adj' : test.syzygy_adj, 'syzygy_wdl' : test.syzygy_wdl, + '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], diff --git a/Templates/OpenBench/newTest.html b/Templates/OpenBench/newTest.html index 6fb083c..dc79e67 100644 --- a/Templates/OpenBench/newTest.html +++ b/Templates/OpenBench/newTest.html @@ -4,21 +4,23 @@ var Configurations = { {% for name, data in config.engines.items %} - '{{name}}' : { - 'base' : "{{data.base}}", - 'book' : "{{data.book}}", - 'bounds' : "{{data.bounds}}", + "{{name}}" : { + "base" : "{{data.base}}", + "book" : "{{data.book}}", + "bounds" : "{{data.bounds}}", + "win_adj" : "{{data.win_adj}}", + "draw_adj" : "{{data.draw_adj}}", }, {% endfor %} }; var TestModes = { {% for name, data in config.engines.items %} - '{{name}}' : [ + "{{name}}" : [ {% for mode in data.testmodes %} { {% for key, value in mode.items %} - '{{key}}' : '{{value}}', + "{{key}}" : "{{value}}", {% endfor %} }, {% endfor %} @@ -162,14 +164,12 @@ baseopt.selected = (hasdefault == false); basenet.add(baseopt); } - var base_branch = document.getElementById("basebranch"); - base_branch.value = Configurations[engine]["base"]; - - var book_selection = document.getElementById("bookname"); - book_selection.value = Configurations[engine]["book"]; + document.getElementById("basebranch").value = Configurations[engine]["base"]; + document.getElementById("bookname" ).value = Configurations[engine]["book"]; + document.getElementById("win_adj" ).value = Configurations[engine]["win_adj"]; + document.getElementById("draw_adj" ).value = Configurations[engine]["draw_adj"]; } - document.addEventListener( 'DOMContentLoaded', function () { set_test_type(); @@ -231,18 +231,23 @@

-
-
+

Adjudication Settings

+ +
+ +
+
+
diff --git a/Templates/OpenBench/test.html b/Templates/OpenBench/test.html index 391fe89..7bf1395 100644 --- a/Templates/OpenBench/test.html +++ b/Templates/OpenBench/test.html @@ -35,9 +35,11 @@ {% endif %} Source Repo{{test.source}} Opening Book{{test.bookname}} - - Syzygy ADJ{{test.syzygy_adj}} Syzygy WDL{{test.syzygy_wdl}} + Syzygy ADJ.{{test.syzygy_adj}} + Win ADJ.{{test.win_adj}} + Draw ADJ.{{test.draw_adj}} +