Skip to content

Commit

Permalink
Add Client option --noisy, to reject all time-based workloads
Browse files Browse the repository at this point in the history
Rejects fixed move time, fischer, and cyclic time controls. Also rejects any game with VERBOSE PGN reporting, as those results may be tainted as well.
  • Loading branch information
AndyGrant committed Feb 7, 2025
1 parent 8ab94f2 commit f81d840
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
17 changes: 10 additions & 7 deletions Client/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

## Basic configuration of the Client. These timeouts can be changed at will

CLIENT_VERSION = 35 # Client version to send to the Server
CLIENT_VERSION = 36 # Client version to send to the Server
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
Expand Down Expand Up @@ -108,6 +108,7 @@ def process_args(self, args):
self.identity = args.identity if args.identity else 'None'
self.syzygy_path = args.syzygy if args.syzygy else None
self.fleet = args.fleet if args.fleet else False
self.noisy = args.noisy if args.noisy else False
self.focus = args.focus if args.focus else []

def init_client(self):
Expand Down Expand Up @@ -917,6 +918,7 @@ def server_configure_worker(config):
'concurrency' : config.threads, # Threads to use to play games
'sockets' : config.sockets, # Cutechess copies, usually equal to Socket count
'syzygy_max' : config.syzygy_max, # Whether or not the machine has Syzygy support
'noisy' : config.noisy, # Whether our results are unstable for time-based workloads
'focus' : config.focus, # List of engines we have a preference to help
'client_ver' : CLIENT_VERSION, # Version of the Client, which the server may reject
}
Expand Down Expand Up @@ -1226,12 +1228,13 @@ def parse_arguments(client_args):
)

# Arguments specific to worker.py
p.add_argument('-T', '--threads' , help='Total Threads' , required=True )
p.add_argument('-N', '--nsockets', help='Number of Sockets' , required=True )
p.add_argument('-I', '--identity', help='Machine pseudonym' , required=False )
p.add_argument( '--syzygy' , help='Syzygy WDL' , required=False )
p.add_argument( '--fleet' , help='Fleet Mode' , action='store_true')
p.add_argument( '--focus' , help='Prefer certain engine(s)', nargs='+' )
p.add_argument('-T', '--threads' , help='Total Threads' , required=True )
p.add_argument('-N', '--nsockets', help='Number of Sockets' , required=True )
p.add_argument('-I', '--identity', help='Machine pseudonym' , required=False )
p.add_argument( '--syzygy' , help='Syzygy WDL' , required=False )
p.add_argument( '--fleet' , help='Fleet Mode' , action='store_true')
p.add_argument( '--noisy' , help='Reject time-based workloads' , action='store_true')
p.add_argument( '--focus' , help='Prefer certain engine(s)' , nargs='+' )

# Ignore unknown arguments ( from client )
worker_args, unknown = p.parse_known_args()
Expand Down
2 changes: 1 addition & 1 deletion Config/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"client_version" : 35,
"client_version" : 36,
"client_repo_url" : "https://github.com/AndyGrant/OpenBench",
"client_repo_ref" : "master",

Expand Down
10 changes: 10 additions & 0 deletions OpenBench/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@ def control_base(time_str):



def workload_uses_time_based_tc(workload):

dev_type = TimeControl.control_type(workload.dev_time_control)
base_type = TimeControl.control_type(workload.base_time_control)

return workload.upload_pgns == 'VERBOSE' \
or (dev_type != TimeControl.FIXED_NODES and dev_type != TimeControl.FIXED_DEPTH) \
or (base_type != TimeControl.FIXED_NODES and base_type != TimeControl.FIXED_DEPTH)


def read_git_credentials(engine):
fname = 'credentials.%s' % (engine.replace(' ', '').lower())
fpath = os.path.join(PROJECT_PATH, 'Config', fname)
Expand Down
4 changes: 4 additions & 0 deletions OpenBench/workloads/get_workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ def filter_valid_workloads(request, machine):
workloads = workloads.exclude(syzygy_adj='%d-MAN' % (K))
workloads = workloads.exclude(syzygy_wdl='%d-MAN' % (K))

# Skip any workload using, or measuring, Time, for --noisy workers
if machine.info.get('noisy'):
workloads = [x for x in workloads if not OpenBench.utils.workload_uses_time_based_tc(x)]

# Skip workloads that we have insufficient threads to play
options = [x for x in workloads if valid_hardware_assignment(x, machine)]

Expand Down

0 comments on commit f81d840

Please sign in to comment.