Commit Graph

603 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 e23d148b72
minor clippy fixes 2021-07-22 12:07:17 -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 f6895555bb
Update cost model logic to account for selector optimizations. 2021-07-21 13:51:48 -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
Sean Bowe dfbd5e3332
Distinguish between selectors and all other columns in layouter using RegionColumn. 2021-07-21 10:19:35 -06:00
str4d 4283713ec7
Merge pull request #340 from zcash/339-dev-proof-cost
dev: Add CircuitCost tool with proof size measurement
2021-07-21 16:45:03 +01: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 4e6c857854 Add test cases exercising Error::NotEnoughColumnsForConstants 2021-07-21 16:44:14 +01:00
str4d 6420a25c8c
Typo fix
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-07-21 16:35:44 +01:00
Jack Grigg cb9366d656 Fix more clippy lints 2021-07-21 12:00:25 +01:00
Jack Grigg 62f088e2f2 Fix clippy lints 2021-07-21 09:31:27 +08:00
Jack Grigg 629c13eae8 Add `Region::constrain_constant` API
This is the non-assigning subset of `Region::assign_advice_from_constant`.
2021-07-21 09:31:27 +08:00
Jack Grigg 7adf695293 Add constants support to `floor_planner::V1`
Co-authored-by: therealyingtong <yingtong@z.cash>
2021-07-21 09:31:27 +08:00
Jack Grigg 9e2cba917f Update SimpleFloorPlanner with constants support 2021-07-21 09:31:27 +08: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
therealyingtong 958cc7ee4b Introduce metadata::Column struct. 2021-07-20 20:55:11 +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
Jack Grigg 87beee32f4 dev: Add CircuitCost tool with proof size measurement 2021-07-20 03:17:56 +01:00
Sean Bowe ce319c8da8
Add clarifying comment to `distribute_powers_zeta`. 2021-07-19 09:08:24 -06:00
Jack Grigg 1e33570c7a cargo fmt 2021-07-19 14:46:02 +01:00
str4d c0d2aa1286
Merge branch 'main' into coset-optimization 2021-07-19 14:43:37 +01:00
str4d 96b1196bce
Merge pull request #330 from zcash/permutation-common
Merge the common pieces of the permutation argument into a separate proof component
2021-07-19 14:38:24 +01:00
str4d dda1be4731
Merge pull request #336 from zcash/dev-layout-equality
dev: Enable visualizing equality constraints in circuit layouts
2021-07-16 23:03:01 +01:00
str4d 874b52a7f7
dev: Fix typo in doc comment
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-07-16 23:02:18 +01:00
Jack Grigg 3fe004a794 dev: Reduce opacity of marked equality cells to add a border 2021-07-16 23:00:49 +01:00
Jack Grigg 56a6107cdf dev: Enable visualizing equality constraints in circuit layouts 2021-07-16 15:01:55 +01:00
Jack Grigg 8e71415933 MockProver: Limit table expression evaluations to usable rows
Also refactors the lookup argument to only compute table expressions
once per lookup argument.
2021-07-16 00:26:16 +01:00
Sean Bowe b0a4a19093
Rename CommonCommitted to CommonEvaluated. 2021-07-15 15:22:51 -06:00
Jack Grigg 7dae8698b6 MockProver: Poison unusable advice cells
Circuit developers need to use selectors (or equivalent) to prevent their
custom gates from being active on unusable rows. By marking the advice
cells in these rows as "poisoned" and tracking this through expressions,
we can provide a better error message to developers that indicates the
missing selector issue.

Closes zcash/halo2#329.
2021-07-15 22:12:50 +01: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
ebfull 4a9e329ded
Merge pull request #316 from zcash/zk-changes-again
Final ZK changes
2021-07-14 16:19:06 -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 b4bd4ada9a
Clarify barycentric weight doc comment. 2021-07-14 09:19:56 -06:00
ebfull 29fc0a781a
Simplify `l_i_range` using `rotate_omega`.
Co-authored-by: str4d <jack@electriccoin.co>
2021-07-14 09:07:21 -06:00
ebfull dfe716dbc1
Describe `l_i_range` implementation in doc comment
Co-authored-by: str4d <jack@electriccoin.co>
2021-07-14 09:05:40 -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