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

Put SPSA code in a separate file. #2262

Merged
merged 1 commit into from
Mar 8, 2025

Conversation

vdbergh
Copy link
Contributor

@vdbergh vdbergh commented Mar 8, 2025

SPSA code related code is sprinkled at various places. It would be beneficial to put it in a single place.

In this PR we move the SPSA code in rundb.py to a separate file. Other code will follow in the future. We submit this PR now because it is difficult to continuously rebase a PR that moves code.

@ppigazzini ppigazzini added server server side changes refactoring non functional code improvement labels Mar 8, 2025
@ppigazzini
Copy link
Collaborator

Mar 08 10:08:45 dfts-0 pserve[8505]:   File "/home/usr00/fishtest/server/fishtest/__init__.py", line 50, in main
Mar 08 10:08:45 dfts-0 pserve[8505]:     rundb = RunDb(port=port, is_primary_instance=is_primary_instance)
Mar 08 10:08:45 dfts-0 pserve[8505]:   File "/home/usr00/fishtest/server/fishtest/rundb.py", line 108, in __init__
Mar 08 10:08:45 dfts-0 pserve[8505]:     self.spsa_handler = fishtest.spsa_handler.SPSAHandler(self)
Mar 08 10:08:45 dfts-0 pserve[8505]:                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
Mar 08 10:08:45 dfts-0 pserve[8505]:   File "/home/usr00/fishtest/server/fishtest/spsa_handler.py", line 83, in __init__
Mar 08 10:08:45 dfts-0 pserve[8505]:     self.buffer = rundb.buffer
Mar 08 10:08:45 dfts-0 pserve[8505]:                   ^^^^^^^^^^^^
Mar 08 10:08:45 dfts-0 pserve[8505]: AttributeError: 'RunDb' object has no attribute 'buffer'

@vdbergh
Copy link
Contributor Author

vdbergh commented Mar 8, 2025

Ok I see. A secondary instance does not have buffer. I didn't see that since I run everything in a primary instance.

SPSA code related code is sprinkled at various places. It would
be beneficial to put it in a single place.

In this PR we move the SPSA code in rundb.py to a separate file.
Other code will follow in the future. We submit this PR now
because it is difficult to continuously rebase a PR that moves code.
@vdbergh
Copy link
Contributor Author

vdbergh commented Mar 8, 2025

Should be fixed.

Copy link
Collaborator

@ppigazzini ppigazzini left a comment

Choose a reason for hiding this comment

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

Looks good on DEV with a couple of SPSAs. PROD update in seconds, thank you @vdbergh

@ppigazzini ppigazzini merged commit d70e7f5 into official-stockfish:master Mar 8, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring non functional code improvement server server side changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants