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

Make learner work on top of stockfish's thread pool instead of MultiThink. #200

Merged
merged 1 commit into from
Oct 21, 2020

Conversation

Sopel97
Copy link
Collaborator

@Sopel97 Sopel97 commented Oct 20, 2020

This is a rewrite (restructuring) of the learner code so that it uses the newly added feature that allows execution of arbitrary tasks on stockfish's thread pool. In particular it:

  • removes many parts of the code that were previously required for synchronization and task scheduling.
  • provides clearer distinction between single and multithreaded execution contexts
  • makes the control flow more linear
  • decouples SfenReader from LearnerThink
  • removes [no longer] used parts of the learner
  • removed old misleading comments and replaced them with new ones where necessary.
  • adds Entropy struct to make passing and summing all the entropy statistics around the code easier

As this is a more or less a complete rewrite the diff is kinda hard to read, best to compare whole files side by side. If you think this should be split further I can try, but in my opinion looking at this in its final stage is easier to compare than looking at intermediate steps in isolation.

As a side effect it may have [partially] fixed #164.

src/learn/learn.cpp Outdated Show resolved Hide resolved
Copy link
Owner

@nodchip nodchip left a comment

Choose a reason for hiding this comment

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

Thank you for renaming. I think that we also could be better to rename the variable entropy to loss. Could you please rename it?

src/learn/learn.cpp Outdated Show resolved Hide resolved
@nodchip nodchip merged commit ff06d1e into nodchip:master Oct 21, 2020
@Sopel97 Sopel97 deleted the cleanup_thread_2 branch November 14, 2020 15:12
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.

race conditions in the code.
2 participants