Conversation
Enforce a minimum epsilon of f64::EPSILON times the bracket magnitude, so the resulting tolerance is representable in floating point precision. That bounds nmax so the shift can't overflow. Also clamp r so that it can't become negative, which otherwise can happen because of float precision and can cause an infinite loop. A couple of tweaks to accuracy for eval_arc (in fit.rs) and inv_arclen, avoiding unreasonably small epsilon values (which triggered the original failures) without meaningfully degrading overall accuracy. Adds some regression tests which previously failed. In addition to the tests added in the PR, I've also (with some LLM help) verified against repros in the three linked reports and some additional adversarial testing. This was based on analysis and proposed fixes from #588 by @greysquirr3l, #600 by @kooshi, and #602 by @mlwilkerson. Many thanks to the original submitters. Closes #602 and supersedes #588 and #600
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enforce a minimum epsilon of f64::EPSILON times the bracket magnitude, so the resulting tolerance is representable in floating point precision. That bounds nmax so the shift can't overflow. Also clamp r so that it can't become negative, which otherwise can happen because of float precision and can cause an infinite loop.
A couple of tweaks to accuracy for eval_arc (in fit.rs) and inv_arclen, avoiding unreasonably small epsilon values (which triggered the original failures) without meaningfully degrading overall accuracy.
Adds some regression tests which previously failed. In addition to the tests added in the PR, I've also (with some LLM help) verified against repros in the three linked reports and some additional adversarial testing.
This was based on analysis and proposed fixes from #588 by @greysquirr3l, #600 by @kooshi, and #602 by @mlwilkerson. Many thanks to the original submitters.
Closes #602 and supersedes #588 and #600