Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

RL Logging: Found tablebases and Configs #130

Merged
merged 2 commits into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions engine/src/rl/binaryio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 != '<empty>':
while True:
QueensGambit marked this conversation as resolved.
Show resolved Hide resolved
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.
Expand Down
18 changes: 13 additions & 5 deletions engine/src/rl/rl_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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:
Expand Down