-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: improve signed value offset handling when packing scalars (PROO…
…F-905) (#130) # Rationale for this change Blitzar's `packed_msm`, like `fixed_msm`, does not handle signed values. To compute commitments with signed columns we offset signed values by subtracting the minimum of the data type. This requires us to compute the commitments to the minimum value of the data type and add its commitment before pairing. The way we currently handle the offsets is by duplicating the `commitable_columns` and packing in 8 bit `1`s for every column with a value. The problem with this approach is that we compute a lot of duplicate commits. This PR addresses this issue by condensing all the duplicate commits. The bit table now has an 8 bit value added to handle the offset, full commit (all `1`s), and the last commit for each commitable column. # What changes are included in this PR? - Duplicate offsets of all `1`s are eliminated. - Offsets no longer double the size of the `packed_scalars` array. - `par_iter` is removed from the the `bit_table_and_scalars_for_packed_msm` function. Benchmarks showed it was slowing down computation where applied. - `is_signed` is added to the column module. - General refactoring for improving loop efficiency. # Are these changes tested? Yes
- Loading branch information
1 parent
0f965a2
commit a1cab14
Showing
3 changed files
with
851 additions
and
519 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.