Skip to content
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

Add stop command to selfplay interactive mode to allow for graceful exit. #810

Merged
merged 1 commit into from
Mar 28, 2019

Conversation

Tilps
Copy link
Contributor

@Tilps Tilps commented Mar 21, 2019

Doesn't stop any games in progress as opposed to quit which terminates the app.

If we want to really aggressively go after short game bias we would also need to ensure each thread plays the same number of games, but at least with this in place we can look at migrating the client to use interactive mode to reduce short game bias. Every thread same number of games could be another flag in future.

@Tilps Tilps requested a review from borg323 March 21, 2019 06:25
@@ -85,6 +85,11 @@ void SelfPlayLoop::CmdStart() {
std::make_unique<std::thread>([this]() { tournament_->RunBlocking(); });
}

void SelfPlayLoop::CmdStop() {
tournament_->Stop();
tournament_->Wait();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wait is here so you can issue stop/quit as a pair - and when the app has exited its done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Nicer" solution would be stop+isready+quit, but selfplay is not real UCI anyway.

@Tilps
Copy link
Contributor Author

Tilps commented Mar 21, 2019

Actually I don't think we need an option to make each thread do the same number of games - it doesn't change the bias level. Or maybe it does - I think I'm too tired to determine this.

@@ -85,6 +85,11 @@ void SelfPlayLoop::CmdStart() {
std::make_unique<std::thread>([this]() { tournament_->RunBlocking(); });
}

void SelfPlayLoop::CmdStop() {
tournament_->Stop();
tournament_->Wait();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Nicer" solution would be stop+isready+quit, but selfplay is not real UCI anyway.

@Tilps Tilps merged commit 7e4b03e into LeelaChessZero:master Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants