Skip to content

Fix CKKS composite scaling first modulus falling short of firstModSize - #1329

Open
dsuponitskiy wants to merge 4 commits into
devfrom
1327-ckks-compositescalingauto-composite-modulus
Open

dsuponitskiy wants to merge 4 commits into
devfrom
1327-ckks-compositescalingauto-composite-modulus

Conversation

@dsuponitskiy

Copy link
Copy Markdown
Collaborator

The first-modulus loop charged its bit budget the requested size of each prime instead of the size actually sampled, so when the primes near a share were already taken the shortfall went unnoticed and accumulated: at ring dimension 16384 an 89-bit firstModSize produced a 75-bit modulus. The budget now follows the primes sampled, reaches above a share once primes of that size run out, releases the scaling primes it overwrites at multiplicative depth 0, and keeps the product below 2^firstModSize. Parameters that cannot reach firstModSize are reported instead of silently costing precision at the last level.

@dsuponitskiy dsuponitskiy added this to the Release 1.6.0 milestone Sep 16, 2026
@dsuponitskiy dsuponitskiy self-assigned this Sep 16, 2026
@dsuponitskiy dsuponitskiy added the bug Something isn't working label Sep 16, 2026
@pascoec pascoec modified the milestones: Release 1.6.0, Release 1.6.1 Sep 16, 2026
The first-modulus loop charged its bit budget the requested size of each prime
instead of the size actually sampled, so when the primes near a share were
already taken the shortfall went unnoticed and accumulated: at ring dimension
16384 an 89-bit firstModSize produced a 75-bit modulus. The budget now follows
the primes sampled, reaches above a share once primes of that size run out,
releases the scaling primes it overwrites at multiplicative depth 0, and keeps
the product below 2^firstModSize. Parameters that cannot reach firstModSize are
reported instead of silently costing precision at the last level.
@dsuponitskiy
dsuponitskiy force-pushed the 1327-ckks-compositescalingauto-composite-modulus branch from ad820d8 to 3142366 Compare November 11, 2026 13:44

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CKKS COMPOSITESCALINGAUTO can generate a first composite modulus over 5 bits below firstModSize

3 participants