Commit Graph

300 Commits

Author SHA1 Message Date
Sean Bowe 28439414f4
(attempt 1 at implementing daira's algorithm) 2021-07-23 08:14:15 -06:00
Sean Bowe 5af7a7abfa
Only accept fixed columns in lookup argument tables. 2021-07-22 10:28:52 -06:00
Sean Bowe 145d096dcd
Distinguish between simple and non-simple selectors, and allow the former in lookup arguments. 2021-07-22 10:07:20 -06:00
Sean Bowe 26982a6050
Update circuit graph tooling to account for selector optimization. 2021-07-22 10:06:48 -06:00
Sean Bowe 1254e4f245
Ensure that selectors are only used in simple ways.
You cannot add an expression containing a Selector to another expression.

You cannot multiply an expression containing a Selector by another expression
that also has a selector.
2021-07-21 14:43:31 -06:00
Sean Bowe 2cc60838a5
Use locally generated ConstraintSystem to avoid performing optimizations twice. 2021-07-21 13:34:56 -06:00
Sean Bowe 23d7d6532d
Properly substitute selectors in lookup expressions during optimization pass. 2021-07-21 13:12:05 -06:00
Sean Bowe 382cd5a7ea
Create actual selector columns only during an optimization pass. 2021-07-21 12:55:19 -06:00
str4d a2fb36b6ee
Merge pull request #344 from zcash/325-column-ordering
Change canonical column ordering to Instance < Advice < Fixed
2021-07-21 16:44:50 +01:00
Jack Grigg ed2295b077 Add trait methods and general APIs for defining circuit constants
During circuit configuration, fixed columns can be marked as suitable
for containing arbitrary constant values (i.e. the columns aren't
encumbered by constraints that preclude arbitrary values).

During synthesis, circuits can now request that the layouter assign
an advice cell within a region, to some specified constant value. It
is the layouter's responsibility to find space within the previously
marked fixed columns, in which to assign the constant.

This commit intentionally does not compile.
2021-07-21 09:31:27 +08:00
str4d c99347be4a
Minor style tweak to Column Ord impl
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-07-20 21:43:24 +01:00
Jack Grigg 4417b4e480 Change canonical column ordering to Instance < Advice < Fixed
Closes zcash/halo2#325.
2021-07-20 20:24:37 +01:00
str4d c0d2aa1286
Merge branch 'main' into coset-optimization 2021-07-19 14:43:37 +01:00
Sean Bowe b0a4a19093
Rename CommonCommitted to CommonEvaluated. 2021-07-15 15:22:51 -06:00
Sean Bowe 3cae0d5f19
Merge the common pieces of the permutation argument into a separate proof component. 2021-07-15 14:30:52 -06:00
Sean Bowe 070beafa53
Address minor review comments. 2021-07-14 15:19:26 -06:00
Sean Bowe 0a3ae6f1eb
Add clarifying comment.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-07-14 10:17:44 -06:00
Sean Bowe bbe06ac61e
Add clarifying comment.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-07-14 10:08:49 -06:00
Sean Bowe af01af8fa5
Remove unnecessary collect. 2021-07-14 10:07:30 -06:00
Sean Bowe 11a1fc7d4a
Fix stale comment 2021-07-14 09:48:56 -06:00
Sean Bowe 99a0e675f1
Minor changes to comments. 2021-07-14 09:46:29 -06:00
Sean Bowe 74f3e1c6d9
Fix omitted notation to explicitly designate l_last and l_blind as polynomials. 2021-07-13 16:30:52 -06:00
Sean Bowe 4cd0bffc8e
Collapse random_{poly,blind} fields back into Committed in other structures. 2021-07-13 16:19:44 -06:00
Sean Bowe 8caafc0abf
Change n to u in sanity check. 2021-07-13 16:12:21 -06:00
Sean Bowe dd41cfa022
fix clippy lint 2021-07-13 16:02:41 -06:00
Sean Bowe d0950c6d4c
Add explanation of lookup table degree nuances. 2021-07-13 16:02:27 -06:00
Sean Bowe 0dc4447ad8
Change verification API to allow the caller to supply instances as slices of scalars rather than commitments. 2021-07-13 12:08:16 -06:00
Sean Bowe f532b7e973
Return error if supplied instance slice is too large. 2021-07-13 11:44:58 -06:00
Sean Bowe f314f66f69
Fix clippy lint 2021-07-13 10:11:38 -06:00
Sean Bowe 9155cd174b
Introduce `set_minimum_degree` to avoid performance regression in benchmark. 2021-07-12 15:28:16 -06:00
Sean Bowe 827132302a
Remove the ability to rotate when switching to the extended domain. 2021-07-12 12:57:09 -06:00
Sean Bowe a091795aca
Switch to computing only Rotation::cur() cosets until rotation is needed. 2021-07-12 12:53:12 -06:00
Sean Bowe d8df7a12d5
Fix clippy lint on beta. 2021-07-10 08:52:30 -06:00
Sean Bowe cc84e9bf52
Additional documentation suggestions from @str4d. 2021-07-10 08:47:57 -06:00
Sean Bowe 50768bff20
Add comment explaining the extra caution in minimum_rows(). 2021-07-10 08:43:01 -06:00
Sean Bowe 9023161988
Add bounds check to Assignment::query_instance impls. 2021-07-10 08:25:00 -06:00
Sean Bowe 1be7bf1df0
Address review comments from @daira. 2021-07-10 08:12:08 -06:00
Sean Bowe 20653acc39
Document `permutation::Argument::required_degree`. 2021-07-10 07:52:42 -06:00
Sean Bowe fc946d99bf
Use Option in sanity-check rather than a random value. 2021-07-09 12:47:36 -06:00
Sean Bowe 9e6277ef6b
Make `usable_rows` temporary to avoid duplicative code. 2021-07-09 12:45:51 -06:00
Sean Bowe 326cae153e
Fix minor typos in comments. 2021-07-09 12:44:27 -06:00
Sean Bowe 90be1c29ab
Fix bug in sanity check during lookup argument witness creation. 2021-07-09 12:41:52 -06:00
Sean Bowe bd29ebdb05
Use ranges to clarify bounds on cell assignment. 2021-07-09 12:38:38 -06:00
Sean Bowe 00b0b6c535
Add documentation for ConstraintSystem::num_advice_queries. 2021-07-09 09:28:45 -06:00
Sean Bowe 1c48ace3d9
Simplify l_last assignment. 2021-07-09 09:22:25 -06:00
Sean Bowe 7c66323d87
Rename l_cover to l_blind for clarity. 2021-07-09 09:22:25 -06:00
Sean Bowe f89e27ad10
Address some comments from @daira. 2021-07-09 09:22:20 -06:00
Sean Bowe b246897a8d
Add `constrain_instance` and `assign_advice_from_instance` APIs. 2021-07-08 15:32:56 -06:00
Sean Bowe 1f1b705fa6
Make lookup argument perfectly zero-knowledge and complete. 2021-07-08 14:52:44 -06:00
Sean Bowe 7afe549524
clippy fixes 2021-07-02 16:33:22 -06:00