Repository navigation
Reduce factorization overhead and allow larger composition blocks - #188
Merged
Merged
Conversation
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.
This change removes redundant factorization setup and overlapping cache lifetimes, and allows callers to select larger composition blocks for workloads with sufficient reuse.
• Emit degree groups containing one irreducible factor directly, preserving validation, callback control and RNG behavior.
• Release the initial Frobenius cache after completing the baby-step table, before constructing the giant-step cache.
• Add modular_composition_block_size, with bounded explicit sizes and the existing automatic heuristic as the default.
Baseline and cache-release runs perform complete factor discovery and norm recovery for a degree-14,938 polynomial over BN254 Fp12, verifying
P²-XQ²=H, degree bounds, identical P/Q bytes and identical RNG consumption.Clean x86 measurements show:
• Cache release reduces degree-14,938 factor discovery and norm recovery peak RSS from 8.37 to 5.70 GiB, with essentially unchanged recovery time.
• Width 246 versus 123 reduces heavily reused composition workloads by 33–34%, including cache construction.
• Larger blocks increase component RSS from 2.92 to 5.57 GiB and make single-use composition about 46% slower, so they remain opt-in.