Repository navigation
Updates to v1.6.1 - #1367
Merged
Merged
Updates to v1.6.1#1367
Conversation
#1365) * Fold the uniform-secret overflow bound K into the CoeffsToSlots matrix Single-iteration CKKS bootstrapping with a UNIFORM_TERNARY secret produced wrong values (absolute error ~0.3, Decode throwing) for a 50-bit scaling factor with a 60-bit first modulus, for FLEXIBLEAUTO and FIXEDAUTO alike. After the modulus raise, the ciphertext was multiplied by the scalar 2^-deg/(K*N). The 64-bit constant encoder keeps only log2(scalingFactor) - log2(K*N) - deg bits of a constant that small (about 19 bits at a 50-bit scaling factor), and the relative error is amplified by the integer overflow of the raised message and by 2^correctionFactor. With K = 512 the scalar was an exact power of two, so the truncation only became visible once K was raised to 648. K is now folded into the CoeffsToSlots matrix at setup, as it already was for the sparse secret distributions and for functional bootstrapping, and the runtime scalar is the exact power of two 2^-deg/N. The same change is applied to the StC-first variant and to FE functional bootstrapping, which used the same runtime scalar. Measured precision matches the K = 512 version. A new UTCKKSRNS_BOOT row (uniform secret, FLEXIBLEAUTO, 50-bit scaling factor, level budget {3, 3}, 8 slots) fails without the fix and passes with it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Throw on bootstrapping with a precomputation from another variant Regular, FBT and FEFBT setups fold different overflow bounds K into the CoeffsToSlots matrix, so sharing precomputations across variants gives wrong results. Tag the precomputation with its setup and check the tag at runtime. * Fix wrong transform in EvalBootstrapPrecompute for COMPLEX Match the pair-matrix condition of EvalBootstrapSetup and drop a duplicate m_U0Pre computation. Added a serialization test for this path. * Move the duplicated overflow-bound switch into GetModRaiseOverflowBound. Also remove the dead k variable from the eval functions and fix the "~19 bits" comment. --------- Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>
Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>
dsuponitskiy
approved these changes
Oct 9, 2026
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.
No description provided.