Skip to content

Comments

refactor: Integrate zip_with macro (Arecibo backport)#292

Merged
srinathsetty merged 1 commit intomicrosoft:mainfrom
huitseeker:zip_with_macro
Jan 10, 2024
Merged

refactor: Integrate zip_with macro (Arecibo backport)#292
srinathsetty merged 1 commit intomicrosoft:mainfrom
huitseeker:zip_with_macro

Conversation

@huitseeker
Copy link
Contributor

  • Created a new file macros.rs with the implementation of zip_with and zip_with_for_each macros providing syntactic sugar for zipWith patterns.

  • zipWith patterns implemented through the use of the zip_with! macros now resolve to the use of zip_eq, a variant of zip that panics when the iterator arguments are of different length,

  • the zip_eq implementation is the native rayon one for parallel iterators, and the one from itertools (see below) for the sequential ones,

  • Optimized and refactored functions like batch_eval_prove and batch_eval_verify in snark.rs, methods inside PolyEvalWitness and PolyEvalInstance in mod.rs, and multiple functions in multilinear.rs through the use of implemented macros.

  • Introduced the use of itertools::Itertools in various files to import the use of zip_eq on sequential iterators.

  • Made use of the Itertools library for refactoring and optimizing computation in sumcheck.rs and eq.rs files.

This backports (among others) content from the following Arecibo PRS:

This supports the upcoming integration of #283

- Created a new file `macros.rs` with the implementation of `zip_with` and `zip_with_for_each` macros providing syntactic sugar for zipWith patterns.
- zipWith patterns implemented through the use of the zip_with! macros now resolve to the use of zip_eq, a variant of zip that panics when the iterator arguments are of different length,
- the zip_eq implementation is the native rayon one for parallel iterators, and the one from itertools (see below) for the sequential ones,
- Optimized and refactored functions like `batch_eval_prove` and `batch_eval_verify` in `snark.rs`, methods inside `PolyEvalWitness` and `PolyEvalInstance` in `mod.rs`, and multiple functions in `multilinear.rs` through the use of implemented macros.

- Introduced the use of itertools::Itertools in various files to import the use of zip_eq on sequential iterators.
- Made use of the Itertools library for refactoring and optimizing computation in `sumcheck.rs` and `eq.rs` files.

This backports (among others) content from the following Arecibo PRS:
- lurk-lang/arecibo#149
- lurk-lang/arecibo#158
- lurk-lang/arecibo#169

Co-authored-by: porcuquine <porcuquine@users.noreply.github.com>
@srinathsetty srinathsetty merged commit 48887f8 into microsoft:main Jan 10, 2024
huitseeker added a commit to huitseeker/Nova that referenced this pull request Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants