From a7c8f76689eeb30fff80c52552dd2187b30fd012 Mon Sep 17 00:00:00 2001 From: maxalexger Date: Tue, 8 Jun 2021 15:17:39 +0200 Subject: [PATCH 1/2] When running RL, log how many tablebases could be found --- engine/src/rl/binaryio.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/engine/src/rl/binaryio.py b/engine/src/rl/binaryio.py index b56e7c02..d1bc7b12 100644 --- a/engine/src/rl/binaryio.py +++ b/engine/src/rl/binaryio.py @@ -171,6 +171,14 @@ def _set_uci_param(self, name: str, value): bytes(str(value), encoding="utf-8"))) self.proc.stdin.flush() + # Log how many tablebases could be found + if name == f'SyzygyPath' and value != '' and value != '': + while True: + line = self.proc.stdout.readline().decode().rstrip('\n') + if line.startswith('info string Found') and line.endswith('tablebases'): + logging.info(line[12:]) + break + def stop_process(self): """ Kills the process that is attached to the binary. From 618e75dea9fd45190a668dd822bb71e80c7d2c90 Mon Sep 17 00:00:00 2001 From: maxalexger Date: Tue, 8 Jun 2021 15:26:41 +0200 Subject: [PATCH 2/2] Loggging configs line by line to increase readability --- engine/src/rl/rl_loop.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/engine/src/rl/rl_loop.py b/engine/src/rl/rl_loop.py index c6d4c40a..b6d9926b 100644 --- a/engine/src/rl/rl_loop.py +++ b/engine/src/rl/rl_loop.py @@ -12,6 +12,7 @@ import logging import argparse from rtpt import RTPT +import dataclasses from multiprocessing import Process, Queue assert os.getcwd().endswith(f'engine/src/rl'), f'Please change working directory' @@ -213,11 +214,18 @@ def main(): rl_loop.rtpt._get_title(), rl_loop.nn_update_index) rl_loop.initialize() - logging.info(f'Command line parameters: {str(args)}') - logging.info(f'RL Options: {rl_config}') - logging.info(f'UCI Options: {rl_loop.binary_io.get_uci_options()}') - logging.info(f'UCI changes for arena: {UCIConfigArena()}') - logging.info(rl_loop.tc) + logging.info(f'--------------- CONFIG SETTINGS ---------------') + for key, value in sorted(vars(args).items()): + logging.info(f'CMD line args: {key} = {value}') + for key, value in sorted(dataclasses.asdict(rl_loop.tc).items()): + logging.info(f'Train Config: {key} = {value}') + for key, value in sorted(dataclasses.asdict(rl_config).items()): + logging.info(f'RL Options: {key} = {value}') + for key, value in rl_loop.binary_io.get_uci_options().items(): + logging.info(f'UCI Options: {key} = {value}') + for key, value in sorted(dataclasses.asdict(UCIConfigArena()).items()): + logging.info(f'UCI Options Arena: {key} = {value}') + logging.info(f'-----------------------------------------------') while True: if args.trainer: