-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use directories for engines and add EGTB support #547
Use directories for engines and add EGTB support #547
Conversation
If this is merged then it would be a permanent part of fishtest, because normally we don't add features for a limited time. I am OK with adding such a feature (not much code added), but @vondele opinion is important here. Regarding the code, @ppigazzini and @vondele are most familiar with the worker file tree layout, so it would be nice if they review this PR. |
I think it doesn't have to be just for 'egtb', we can use a more generic way of supplying 'additional files for the engine'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@protonspring updater.py
changes missing, check my review.
def setup_engine(engine_dir, sha, repo_url, concurrency): | ||
new_engine_name = 'stockfish_' + sha | ||
destination = os.path.join(engine_dir, new_engine_name) | ||
if os.path.exists(engine_dir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover of the original code: if engine_dir
exist we don't call setup_engine()
@@ -124,7 +130,7 @@ def setup_engine(destination, worker_dir, sha, repo_url, concurrency): | |||
src_dir = name | |||
os.chdir(src_dir) | |||
|
|||
custom_make = os.path.join(worker_dir, 'custom_make.txt') | |||
custom_make = os.path.join(engine_dir, 'custom_make.txt') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'custom_make.txt' is written in working_dir
@@ -136,12 +142,22 @@ def setup_engine(destination, worker_dir, sha, repo_url, concurrency): | |||
except: | |||
pass | |||
|
|||
shutil.copy('stockfish'+ EXE_SUFFIX, destination) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
destination needs + EXE_SUFFIX
if os.path.exists(egtb_dir_src): | ||
egtb_dir_dest = os.path.join(engine_dir, 'egtb') | ||
if not os.path.exists(egtb_dir_dest): | ||
os.makedirs(egtb_dir_dest) | ||
|
||
shutil.copytree(egtb_dir_src, egtb_dir_dest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work better:
if os.path.exists(egtb_dir_src):
shutil.move(egtb_dir_src, engine_dir)
@vondele I think that is your responsibility to decide if/how use additional files for Stockfish :) |
I'd be glad to make those changes if this may be committed. I'll wait for an indicator from big boss man. |
I haven't fully reviewed the patch, if we want to be generic we could use 'data' instead of 'egtb' for the directory that is symlinked/copied. My concern with this is that this is a tool, but we have not discussed on the policy on how to use it. It really is attractive to use a resource like fishtest to try interesting experiments, and I like creative experiments (I'd have some of my own as well that would benefit from such a resource ;-)). However some questions we need to answer would be:
Feel free to give partial answers. |
|
Nothing is happening here. Should I close this? |
I still don't like the idea of adding EGTB (or any other non-source file blob) to patches on fishtest. The cleanups themselves, I haven't judged. |
NP. I'll close this. |
This patch creates the engines in their separate directories and simplifies setup_engine. With this patch, engines can use different EGTB tables depending on which are added to the branches being tested.
This only allows a developer to test EGTB tables. If one proves to be beneficial, then we can discuss permanently adding it to fishtest. This is a different issue not addressed here.
I know very little Python and barely understand the code, but I think this does what I would want it to do.
Hopefully this is close. Please don't crucify me.