Commit Graph

148 Commits

Author SHA1 Message Date
Jack Grigg 1d9790b2ce Migrate to published `ff 0.13` 2022-12-06 04:55:21 +00:00
Jack Grigg cb819e47e9 Migrate to `ff` revision without `FieldExt` 2022-11-30 19:35:26 +00:00
therealyingtong 966b5fc3b7 halo2_proofs/CHANGELOG: Document structs which now derive Eq 2022-11-30 15:13:55 +00:00
Daira Hopwood 23f63a8f50 Fix nightly clippy complaints.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-11-30 15:13:55 +00:00
Daira Hopwood c387aa7204 Fix additional beta clippy complaints.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-11-30 15:13:55 +00:00
Kris Nuttycombe b3f7db16f8 Fix beta clippy complaints. 2022-11-30 14:57:15 +00:00
str4d 455ee88b96
Merge pull request #687 from naure/optim/linear-multiopen
Optimize multiopen verifier for many columns
2022-11-30 07:25:56 +00:00
Jack Grigg 3e6df2b1de halo2_proofs: Replace `pasta_curves::arithmetic::Group` with new blanket trait 2022-11-30 03:41:45 +00:00
Jack Grigg 49b2324f0a Replace unnecessary dependencies on `FieldExt` trait 2022-11-30 03:41:19 +00:00
Daira Hopwood b097f098ae
Merge pull request #685 from zcash/zero-area-region
[MockProver] failure::FailureLocation: Handle zero-area regions.
2022-11-29 19:26:12 +00:00
Jack Grigg 41860fa605 halo2_proofs: Fix `CircuitLayout` example 2022-11-24 02:30:46 +00:00
Jack Grigg 93af730c6c Simplify `EvaluationDomain` to only accept field elements
We do not use `EvaluationDomain` with group elements, so there is no
need to directly use the FFT `Group` abstraction trait here.
2022-11-24 01:59:08 +00:00
Aurélien Nicolas f99799f69d optim/linear-multiopen: remove tmp benchmark code 2022-10-27 16:27:24 +02:00
Aurélien Nicolas 6986d0ceef optim/linear-multiopen: remove Horner's rule on MSM 2022-10-26 12:10:47 +02:00
Aurélien Nicolas 54f1e34d21 optim/linear-multiopen: measure 2022-10-26 11:45:38 +02:00
therealyingtong 41c28ae6b2 failure::FailureLocation: Handle zero-area regions. 2022-10-20 17:44:24 -07:00
Daira Hopwood ccfe3e8ccd
Merge pull request #671 from zcash/refactor-lookup
`lookup::prover`: Compress expressions and cosets in `commit_permuted`
2022-10-08 13:29:44 +01:00
Daira Hopwood def465de33
Merge pull request #658 from nalinbhardwaj/add-row-count
[MockProver] Add row and col count to cost model
2022-10-08 12:25:20 +01:00
therealyingtong c443665224 lookup::prover: Compress expressions and cosets in commit_permuted
The theta challenge is used in the lookup argument to compress the
input and table expressions. This can be done fully in the
commit_permuted step, after which the original uncompressed
expressions are no longer needed.

Author: Ying Tong Lai <yingtong@z.cash>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-10-08 12:07:54 +01:00
Daira Hopwood 6c1f78d39e clippy fixes and cargo fmt.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-10-08 11:52:25 +01:00
Daira Hopwood 0f7299c116
Merge pull request #625 from zcash/region-query-instance
halo2_proofs: Introduce `RegionLayouter::instance_value` method.
2022-10-08 11:18:46 +01:00
Daira Hopwood de76fd48fc
Merge pull request #622 from zcash/patch-mockprover-query_instance
[MockProver] Check for instance values in gate queries.
2022-10-08 11:15:06 +01:00
Daira Hopwood 21a79182ed
Merge pull request #667 from Orbis-Tertius/fix-plonk-test
Don't use `include_bytes!` for `plonk_api` test
2022-10-07 15:14:38 +01:00
ying tong 4d970865cb
[doc] commitment::verifier: verify_proof does not have [-c]G term 2022-10-05 17:57:48 -07:00
Daira Hopwood 6f692c0e53 There is no z' in the lookup argument, only z.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-09-26 20:14:08 +08:00
Las Safin bc10548907
`cargo fmt` 2022-09-23 13:16:49 +00:00
Las Safin 6b3da1fb4b
Don't use `include_bytes!` for `plonk_api` test
The current working directory for a test always seems to be
the root of the crate, hence `./tests/plonk_api_proof.bin` is
always the correct path.
2022-09-23 11:25:37 +00:00
Nalin Bhardwaj fad6201b34 Merge layouter used by cost and graph into one 2022-09-16 16:27:51 +05:30
Nalin Bhardwaj 55d470ffd2 Add row and col count to cost model 2022-09-16 16:27:22 +05:30
ebfull 61a1f63fcb
Merge pull request #623 from zcash/table-col-equality
Allow `enable_equality` on `TableColumn`
2022-09-13 08:03:20 -06:00
ebfull 2bdb369393
Merge pull request #654 from zcash/bug-instances-len
`plonk::prover::create_proof`: Check that `circuits` and `instances` have equal lengths
2022-09-13 08:02:26 -06:00
therealyingtong 76c658b321 [MockProver] Check for instance values in gate queries. 2022-09-13 18:25:21 +08:00
therealyingtong 7ed2a4d529 plonk::prover::create_proof: Return error if circuits and instances have different lengths. 2022-09-13 18:19:45 +08:00
therealyingtong d0bbcda590 plonk::prover: Test proof creation with wrong number of instances.
Currently, create_proof passes even if the number of circuits does
not equal the number of instances.
2022-09-13 18:19:45 +08:00
Jack Grigg ffc8e24fb2 Reduce feature surface of `plotters`
`plotters 0.3.3` updated from `font-kit 0.10.0` to `0.11.0`. This is an
internal dependency and ostensibly wouldn't be a breaking change, except
that `font-kit 0.11.0` added a dependency on `yeslogic-fontconfig-sys`
which has additional system dependency requirements. This had the effect
of breaking compilation in a non-breaking release.

However, `font-kit` is only required for `BitMapBackend`, which is not
part of our public API and is only used by some of the `halo2_gadgets`
tests. So we can avoid affecting our downstream users by disabling the
default-enabled features of `plotters`.
2022-09-12 18:31:04 +00:00
Jack Grigg 7e353115fc halo2_proofs: Remove unused imports 2022-09-12 18:07:18 +00:00
str4d 5d653e5d4e
Merge pull request #649 from zcash/cleanups
Various cleanups
2022-09-12 18:44:45 +01:00
str4d e8cb2e6470
halo2_proofs: Use qualified form of `rustdoc::broken_intra_doc_links`
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-09-12 16:43:00 +01:00
Jack Grigg a2c542f70b halo2_proofs: Remove unused clippy lint overrides 2022-09-09 18:20:24 +00:00
Jack Grigg 301bcb3e2d halo2_proofs: Narrow `clippy::upper_case_acronyms` lint override 2022-09-09 18:20:10 +00:00
Jack Grigg 349908d539 halo2_proofs: Narrow `clippy::too_many_arguments` lint override
This enables the lint to show up on new PRs.
2022-09-09 18:15:10 +00:00
Jack Grigg 3cbfd54f77 halo2_proofs: Fix `clippy::assign_op_pattern` lints
The pattern is preserved in one location inside the inner product
argument, where we instead desire to avoid allocations by collapsing
p_prime into itself. Using `+=` here requires both mutable and immutable
borrows simultaneously, and assigning temporaries to avoid this makes
the implementation less clear.
2022-09-09 18:08:40 +00:00
Jack Grigg e65974eb2d halo2_proofs: Remove lint overrides now that MSRV is above 1.51 2022-09-09 17:45:00 +00:00
Jack Grigg f852be62a8 halo2_proofs: Remove unused imports 2022-09-09 17:43:43 +00:00
Jack Grigg 60696a7cfa halo2_proofs: Proxy all `rayon` usage through `halo2_proofs::multicore`
Part of zcash/halo2#648.
2022-09-09 17:36:05 +00:00
Jack Grigg d24f0fd582 halo2_proofs: Add tests for "rotate-and-chunk" APIs 2022-08-25 01:30:23 +00:00
Jack Grigg 5b7b4dd76b Silence clippy lint 2022-08-25 01:07:38 +00:00
Jack Grigg 1d8737e7ab halo2_proofs: Avoid caching rotated polynomials in `poly::Evaluator`
Previously we used the existing `Polynomial::rotate` and
`EvaluationDomain::rotate_extended` APIs to rotate the polynomials we
query at non-zero rotations, and then stored references to the chunks of
each (rotated and unrotated) polynomial as slices. When we reached an
`AstLeaf`, we would then clone the corresponding polynomial chunk.

We now avoid all of this with combined "rotate-and-chunk" APIs, making
use of the observation that a rotation is simply a renumbering of the
indices of the polynomial coefficients. Given that when we reach an
`AstLeaf` we already needed to allocate, these new APIs have the same
number of allocations during AST evaluation, but enable us to completely
avoid caching any information about the rotations or rotated polynomials
ahead of time.
2022-08-25 00:48:51 +00:00
Jack Grigg df61767e02 halo2_proofs: Reduce memory usage of `poly::Evaluator`
`poly::Evaluator` stores all of the polynomials registered with it in
memory for the duration of its existence. When evaluating an AST, it
additionally caches the rotated polynomials in memory, and then chunks
all of the rotated polynomials for parallel evaluation.

Previously, it stored a polynomial for every unique AST leaf, regardless
of whether that leaf required a rotation or not. This resulted in the
unrotated polynomials being stored twice in memory. However, the chunks
simply refer to slices over cached polynomials, so we can reference the
unrotated polynomials stored in `poly::Evaluator` instead of copies of
them stored in the rotated polynomial `HashMap`. This strictly reduces
memory usage during proving with no effect on correctness.
2022-08-23 18:25:39 +00:00
han0110 8ff5b1e3af feat: make `Expression::{Fixed,Advice,Instance}` to wrap their own `Query` struct 2022-07-15 10:33:47 -04:00