Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test ci #8

Closed
wants to merge 43 commits into from
Closed

Test ci #8

wants to merge 43 commits into from

Conversation

samuelburnham
Copy link
Owner

No description provided.

huitseeker and others added 30 commits February 12, 2024 15:41
* refactor: Streamline matrix multiply & some zip_with instances

- Reworked vector and matrix multiplication operations for improved memory use in `sparse.rs`.
- Modified `batch_eval_prove` function in `snark.rs` for more cleaner assertion checks related to polynomial sizes.
- Enhanced `InnerSumcheckInstance` within `setup` function for parallel computation in `ppsnark.rs`.

* refactor: Streamline transcript absorption in Spartan batched code

- Optimized the transcript insertion process in `batched.rs` by replacing loop-absorbing RelaxedR1CSInstances with a single absorb statement

* refactor: Refactor 'claims_outer' and related functions in BatchedRelaxedR1CSSNARK

- Refactored the structure of `claims_outer` in `BatchedRelaxedR1CSSNARK` from a tuple of vectors to a vector of tuples, streamlining its usage and unpacking.
- Adjusted the `prove` and `verify` functions' code in accordance with the new `claims_outer` implementation.
- Enhanced the extraction and manipulation of `ABCE_evals` in the `verify` function resulting in simpler and more efficient usage.

* fix: simplify inner final claim

* refactor: Optimize Spartan batch evaluation and polynomial computation

- Refined tau polynomial definitions using `PowPolynomial::squares` function to improve efficiency.
- uses in verify the same efficient method as exists in proving.

* fix: streamline usage of PowPolynomial

* refactor: Enhance efficiency of generating power polynomials

- Introduced `#[must_use]` annotation to the `squares` function in `power.rs` to ensure the returned result is handled appropriately.
- avoid re-computing powers of tau over and over in batched_ppsnark

* fix: one forgotten instance of the poly_X refactor

* refactor: slightly simplify padding

* fix: remove misleading comment
* refactor: Refactor test usages for HyperKZG

Put the tests of the same scheme "together"

* refactor: Remove testing boilerplate

- Refactored tests for improved modularity and readability.
- Streamlined testing procedure by calling one function within another.
* test: POlyEvalWitness batch

* test: PolyEvalInstance batch

* chore: C-CALLER-CONTROL

* refactor: shrink batching code

* chore: clippy
* refactor: Refactor public param digest tests in lib.rs

- Refactored test functions within the tests module for greater efficiency and readability.
- Removed `DlogGroup` trait usage within the `test_pp_digest_with` function.
- Simplified `test_pp_digest` function by removing redundant circuit instantiation.

* chore: Upgrade Rust Toolchain Version to 1.76.0

- Upgraded the rust toolchain version from `1.75` to `1.76.0` in `rust-toolchain.toml` file.
- Closes lurk-lang#307

* chore: Refactor pprof dependency

- Shifted `pprof` from `dev-dependencies` to `dependencies` for non-wasm32 targets to optimize benchmarking builds.
- Introduced "flamegraph" feature to include `pprof` during benchmarking.
- Closes lurk-lang#309

* refactor: Refactor computation in sumcheck module

- Streamlined calculation of evaluation points in `compute_eval_points_quad` and `compute_eval_points_cubic_with_additive_term` functions within `src/spartan/sumcheck/mod.rs`.
* feat: Implement RelaxedR1CSSNARK in batched.rs

- Extended `snark` functionality with the addition of `RelaxedR1CSSNARKTrait`.
- Added implementation for `RelaxedR1CSSNARKTrait` in `BatchedRelaxedR1CSSNARK`,
- Leveraged unsafe Rust for creating slices for the `U` and `W` single elements in the new `RelaxedR1CSSNARKTrait` methods.

* feat: Implement batched Spartan tests

- Included testing for the batched workflow across  non-trivial circuits, and "spark" compression.

* feat: Implement new benchmarks for batched compressed SNARKs

- Two new benchmark targets have been added: `bench_compressed_batched_snark` and `bench_compressed_batched_snark_with_computational_commitments`

* fix: use slice::from_ref instead of unsafe
* feat: Initial Shplonk prover/verifier as EvaluationEngine

* feat: More optimal pairing check

* feat: Avoid including C_P to the proof/transcript

* feat: Check R / evals correlation on verification

* feat: Verify correctness of P_i polynomials computing

* chore: Add TODOs about avoiding operations with constant polynomial

* chore: Fix clippy issues

* chore: Review iteration fixes

* feat: Include Shplonk PCS into the benchmark
…ic in the size of IO (lurk-lang#322)

* add generic IO arity parameter

* fix RelaxedR1CS alloc

* fix namespace issue

* update expected pp_digest values

* remove un-needed reference

* `NUM_IO_IN_NOVA` -> `NIO_NOVA_FOLD`

* address review comments
* Revert "feat: Implement batch operations in non_hiding_kzg module (lurk-lang#269)"

This reverts commit db4375f.

* refactor: remove non_hiding_kzg module, split code where dependents need it

- Moved `UniversalParams` and several dependent structures for the KZG10 scheme in the `kzg_commitment.rs` file.
- Deleted the `non_hiding_kzg.rs` file,
- Consolidated KZG related structs under the `kzg_commitment` module,
- Updated `mod.rs` to reflect the removal of the `non_hiding_kzg` module.
…g#330)

- Optimized performance by introducing parallel scans methods across multiple components, focusing on the `rlc<T, F>` method and the `powers` function.
- Switched from `DoubleEndedIteratorExt` to `IndexedParallelIteratorExt` across several files for iterator processing in parallel, and modified corresponding imports accordingly.
- Left `DoubleEndedIteratorExt` as an option, since it's more efficient on small polynomials,
- Added `rayon-scan` to general dependencies
…urk-lang#333)

* chore: Refactor dependencies in Cargo.toml to no longer fork pasta

- Updated dependencies in Cargo.toml by switching `pasta_curves` from a git repository to a specific version
- Amended `grumpkin-msm` dependency git repository link
- Removed the `[patch.crates-io]` section for `pasta_curves` due to the above changes.

* chore: point the grumpkin branch back to dev
* update README; update version (lurk-lang#303)

* Miscellaneous improvements (details in commit messages) (lurk-lang#308)

* move KZG engine to provider module; update paths everywhere

* add a sparse matrix entry only if the coefficient is non-zero; update digests

* move test code to place where it is used

* move asm to default and add a note

* update constants

* update link

* simplify test_pp_digest

* chore: update expect tests

* Improvements to error handling and naming (lurk-lang#309)

* rename and introduce checks about length

* introduce a test about public IO

* chore: remove needless annotation

---------

Co-authored-by: Srinath Setty <[email protected]>
* feat: Avoid redundant operations with constant polynomial

* feat: Avoid redundant clones

* feat: Parallelized verifier

* chore: Requested changes
* refactor: Some combinator patterns

Incorporate more Option/Result patterns

* fix: parallelism post-vecmul

* refactor: Reuse tiny_r1cs

- Refactored the `test_tiny_r1cs_with` function in `src/nifs.rs`,
- Eliminated redundant code by leveraging new `tiny_r1cs` function for creating satisfying instance and witness.
- Increased visibility of `tests` module and `tiny_r1cs` function to crate-level in `src/r1cs/mod.rs` for wider accessibility.

* chore: remove obsolete comment

* refactor: Refactor code using `zip_with!` macro for efficiency

- Refactored the `fold` and `fold_mut` methods in `RelaxedR1CSWitness` and `RelaxedR1CSInstance` classes,
- Updated testing functions in the `nifs.rs` file such as `synthesize_tiny_r1cs_bellpepper`, `execute_sequence`, and `test_tiny_r1cs_with`
- Enhanced readability in `ipa_pc.rs` by replacing the folding method with `zip_with!` macro.
- Incorporated 'zip_with' in 'test_batching_property_on_evaluation' function of 'shplonk.rs' for efficient computation.

* refactor: small if-let to let-else

* chore: mv .cargo/config -> .cargo/config.toml
…g#338)

* chore: Update dependency versions and sources in Cargo.toml

- Updated the version of `bellpepper-core` dependency to `0.4.0`.
- Changed the repository source for `bellpepper` and `neptune` dependencies from `lurk-lab` to `huitseeker`.
- Transitioned `neptune` dependency's branch from "dev" to "switch-bellpepper-dependency".

* point neptune & bellpepper back to lurk-lab@dev
* add a hashchain example (lurk-lang#311)

* add a hashchain example

* update crate version

* fix clippy; fmt

* Fix typo in examples/hashchain.rs

Co-authored-by: tchataigner <[email protected]>

---------

Co-authored-by: Srinath Setty <[email protected]>
Co-authored-by: tchataigner <[email protected]>
…k-lang#343)

- Imported and implemented `PowPolynomial` into `src/spartan/snark.rs`,
- Simplified and optimized `tau` variable generation using `PowPolynomial`, decreasing the transcript use,
- Adjusted `tau` variable generation method in `prove` and `verify` functions

Fixes lurk-lang#155
* refactor: Refactor polynomial evaluation and proof verification in Spartan

- Refactor the `evaluate` function in `MultilinearPolynomial` struct for better clarity and performance.
- Adjust the `prove` function in `ppsnark.rs` to utilize `chis` method when evaluating a multilinear polynomial.
- Modify the `RelaxedR1CSSNARK` struct's prove and verify methods.
- Add more claims regarding the W and E polynomials to the verification process.
- Implement batch evaluation for verifying the W and E polynomials.

* fix: eval_table
* fix: use ff batch inversion

* fix: use batch normalization in HyperKZG
* refactor: a few zip_with applications

* refactor: Replace assertion checks with direct unwraps for error handling

- Replaced assertions throughout multiple functions and tests with directly unwrapping results for better error handling and clarity on failures.
- Applied this change to methods like `prove_step`, `verify`, `test_inner`, and in areas like RecursiveSNARK, CompressedSNARK, and test functions across different scripts.
- Enhanced the error feedback mechanism during benchmarks for RecursiveSNARK, and CompressedSNARK.
- Simplified code further by removing unnecessary checks and variable assignments, and performing inline verification with cleanercode.
- Updated `.cargo/config.toml` with a new project-wide Clippy lint rule for assertion on result states.
…rk-lang#327)

* make `NUM_FE_WITHOUT_IO_FOR_CRHF` dependent on `NIO_NOVA_FOLD` and `BN_N_LIMBS`

* make `limbs_per_group` calculation always return at least 1
* feat: Merge Hyperkzg and Shplonk

* bench: Include HyperKzg+Shplonk PCS to the benchmark

Folks suggest using 'measurement_time' equals to 100s in order to
make measurements more resilient to transitory peak loads caused by
external programs.

bheisler/criterion.rs#322

* chore: Move HyperKZG+Shponk code to hyperkzg.rs source file

* chore: Requested refactoring

* chore: Implement SubAssign trait for UniPoly
* refactor: restrict visibility of nonnative

* refactor: restrict visibility of ECC

* refactor: restrict visibility of gadgets::r1cs

* refactor: restrict visibility of gadgets::utils

* refactor: simple cleanup

* test: check field representations in used libraries

* chore: minor cleanups

* refactor: simplify AllocatedPoint::default

* refactor: simplify AllocatedPointNonInfinity::to_allocated_point
- Function `conditionally_select_vec` is removed and replaced with `conditionally_select_slice` across multiple files for consistency.
- Duplicate functions `conditionally_select` and `conditionally_select_vec` are removed from various modules.
- Unused import, `itertools::Itertools`, removed from `src/gadgets/utils.rs`.
storojs72 and others added 13 commits March 4, 2024 20:48
* feat: Initial experiments with Solidity templating in Rust (IPA)

* feat: Dynamic compatibility uni-test for IPA

* chore: Apply suggestions

* chore: Move solidity-specific unit-test for IPA into separate module
* templating: More accurate representing of CompressedCommitment

* chore: Fix CI failure on docs generating
…rse Matrix functions (lurk-lang#362)

* chore: make unchecked methods private

* update benchmark (lurk-lang#313)

* cleanup unused visibility modifiers (lurk-lang#314)

update doc

* install protoco for lurk-rs

---------

Co-authored-by: Srinath Setty <[email protected]>
* add small util for SuperNova testing

* added another function for secondary

* chore: document added method

---------

Co-authored-by: Wyatt <[email protected]>
Co-authored-by: François Garillot <[email protected]>
* ci: Add Solidity compatibility check

* Fix CI

* Test breaking change comment

* Test breaking change issue

* Prep for review

* Address feedback & clean up

* Address feedback

* Test breaking change issue creation

* Prep for final review
…urk-lang#366)

- Expanded HyperKZG description in README to include Zeromorph and highlight unique support for Supernova.
- Added notification about exclusive availability of Zeromorph implementation in this library, pending integration into official Nova repository.
- Incorporated performance enhancements to the HyperKZG implementation inspired by the BDFG20 (Shplonk) protocol.
Helps with argumentcomputer/ci-workflows#49

- Renamed several environmental variables in various benchmarking scripts and configuration files for consistency.
- Introduced a new section for performing comparative benchmarks based on respective features and architecture.
- Added a new variable to the default benchmark configuration, `BENCH_OUTPUT`, set to `commit-comment`.
- Added `Clone` trait derivation to enhance cloning capabilities within the codebase.
- Improved duplication of `CompressedSNARK` and `NIFS` structures by integrating `Clone` trait.
- Optimized SNARK computations and funcs handling by cloning `CompressedSNARK` structure.

This is motivated by a companion update to Lurk, where the compression mechanism requires returning a uniform type upon calling `.compress()` on a proof that can be recursive or compressed.
…k-lang#372)

- Refactored test functions within the supernova snark module to reduce redundancy.
- Consolidated `test_compression_with` and `test_compression_with_circuit_size_difference_with` functions into a single function.
- Introduced a 'circuit factory' function to generate test circuits.
- Removed `test_nivc_trivial_with_compression_with` method, unified under `test_compression_with`.
- Adjusted individual test cases to conform to new structured changes.
* skeleton

* (wip) scalar <-> base confusion

* (wip) fix W_new def

* (wip) fixed base <-> scalar confusion

* (wip) new gadget scaffolding and allocated witnesses

* (wip) fix prove_step

* (wip) synthesize_non_base_case

* (wip) synthesize

* (wip) synthesize_base_case

* (wip) fix absorbs

* (wip) stuck

* (wip) CommitmentKey macro

* (wip) some gadgets filled

* (wip) some more progress

* (wip) Gadgets done, some cleanup

* (wip) Scalar <-> Base confusion in verify

* it builds!

* make clippy happy

* Delete `RecursiveSNARKTrait` and cleanup

* refactor: Refactor data types and function signatures in Cyclefold module

- Updated and harmonized data type usage in `cyclefold/gadgets.rs`, `cyclefold/circuit.rs`, and `cyclefold/nova_circuit.rs`
- Replaced `AllocatedPoint` with `AllocatedEmulPoint`, `AllocatedRelaxedR1CSInstance` with `AllocatedEmulRelaxedR1CSInstance` to avoid confusion, and simplified required bounds,
- Refactored `cyclefold/gadgets.rs` to remove use of needless bounds,
- no `CurveCycleEquipped` bound was used anywhere in this commit

* refactor: remove uneeded params in PublicParams, RecursiveSNARK

* refactor: Remove option in CycleFoldInputs, remove a few needless types in tests

* test: use expect_test on brittle test

* chore: update expect tests

* (wip) addressing comments

* (wip) add recursive_snark test

* (wip) add generic bounds for allocatedr1csinstances

* make the cyclefold test more **fun**

* fix cyclefold circuit IO

* uncomment num_io cyclefold check

* update constant

* fix link

* cleanup output

* last couple circuit pieces

* add comm_T to inputs and add cyclefold IO checks

* fix ro absorb numbers

* remove extra unneeded comm_T allocation

* properly constrain `always_equal` in `mult_mod` and `red_mod`

* some allocation fixes

* eliminate clone

* make RO absorb numbers make sense

* fix cyclefold scalar alloc

* chore: update Bn256Engine -> Bn256EngineKZG

* chore: run clippy

* update `expect_test`s

* fix EmulatedCurveParam allocation

* fix nifs RO absorb count

* make `test_augmented_circuit_size` an `expect_test`

* fix: typo

* fix: `RecursiveSNARK::new` sets i to 0

* fix: Fix RO absorb count in verify

* fix: `RecursiveSNARK::new` should set r_*_primary to default values

* u <-> U in folding data Alloc

* fix: add trivialization for cyclefold checks in base case

* make prove_verify test more fun

* fix: fix hashing order

* fix: r_bools was always None

* make prove_verify test longer

* clippy

* test_augmented_circuit_size should check synthesis works

* chore: fix rebase

* chore: bump msrv

* chore: cleanup, documentation, and split cyclefold test

* fix: Fix CycleFold circuit IO to only have arity 4
Also fix CycleFold folding soundness issue by absorbing running instance

* chore: update cyclefold_circuit_size expecttest

* fix: fix RO absorb counts and logic

* chore: update cyclefold primary circuit size expecttest

* chore: cleanup and docs

* fix: fix rebase

* chore: fix clippy lints

* fix: constrain `AllocatedEmulPoint::default`

* tidy: use `AllocatedNum::add`

* chore: fix rebase errors in `src/gadgets`

* fix: fix import

* chore: update expecttests

* tidy: add new constant

* tidy: Cyclefold -> CycleFold

---------

Co-authored-by: François Garillot <[email protected]>
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.

7 participants