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

enable dynamic renormalization in updateWDL.sh #153

Merged
merged 3 commits into from
Jan 16, 2024

Conversation

robertnurnberg
Copy link
Contributor

@robertnurnberg robertnurnberg commented Dec 21, 2023

This PR prepares the update script for the future, when official-stockfish/Stockfish#4920 will be merged into SF.

Some comments:

  • The PR relies on NormalizeToPawnValue not being present in src/uci.h for SF revisions that do the dynamic eval rescaling. Edit: It now relies on const in NormalizeToPawnValue not being present in src/uci.h and constexpr int NormalizeToPawnValue not being present in src/uci.cpp.
  • For those revisions, the corresponding value of NormalizeToPawnValue is computed on the fly, by summing the coefficients in as. The final sum is rounded, so that after merging use round not trunc for NormalizeToPawnValue #136 this will be consistent with the python script. Note also that for un-doing the dynamic rescaling, the value NormalizeToPawnValue serves only a cosmetic purpose now. It is used at the end of the update script to indicate to the user if that value has changed from SF to the new model, or not.
  • If this new update script is called with the same sha for --firstrev and --lastrev it allows for extracting the newly fitted NormalizeToPawnValue for both static and dynamic renormalization revisions of SF. This may be useful when adapting WIP: update a range of commits #119

For as long as official-stockfish/Stockfish#4920 is not merged into SF, this PR is nonfunctional. Once that PR is merged, the update script needs to be pointed to that new commit in default_firstrev, and it should then seamlessly work for the dynamic eval rescalings.

@robertnurnberg robertnurnberg marked this pull request as draft January 14, 2024 16:09
@robertnurnberg
Copy link
Contributor Author

Latest commit to this PR fixes #156.

@robertnurnberg robertnurnberg marked this pull request as ready for review January 14, 2024 16:20
@Disservin
Copy link
Member

Can we have the grep be completely source file independent? I.e moving the constant around would break the current code?

@robertnurnberg
Copy link
Contributor Author

I think to avoid false positives, the current way is best.

We can make it more general the next time the constant is moved around. (I am running the update script every day, so would spot when things go wrong next time.)

Soon-ish the constant will disappear from SF code, once we switch to dynamic rescaling.

@Disservin Disservin merged commit 23c89f9 into official-stockfish:master Jan 16, 2024
@robertnurnberg robertnurnberg deleted the updatedynamic branch January 17, 2024 07:52
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