Repository navigation
Allow exact bit precision in native coefficient evaluation - #14
Open
huashengshao wants to merge 1 commit into
Open
huashengshao wants to merge 1 commit into
huashengshao wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Native coefficient callers currently select arbitrary precision through decimal digit counts, which cannot express every requested binary working precision. Add
CoefficientEvaluator::with_precision_bits(state, arithmetic, bits)to select the existing executor directly:Doublerequires 53 bits,DoubleDoublerequires 106, andArbitraryaccepts at least two bits, including 113 and nonstandard bit counts. The legacy string/decimal constructor parses its existing arguments and delegates to this constructor; there is no second evaluator, decimal conversion, hidden guard precision, or dependency change.The requested bits set the initial working precision. Numerica Float still propagates precision through arithmetic and may reduce it after cancellation; typed inputs must use the selected carrier and working precision.
Validation:
cargo test -p rusticol-loop-reduction --test runtime_precision_bits --offline -j1passed all three tests. A native exact saved state containing(1+2^-80)*(1+i)retains the sub-binary64 coefficient at 113, 137 and 257 bits, with assertions on the actual real and imaginary component precision in both scalar and multirow execution. Additional checks cover fixed-carrier equivalence with the legacy constructor, legacy decimal selection, the two-bit minimum, and rejection of incompatible fixed-carrier requests or zero/one arbitrary bits. Changed Rust files are formatted and the diff passes whitespace checks.This change is based on the native evaluator preparation in PR #7 (commit
1c4fe375).