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

Multi-input mv-lookup. #49

Merged
merged 28 commits into from
Nov 13, 2023

Conversation

spherel
Copy link
Member

@spherel spherel commented Jul 4, 2023

These are the papers related to this lookup argument.

akinovak and others added 21 commits July 4, 2023 09:49
Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>
Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>
Co-authored-by: Andrija <akinovak@gmail.com>
Co-authored-by: Andrija <akinovak@gmail.com>
Co-authored-by: therealyingtong <yingtong.lai@gmail.com>
Co-authored-by: Andrija <akinovak@gmail.com>
Co-authored-by: Andrija <akinovak@gmail.com>
Co-authored-by: Andrija <akinovak@gmail.com>
Co-authored-by: Andrija <akinovak@gmail.com>
Author: therealyingtong <yingtong.lai@gmail.com>
@zhenfeizhang zhenfeizhang self-requested a review July 6, 2023 17:21
Copy link

@Velaciela Velaciela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did integration test with scroll-prover on the mvlookup_integration branch, there are some compatibility issues with Scroll‘s proving system.

halo2_proofs/src/plonk/mv_lookup.rs Show resolved Hide resolved
halo2_proofs/src/plonk/mv_lookup.rs Show resolved Hide resolved
Cargo.lock Outdated Show resolved Hide resolved
halo2_proofs/src/plonk/evaluation.rs Outdated Show resolved Hide resolved
halo2_proofs/src/plonk/circuit.rs Outdated Show resolved Hide resolved
@Velaciela
Copy link

Velaciela commented Aug 21, 2023

benchmarking on AWS g5.x12large machine (48 vCore CPU, 192GB RAM)
scroll-prover (v0.5.10) super circuit integration test (test_chunk_prove_verify)

note: the result have included parallel batch invert optimization

[mv-lookup]

Start: phase2
End: phase2 ....................................................................66.325s
Start: phase3
End: phase3 ....................................................................275.776s

phase4 time total 2881.969s <> peak memory: 119GB, for each part:

··Start: coeff_to_extended_part
··End: coeff_to_extended_part ..................................................109.360s
··Start: custom_gates_time
··End: custom_gates_time .......................................................77.608s
··Start: permutations_time
··End: permutations_time .......................................................25.542s
··Start: lookup_time
····Start: inputs_inv_sum_time
····End: inputs_inv_sum_time ...................................................100.766s
····Start: lookups_iter_time (cosetfftpart and constraints calculation)
····End: lookups_iter_time .....................................................41.214s
··End: lookup_time .............................................................**141.981s**

[lookup]

Start: phase2
End: phase2 ....................................................................367.301s
Start: phase3
End: phase3 ....................................................................306.957s

phase4 time total: 2740.878s <> peak memory: 130GB, for each part:

··Start: coeff_to_extended_part
··End: coeff_to_extended_part ..................................................117.650s
··Start: custom_gates_time
··End: custom_gates_time .......................................................77.640s
··Start: permutations_time
··End: permutations_time .......................................................25.552s
··Start: lookup_time (cosetfftpart and constraints calculation)
··End: lookup_time .............................................................**120.937s**

@spherel
Copy link
Member Author

spherel commented Aug 21, 2023

benchmarking on AWS g5.x12large machine (48 vCore CPU, 192GB RAM) scroll-prover (v0.5.10) super circuit integration test (test_chunk_prove_verify)

note: the result have included parallel batch invert optimization

[mv-lookup]

Start: phase2
End: phase2 ....................................................................66.325s
Start: phase3
End: phase3 ....................................................................275.776s

phase4 time total 2881.969s <> peak memory: 119GB, for each part:

··Start: coeff_to_extended_part
··End: coeff_to_extended_part ..................................................109.360s
··Start: custom_gates_time
··End: custom_gates_time .......................................................77.608s
··Start: permutations_time
··End: permutations_time .......................................................25.542s
··Start: lookup_time
····Start: inputs_inv_sum_time
····End: inputs_inv_sum_time ...................................................100.766s
····Start: lookups_iter_time (cosetfftpart and constraints calculation)
····End: lookups_iter_time .....................................................41.214s
··End: lookup_time .............................................................**141.981s**

[lookup]

Start: phase2
End: phase2 ....................................................................367.301s
Start: phase3
End: phase3 ....................................................................306.957s

phase4 time total: 2740.878s <> peak memory: 130GB, for each part:

··Start: coeff_to_extended_part
··End: coeff_to_extended_part ..................................................117.650s
··Start: custom_gates_time
··End: custom_gates_time .......................................................77.640s
··Start: permutations_time
··End: permutations_time .......................................................25.552s
··Start: lookup_time (cosetfftpart and constraints calculation)
··End: lookup_time .............................................................**120.937s**

Phase2 computes lookup.prepare, including preparing the compressed input and table expressions and counting the occurrence of table entries in the input.
Phase3 computes the running product of the permutation argument and the grand sum of the lookup argument.
Phase4 prepares the quotient polynomial for the whole constraint system.

@spherel
Copy link
Member Author

spherel commented Aug 22, 2023

MVLookup
MSM_COUNTER: {1048576: 1054}
FFT_COUNTER: {1048576: 12431, 8388608: 1}

Lookup
MSM_COUNTER: {1048576: 1652}
FFT_COUNTER: {1048576: 17813, 8388608: 1}

@huwenqing0606
Copy link

a brief doc for this PR https://www.overleaf.com/read/vphfbrztgsmp, any comments/corrections would be greatly appreciated!

@kunxian-xia
Copy link

benchmarking on AWS g5.x12large machine (48 vCore CPU, 192GB RAM) scroll-prover (v0.5.10) super circuit integration test (test_chunk_prove_verify)

note: the result have included parallel batch invert optimization

[mv-lookup]

Start: phase2
End: phase2 ....................................................................66.325s
Start: phase3
End: phase3 ....................................................................275.776s

phase4 time total 2881.969s <> peak memory: 119GB, for each part:

··Start: coeff_to_extended_part
··End: coeff_to_extended_part ..................................................109.360s
··Start: custom_gates_time
··End: custom_gates_time .......................................................77.608s
··Start: permutations_time
··End: permutations_time .......................................................25.542s
··Start: lookup_time
····Start: inputs_inv_sum_time
····End: inputs_inv_sum_time ...................................................100.766s
····Start: lookups_iter_time (cosetfftpart and constraints calculation)
····End: lookups_iter_time .....................................................41.214s
··End: lookup_time .............................................................**141.981s**

[lookup]

Start: phase2
End: phase2 ....................................................................367.301s
Start: phase3
End: phase3 ....................................................................306.957s

phase4 time total: 2740.878s <> peak memory: 130GB, for each part:

··Start: coeff_to_extended_part
··End: coeff_to_extended_part ..................................................117.650s
··Start: custom_gates_time
··End: custom_gates_time .......................................................77.640s
··Start: permutations_time
··End: permutations_time .......................................................25.552s
··Start: lookup_time (cosetfftpart and constraints calculation)
··End: lookup_time .............................................................**120.937s**

@Velaciela can you update the benchmark using the latest circuit (v0.9.3)?

@naure
Copy link

naure commented Oct 4, 2023

A summary of what happens for K lookups into the same table:

  • Split K into batches K1, K2, etc, such that each batch respects the max constraint degree.

Then for each batch:

  • Create a multiplicity column m.
  • Create an accumulator.
  • The constraint works on the difference between steps of the accumulator.

No helper columns are needed, but the batch size is limited by max degree.

Here is an optimisation:

  • The first batch K1 works the same as above.
  • But following batches do not need another instance of the entire argument.

Instead, for each following batch:

  • Create a helper column containing inverses: helper = 1 / (denom_0 * denom_1 * …)
  • A constraint verifies the divisions of this batch using the the helper column.
  • The terms are added to the single accumulator. That does not increase its degree. The multiplicities are also added into the single m.

This way the multiplicity m and the accumulator are amortized across all lookups. With for example 4 lookups per helper columns, that's a cost of 0.25 columns per lookup + 1 shared multiplicity.

The accumulator counts as the helper of the first batch here. There is also the option to sacrifice this for simplicity; that is, use the same logic for all batches without the exception for the first batch. In that case, that would be 0.25 per lookup + 2.

(cc @spherel)

halo2_proofs/src/plonk/mv_lookup/prover.rs Outdated Show resolved Hide resolved
halo2_proofs/src/plonk/mv_lookup/prover.rs Show resolved Hide resolved
halo2_proofs/src/plonk/mv_lookup/prover.rs Show resolved Hide resolved
halo2_proofs/src/plonk/mv_lookup/prover.rs Outdated Show resolved Hide resolved
halo2_proofs/src/plonk/mv_lookup/prover.rs Show resolved Hide resolved
Cargo.lock Outdated Show resolved Hide resolved
halo2_proofs/src/plonk/circuit.rs Outdated Show resolved Hide resolved
halo2_proofs/src/plonk/evaluation.rs Outdated Show resolved Hide resolved
halo2_proofs/src/plonk/evaluation.rs Outdated Show resolved Hide resolved
halo2_proofs/src/plonk/evaluation.rs Outdated Show resolved Hide resolved
Comment on lines +111 to +116
let table_index_value_mapping: BTreeMap<C::Scalar, usize> = compressed_table_expression
.iter()
.take(params.n() as usize - blinding_factors - 1)
.enumerate()
.map(|(i, &x)| (x, i))
.collect();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to run more benchmark on this op as constructing BTreeMap over a large table might take a lot of time.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed in #71 (commit d901014).

@kunxian-xia kunxian-xia changed the base branch from develop to develop-rc November 13, 2023 03:17
@kunxian-xia
Copy link

kunxian-xia commented Nov 13, 2023

Note that this pr still has compilation errors. Even though, I will merge this pr into the develop-rc branch first as i don't have access to geometry's repo. Then i will make necessary changes there.
cc @spherel

@kunxian-xia kunxian-xia merged commit 1123789 into scroll-tech:develop-rc Nov 13, 2023
1 of 3 checks passed
kunxian-xia added a commit that referenced this pull request Dec 8, 2023
* Multi-input mv-lookup. (#49)

* Add mv_lookup.rs

* mv_lookup::prover, mv_lookup::verifier

* Replace lookup with mv_lookup

* replace halo2 with mv lookup

Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>

* cleanups

Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>

* ConstraintSystem: setup lookup_tracker

Co-authored-by: Andrija <akinovak@gmail.com>

* mv_lookup::hybrid_prover

Co-authored-by: Andrija <akinovak@gmail.com>

* WIP

* mv_multi_lookup: enable lookup caching

Co-authored-by: therealyingtong <yingtong.lai@gmail.com>

* Rename hybrid_lookup -> lookup

* Chunk lookups using user-provided minimum degree

Co-authored-by: Andrija <akinovak@gmail.com>

* mv_lookup bench

Co-authored-by: Andrija <akinovak@gmail.com>

* Introduce counter feature for FFTs and MSMs

Co-authored-by: Andrija <akinovak@gmail.com>

* Fix off-by-one errors in chunk_lookup

Co-authored-by: Andrija <akinovak@gmail.com>

* bench wip

* time evaluate_h

* KZG

* more efficient batch inversion

* extended lookup example

* Finalize mv lookup

Author: therealyingtong <yingtong.lai@gmail.com>

* Remove main/

* Fix according to the comments

* replace scan with parallel grand sum computation

* Revert Cargo.lock

* mv lookup Argument name

* parallel batch invert

---------

Co-authored-by: Andrija <akinovak@gmail.com>
Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>
Co-authored-by: therealyingtong <yingtong.lai@gmail.com>

* fmt

* fix unit test

* fix clippy errors

* add todo in mv_lookup's prover

* fmt and clippy

* fix clippy

* add detailed running time of steps in logup's prover

* fmt

* add more log hooks

* more running time logs

* use par invert

* use sorted-vector to store how many times a table element occurs in input

* par the process to get inputs_inv_sum

* use par

* fix par

* add feature to skip inv sums

* add new feature flag

* fix clippy error

---------

Co-authored-by: Sphere L <sph6r6.l1u@gmail.com>
Co-authored-by: Andrija <akinovak@gmail.com>
Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>
Co-authored-by: therealyingtong <yingtong.lai@gmail.com>
@AlekseiVambol
Copy link

AlekseiVambol commented Dec 26, 2023

a brief doc for this PR https://www.overleaf.com/read/vphfbrztgsmp, any comments/corrections would be greatly appreciated!

A summary of what happens for K lookups into the same table:

* Split K into batches K1, K2, etc, such that each batch respects the max constraint degree.

Then for each batch:

* Create a multiplicity column m.

* Create an accumulator.

* The constraint works on the difference between steps of the accumulator.

No helper columns are needed, but the batch size is limited by max degree.

Here is an optimisation:

* The first batch K1 works the same as above.

* But following batches do not need another instance of the entire argument.

Instead, for each following batch:

* Create a helper column containing inverses: `helper = 1 / (denom_0 * denom_1 * …)`

* A constraint verifies the divisions of this batch using the the helper column.

* The terms are added to the single accumulator. That does not increase its degree. The multiplicities are also added into the single m.

This way the multiplicity m and the accumulator are amortized across all lookups. With for example 4 lookups per helper columns, that's a cost of 0.25 columns per lookup + 1 shared multiplicity.

The accumulator counts as the helper of the first batch here. There is also the option to sacrifice this for simplicity; that is, use the same logic for all batches without the exception for the first batch. In that case, that would be 0.25 per lookup + 2.

(cc @spherel)

Do I correctly understand that you propose to use one common constraint enforcing
image
where the sum is replaced by the sum of the polynomials A_i(x) found using interpolation, each of which corresponds to a separate batch and is constrained by something like this:
image
where K and f-polynomials a batch-specific?

@AlekseiVambol
Copy link

AlekseiVambol commented Dec 26, 2023

a brief doc for this PR https://www.overleaf.com/read/vphfbrztgsmp, any comments/corrections would be greatly appreciated!

Good idea and nice paper draft! Two things can be done to make it even better:

  1. It would be beneficient for people, who are not too familiar with transformation of the abstract polynomial protocols into the concrete ones by means of the polynomial commitments, to describe the motivation for transforming (4) into (5) by multiplying both sides by the same polynomial. If I am not mistaken, I would propose to describe this in the following way:

"Some identity A(x) = B(x) over some domain, which in an abstract polynomial protocol would be checked by a trusted party, in the case of a concrete protocol based on the polynomial commitment is checked as follows:

  • the prover computes Q(x) = (A(x) - B(x)) / Z(x), where Z(x) is a vanishing polynomial for that domain;
  • the prover shares the commitments to the polynomials, which are the non-public parts of the expressions A(x) and B(x), and the commitment to Q(x);
  • the verifier asks for opennings for all the commitments above at some random point p and checks whether the identity A(p) - B(p) = Q(p) * Z(p) is correct. If the check yields the positive results, than the Schwarz-Zippel lemma tells the verifier that with the overwhelming probability A(x) = B(x) over that domain.
    In order to apply this method, both A(x) and B(x) must be polynomials, and this is achieved by transforming (4) to (5). Actually, we even do not need to compute the coefficients of the right-hand side polynomial in (5), since we are interested only in Q(x), which can be found by means of FFT using only the values of the both sides and Z(x)."
  1. The typo on the page 3 should be fixed: "1" has to be instead of "0" -
    image

kunxian-xia added a commit that referenced this pull request Jan 9, 2024
* Use thread pool for assign_regions (#57)

* feat: use rayon threadpool

* feat: add UT for many subregions

* refact: move common struct out to module level

* refact: reuse common configure code

* fix ci errors

---------

Co-authored-by: kunxian xia <xiakunxian130@gmail.com>

* Move `env_logger` dependency to dev-depdendencies (only for test). (#69)

* sync ff/group 0.13

* fix clippy

* fix clippy

* fmg

* [FEAT] Upgrading table16 for SHA256 (#73)

* upgrade sha256

* fix clippy

* Bus auto (#72)

* bus: expose global offset of regions

* bus-auto: add query_advice and query_fixed function in witness generation

* bus-auto: fix clippy

---------

Co-authored-by: Aurélien Nicolas <info@nau.re>

* fix-tob-scroll-21 (#59)

* fix-tob-scroll-21

* expose param field for re-randomization

* enable accessing for table16 (#75)

* chore: update poseidon link

* merge sha256 gadget changes

* Fix the CI errors (#78)

* cargo fmt

* fix clippy error

* Feat: switch to logup scheme for lookup argument  (#71)

* Multi-input mv-lookup. (#49)

* Add mv_lookup.rs

* mv_lookup::prover, mv_lookup::verifier

* Replace lookup with mv_lookup

* replace halo2 with mv lookup

Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>

* cleanups

Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>

* ConstraintSystem: setup lookup_tracker

Co-authored-by: Andrija <akinovak@gmail.com>

* mv_lookup::hybrid_prover

Co-authored-by: Andrija <akinovak@gmail.com>

* WIP

* mv_multi_lookup: enable lookup caching

Co-authored-by: therealyingtong <yingtong.lai@gmail.com>

* Rename hybrid_lookup -> lookup

* Chunk lookups using user-provided minimum degree

Co-authored-by: Andrija <akinovak@gmail.com>

* mv_lookup bench

Co-authored-by: Andrija <akinovak@gmail.com>

* Introduce counter feature for FFTs and MSMs

Co-authored-by: Andrija <akinovak@gmail.com>

* Fix off-by-one errors in chunk_lookup

Co-authored-by: Andrija <akinovak@gmail.com>

* bench wip

* time evaluate_h

* KZG

* more efficient batch inversion

* extended lookup example

* Finalize mv lookup

Author: therealyingtong <yingtong.lai@gmail.com>

* Remove main/

* Fix according to the comments

* replace scan with parallel grand sum computation

* Revert Cargo.lock

* mv lookup Argument name

* parallel batch invert

---------

Co-authored-by: Andrija <akinovak@gmail.com>
Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>
Co-authored-by: therealyingtong <yingtong.lai@gmail.com>

* fmt

* fix unit test

* fix clippy errors

* add todo in mv_lookup's prover

* fmt and clippy

* fix clippy

* add detailed running time of steps in logup's prover

* fmt

* add more log hooks

* more running time logs

* use par invert

* use sorted-vector to store how many times a table element occurs in input

* par the process to get inputs_inv_sum

* use par

* fix par

* add feature to skip inv sums

* add new feature flag

* fix clippy error

---------

Co-authored-by: Sphere L <sph6r6.l1u@gmail.com>
Co-authored-by: Andrija <akinovak@gmail.com>
Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>
Co-authored-by: therealyingtong <yingtong.lai@gmail.com>

* fix some simple building errs

* upgrade pathfinder_simd to newer version as it can't compile on mac m1 pro

* resolve merge conflict

* fmt

* clippy

* more clippy fix

* more lint fix

* fmt

* minor syntax fix

* fix ipa multiopen test failure

* fix clippy warning

* fmt

* fix par scan of log_inv diff

* remove uncessary clone

---------

Co-authored-by: alannotnerd <alan1995wang@outlook.com>
Co-authored-by: kunxian xia <xiakunxian130@gmail.com>
Co-authored-by: Steven <asongala@163.com>
Co-authored-by: Carlos Pérez <37264926+CPerezz@users.noreply.github.com>
Co-authored-by: zhenfei <zhenfei.zhang@hotmail.com>
Co-authored-by: Ho <noel.wei@gmail.com>
Co-authored-by: naure <naure@users.noreply.github.com>
Co-authored-by: Aurélien Nicolas <info@nau.re>
Co-authored-by: Sphere L <sph6r6.l1u@gmail.com>
Co-authored-by: Andrija <akinovak@gmail.com>
Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>
Co-authored-by: therealyingtong <yingtong.lai@gmail.com>
kunxian-xia added a commit that referenced this pull request Jan 12, 2024
* feat: call synthesize in `MockProver` multiple times to behave same as real prover

* modify previous commit

* Expose mod `permutation` and re-export `permutation::keygen::Assembly` (privacy-scaling-explorations#149)

* feat: expose mod ule `permutation` and re-export `permutation::keygen::Assembly`

* feat: derive `lone` for `permutation::keygen::Assembly`

* feat: bump MSRV for `inferno`

* change: Migrate workspace to pasta_curves-0.5 (privacy-scaling-explorations#157)

* change: Migrate workspace to pasta_curves-0.5

This ports the majority of the workspace to the `pasta_curves-0.5.0`
leaving some tricky edge-cases that we need to handle carefully.

Resolves: privacy-scaling-explorations#132

* fix: Complete latest trait bounds to compile halo2proofs

* change: Migrate examples & benches to pasta 0.5

* change: Migrate halo2_gadgets to pasta-0.5

* change: Update gadgets outdated code with latest upstream

* fix: Sha3 gadget circuit

* fix: doc tests

* chore: Update merged main

* fix: Apply review suggestions

* fix previous commit

* Extend Circuit trait to take parameters in config (privacy-scaling-explorations#168)

* Extend Circuit trait to take parameters in config

The Circuit trait is extended with the following:
```
pub trait Circuit<F: Field> {
    /// [...]
    type Params: Default;

    fn params(&self) -> Self::Params {
        Self::Params::default()
    }

    fn configure_with_params(meta: &mut ConstraintSystem<F>, params: &Self::Params) -> Self::Config {
        Self::configure(meta)
    }

    fn configure(meta: &mut ConstraintSystem<F>) -> Self::Config;
}
```

This allows runtime parametrization of the circuit configuration.  The extension to the Circuit trait has been designed to minimize the breaking change: existing circuits only need to define the associated `type Params`.

Unfortunately "Associated type defaults" are unstable in Rust, otherwise this would be a non-breaking change.  See rust-lang/rust#29661

* Implement circuit params under feature flag

* Don't overwrite configure method

* Fix doc test

* Allow halo2 constraint names to have non static names (privacy-scaling-explorations#156)

* static ref to String type in Gates, Constraints, VirtualCell, Argument

* 'lookup'.to_string()

* return &str for gate name and constriant_name, also run fmt

* Update halo2_gadgets/Cargo.toml

Co-authored-by: Han <tinghan0110@gmail.com>

* upgrade rust-toochain

---------

Co-authored-by: Carlos Pérez <37264926+CPerezz@users.noreply.github.com>
Co-authored-by: Han <tinghan0110@gmail.com>

* Improve halo2 query calls (privacy-scaling-explorations#154)

* return expression from cell

* add example

* selector

* recurse Expression to fill in index

* minimized changes from the original

* backword compatible meta.query_X & challange.expr()

* cargo fmt

* fixed lookup to pass all tests

* Update comments

Co-authored-by: Brecht Devos <Brechtp.Devos@gmail.com>

* Update comments

Co-authored-by: Brecht Devos <Brechtp.Devos@gmail.com>

* Update comments

Co-authored-by: Brecht Devos <Brechtp.Devos@gmail.com>

* Update comments

Co-authored-by: Brecht Devos <Brechtp.Devos@gmail.com>

* Update comments

Co-authored-by: Brecht Devos <Brechtp.Devos@gmail.com>

* Update comments

Co-authored-by: Brecht Devos <Brechtp.Devos@gmail.com>

* update

Co-authored-by: Brecht Devos <Brechtp.Devos@gmail.com>

* add primitives.rs back

* remove example2

* backward compatible meta.query_X & Column.cur(), next(), prev(), at(usize)

* impl Debug & make side effects only when query.index.is_none()

* change impl Debug for Expression instead & revert test in plonk_api

* upgrade rust-toolchain

* Update halo2_proofs/src/plonk/circuit.rs

Co-authored-by: Han <tinghan0110@gmail.com>

* Update halo2_proofs/src/plonk/circuit.rs

Co-authored-by: Han <tinghan0110@gmail.com>

* ran clippy

* Update halo2_proofs/src/plonk/circuit.rs

Co-authored-by: Han <tinghan0110@gmail.com>

---------

Co-authored-by: Brecht Devos <Brechtp.Devos@gmail.com>
Co-authored-by: Han <tinghan0110@gmail.com>

* Implement Clone trait for Hash, Absorbing, and Sponge structs (privacy-scaling-explorations#171)

* fix: Fix serialization for VerifyingKey (privacy-scaling-explorations#178)

Now the value returned when the number of selectors is a multiple of 8
is correct.

Resolves: privacy-scaling-explorations#175

* Add more getters to expose internal fields

* add a constructor (privacy-scaling-explorations#164)

* add a constructor

* add more comment

* fix as review

* remove clone

* remove

* no need to use new variable

* change comment

* fix clippy

* rename to from_parts

* remove n declaration

* feat: send sync region (privacy-scaling-explorations#180)

* feat: send / sync region

* Update layout.rs

* update

* lol

* debug

* Update keygen.rs

* Update keygen.rs

* Update keygen.rs

* Update keygen.rs

* thread-safe-region feature flag

* cleanup

* patch dev-graph

* patch non-determinism in mapping creation

* reduce mem usage for vk and pk

* mock proving examples

* swap for hashmap for insertion speed

* reduce update overhead

* replace BTree with Vec

* add benchmarks

* make the benchmarks massive

* patch clippy

* simplify lifetimes

* patch benches

* Update halo2_proofs/src/plonk/permutation/keygen.rs

Co-authored-by: Han <tinghan0110@gmail.com>

* Update halo2_proofs/examples/vector-mul.rs

Co-authored-by: Han <tinghan0110@gmail.com>

* rm benches

* order once

* patch lints

---------

Co-authored-by: Han <tinghan0110@gmail.com>

* fix previous commit

* Fix `parallelize` workload imbalance (privacy-scaling-explorations#186)

* fix parallelize workload imbalance

* remove the need of unsafe

* Updates halo2_curves dependency to released package (privacy-scaling-explorations#190)

THe package release ressets the version from those inherited by the legacy
halo2curves repo's fork history.

The upstream diff is:
https://github.com/privacy-scaling-explorations/halo2curves/compare/9f5c50810bbefe779ee5cf1d852b2fe85dc35d5e..9a7f726fa74c8765bc7cdab11519cf285d169ecf

* fix: explicitly define mds diff type (privacy-scaling-explorations#196)

* fix: explicitly define mds diff type

* rm paren

* feat: expose `transcript_repr` of `VerifyingKey` and reduce the trait constraint (privacy-scaling-explorations#200)

* implement native shuffle argument and api

fix: remove nonsense comment

strictly check shuffle rows

address doc typos

move compression into product commitment

typo

add shuffle errors for `verify_at_rows_par`

dedup expression evaluation

cargo fmt

fix fields in sanity-checks feature

* feat: public cells to allow for implementations of custom `Layouter`  (privacy-scaling-explorations#192)

* feat: public cells

* Update mds.rs

* Update mds.rs

* Update single_pass.rs

Co-authored-by: Han <tinghan0110@gmail.com>

* bump toolchain to resolve errors

* fix clippy errors for CI run

* rustfmt post clippy

* plz let it be the last lint

* patch clippy lints in gadgets

* clippy lints for sha256 bench

* patch halo2proof benches

* Update assigned.rs

* Update halo2_gadgets/src/poseidon/primitives/mds.rs

Co-authored-by: Han <tinghan0110@gmail.com>

* Update halo2_gadgets/src/poseidon/primitives/mds.rs

Co-authored-by: Han <tinghan0110@gmail.com>

---------

Co-authored-by: Han <tinghan0110@gmail.com>

* Synchronize with upstream (privacy-scaling-explorations#199)

* refactor: add default impl for `SyncDeps` for backward compatability

* feat: pick changes from zcash#728 and changes of flag `test-dev-graph`

* feat: pick changes from zcash#622

* feat: pick changes about mod `circuit` and mod `dev`

* feat: pick rest changes of `halo2_proofs`

* fix: when `--no-default-features`

* ci: sync from upstream, and deduplicate jobs when
push to `main`, and remove always failing job `codecov`.

* fix: make `commit_zk` runnable when `--no-default-features`

* chore: Update rust-toolchain to 1.66 for testing  (privacy-scaling-explorations#208)

* chore: Update rust-toolchain to 1.66 for testing

Note that tests will not compile due to the silent MSRV bump in
`blake2b_simd`.

Hence, we need to use `1.66` as toolchain.

Resolves: privacy-scaling-explorations#207

* change: UIpdate MSRVs in Cargo.toml

* fix: clippy (privacy-scaling-explorations#203)

* fix: clippy

* fmt

* fix: Final clippy complains & adjustments

---------

Co-authored-by: CPerezz <c.perezbaro@gmail.com>

* Implement Sum and Product for Expression (privacy-scaling-explorations#209)

* Make it Eq to make it easier for tests

* Implement Sum and Product for Expression

* Make it readable

* chore: update poseidon dependency

* fix: compiling bug with feautes=parallel_syn

* feat(MockProver): replace errors by asserts(privacy-scaling-explorations#150)

* boundary offset lost when resolving conflict

* disable multiphase prover

* Sync halo2 lib 0.4.0 merging (#81)

* Use thread pool for assign_regions (#57)

* feat: use rayon threadpool

* feat: add UT for many subregions

* refact: move common struct out to module level

* refact: reuse common configure code

* fix ci errors

---------

Co-authored-by: kunxian xia <xiakunxian130@gmail.com>

* Move `env_logger` dependency to dev-depdendencies (only for test). (#69)

* sync ff/group 0.13

* fix clippy

* fix clippy

* fmg

* [FEAT] Upgrading table16 for SHA256 (#73)

* upgrade sha256

* fix clippy

* Bus auto (#72)

* bus: expose global offset of regions

* bus-auto: add query_advice and query_fixed function in witness generation

* bus-auto: fix clippy

---------

Co-authored-by: Aurélien Nicolas <info@nau.re>

* fix-tob-scroll-21 (#59)

* fix-tob-scroll-21

* expose param field for re-randomization

* enable accessing for table16 (#75)

* chore: update poseidon link

* merge sha256 gadget changes

* Fix the CI errors (#78)

* cargo fmt

* fix clippy error

* Feat: switch to logup scheme for lookup argument  (#71)

* Multi-input mv-lookup. (#49)

* Add mv_lookup.rs

* mv_lookup::prover, mv_lookup::verifier

* Replace lookup with mv_lookup

* replace halo2 with mv lookup

Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>

* cleanups

Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>

* ConstraintSystem: setup lookup_tracker

Co-authored-by: Andrija <akinovak@gmail.com>

* mv_lookup::hybrid_prover

Co-authored-by: Andrija <akinovak@gmail.com>

* WIP

* mv_multi_lookup: enable lookup caching

Co-authored-by: therealyingtong <yingtong.lai@gmail.com>

* Rename hybrid_lookup -> lookup

* Chunk lookups using user-provided minimum degree

Co-authored-by: Andrija <akinovak@gmail.com>

* mv_lookup bench

Co-authored-by: Andrija <akinovak@gmail.com>

* Introduce counter feature for FFTs and MSMs

Co-authored-by: Andrija <akinovak@gmail.com>

* Fix off-by-one errors in chunk_lookup

Co-authored-by: Andrija <akinovak@gmail.com>

* bench wip

* time evaluate_h

* KZG

* more efficient batch inversion

* extended lookup example

* Finalize mv lookup

Author: therealyingtong <yingtong.lai@gmail.com>

* Remove main/

* Fix according to the comments

* replace scan with parallel grand sum computation

* Revert Cargo.lock

* mv lookup Argument name

* parallel batch invert

---------

Co-authored-by: Andrija <akinovak@gmail.com>
Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>
Co-authored-by: therealyingtong <yingtong.lai@gmail.com>

* fmt

* fix unit test

* fix clippy errors

* add todo in mv_lookup's prover

* fmt and clippy

* fix clippy

* add detailed running time of steps in logup's prover

* fmt

* add more log hooks

* more running time logs

* use par invert

* use sorted-vector to store how many times a table element occurs in input

* par the process to get inputs_inv_sum

* use par

* fix par

* add feature to skip inv sums

* add new feature flag

* fix clippy error

---------

Co-authored-by: Sphere L <sph6r6.l1u@gmail.com>
Co-authored-by: Andrija <akinovak@gmail.com>
Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>
Co-authored-by: therealyingtong <yingtong.lai@gmail.com>

* fix some simple building errs

* upgrade pathfinder_simd to newer version as it can't compile on mac m1 pro

* resolve merge conflict

* fmt

* clippy

* more clippy fix

* more lint fix

* fmt

* minor syntax fix

* fix ipa multiopen test failure

* fix clippy warning

* fmt

* fix par scan of log_inv diff

* remove uncessary clone

---------

Co-authored-by: alannotnerd <alan1995wang@outlook.com>
Co-authored-by: kunxian xia <xiakunxian130@gmail.com>
Co-authored-by: Steven <asongala@163.com>
Co-authored-by: Carlos Pérez <37264926+CPerezz@users.noreply.github.com>
Co-authored-by: zhenfei <zhenfei.zhang@hotmail.com>
Co-authored-by: Ho <noel.wei@gmail.com>
Co-authored-by: naure <naure@users.noreply.github.com>
Co-authored-by: Aurélien Nicolas <info@nau.re>
Co-authored-by: Sphere L <sph6r6.l1u@gmail.com>
Co-authored-by: Andrija <akinovak@gmail.com>
Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>
Co-authored-by: therealyingtong <yingtong.lai@gmail.com>

---------

Co-authored-by: han0110 <tinghan0110@gmail.com>
Co-authored-by: Velaciela <git.rover@outlook.com>
Co-authored-by: Carlos Pérez <37264926+CPerezz@users.noreply.github.com>
Co-authored-by: Eduard S <eduardsanou@posteo.net>
Co-authored-by: CeciliaZ030 <45245961+CeciliaZ030@users.noreply.github.com>
Co-authored-by: Brecht Devos <Brechtp.Devos@gmail.com>
Co-authored-by: Enrico Bottazzi <85900164+enricobottazzi@users.noreply.github.com>
Co-authored-by: Ethan-000 <s2026080@ed.ac.uk>
Co-authored-by: dante <45801863+alexander-camuto@users.noreply.github.com>
Co-authored-by: Mamy Ratsimbazafy <mamy_github@numforge.co>
Co-authored-by: François Garillot <4142+huitseeker@users.noreply.github.com>
Co-authored-by: kilic <onurkilic1004@gmail.com>
Co-authored-by: Thor <7041313+thor314@users.noreply.github.com>
Co-authored-by: CPerezz <c.perezbaro@gmail.com>
Co-authored-by: chokermaxx <135603985+chokermaxx@users.noreply.github.com>
Co-authored-by: Zhang Zhuo <mycinbrin@gmail.com>
Co-authored-by: alannotnerd <alan1995wang@outlook.com>
Co-authored-by: kunxian xia <xiakunxian130@gmail.com>
Co-authored-by: Steven <asongala@163.com>
Co-authored-by: Ho <noel.wei@gmail.com>
Co-authored-by: naure <naure@users.noreply.github.com>
Co-authored-by: Aurélien Nicolas <info@nau.re>
Co-authored-by: Sphere L <sph6r6.l1u@gmail.com>
Co-authored-by: Andrija <akinovak@gmail.com>
Co-authored-by: ying tong <therealyingtong@users.noreply.github.com>
Co-authored-by: therealyingtong <yingtong.lai@gmail.com>
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.

8 participants