perf(hex-poly-fast): remove Karatsuba traversal allocation - #9870
Merged
Conversation
Replace per-diagonal index lists with an allocation-free loop and carry an offset through unbalanced block traversal so each block is copied once. Preserve the Raw.ofCoeffs specifications and benchmark both kernels against their former implementations. Cost model: both schoolbook comparators remain quadratic in balanced length n. At fixed 64:1 skew, both blocked comparators perform 64 Karatsuba products, so karatsubaCost n remains the tight model; the offset removes repeated suffix-copy constants.
Owner
Author
|
Fresh Claude Opus second opinion completed while CI was running. Accepted and addressed:
Independently verified: the source/proof chain is sound, Not expanded in this PR: a single mutable output buffer for |
kim-em
enabled auto-merge (squash)
August 31, 2026 06:40
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.
Closes #9744
Summary
List.rangefolds with allocation-free index loops while preserving the raw schoolbook specificationofCoeffs, benchmark both kernels against their former implementations, and synchronize the performance-report registryVerification
lake build HexPolyFast.Karatsuba HexPolyFast.Conformance hexpolyfast_bench hexpolyfast_emit_fixturesconformance-fixtures/HexPolyFast/polyfast.jsonlpython-flintunavailable)lake exe hexpolyfast_bench verifypasses all 57 local targets; the seven FLINT-backed fixed targets fail only becausepython-flintis unavailable locally