-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 float-epsilon calculation in Sabre best scores #9117
Conversation
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
This should not meaningfully affect any small-scale outputs, but at larger scales, there are floating-point instabilities that can make the "best swaps" set miss swaps that are logically at the same score as others. This does not (cannot) fully stabilise us against all minor floating-point rounding errors in calculations; the order of iteration through the swaps can still technically change the swap set, for example if three swaps with relative differences `{0, 0.8, 1.6} * BEST_EPSILON` are encountered in a different orders. The float epsilon is chosen to be significantly larger than the actual magnitude of fluctuations, and significantly smaller than the changes caused by all the actual components of scoring, in order to mitigate this effect.
b17c97d
to
8062860
Compare
Pull Request Test Coverage Report for Build 3463181611
💛 - Coveralls |
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.
LGTM, seems straightforward enough
This should not meaningfully affect any small-scale outputs, but at larger scales, there are floating-point instabilities that can make the "best swaps" set miss swaps that are logically at the same score as others. This does not (cannot) fully stabilise us against all minor floating-point rounding errors in calculations; the order of iteration through the swaps can still technically change the swap set, for example if three swaps with relative differences `{0, 0.8, 1.6} * BEST_EPSILON` are encountered in a different orders. The float epsilon is chosen to be significantly larger than the actual magnitude of fluctuations, and significantly smaller than the changes caused by all the actual components of scoring, in order to mitigate this effect. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Summary
This should not meaningfully affect any small-scale outputs, but at larger scales, there are floating-point instabilities that can make the "best swaps" set miss swaps that are logically at the same score as others. This does not (cannot) fully stabilise us against all minor floating-point rounding errors in calculations; the order of iteration through the swaps can still technically change the swap set, for example if three swaps with relative differences
{0, 0.8, 1.6} * BEST_EPSILON
are encountered in a different orders. The float epsilon is chosen to be significantly larger than the actual magnitude of fluctuations, and significantly smaller than the changes caused by all the actual components of scoring, in order to mitigate this effect.Details and comments
This detail is (to the best of my knowledge), the only reason that #9012 broke RNG compatibility in large circuits with the previous Rust version.
Tagging "bugfix" for the more developer-facing GitHub release notes, but there's no specific note for this in the public documentation; that will come with a later PR.