Commit Graph

29 Commits

Author SHA1 Message Date
Jack Grigg 64680a1a2d dev: Handle too-small `k` error in `CircuitLayout::render`
In most places within `CircuitLayout`, we are flexible on `k`. However,
for tracking selectors we need to know the number of rows. We could
change this, but given that we also want the number of rows to be
accurate for rendering unusable rows, we can instead use this as an
opportunity to inform the user that they will need to bump `k`.
2021-11-16 14:20:57 +00:00
str4d 27c4187673
Merge pull request #354 from daira/table-refactoring
Add a `Layouter::assign_table` API
2021-07-27 20:52:36 +01:00
Jack Grigg 8d8e76dc82 dev: Minor fixes to `CircuitLayout`
- Default view height is now the circuit size.
- Cells are now always shaded on top of any drawn regions.
2021-07-27 02:25:46 +01:00
Jack Grigg 7cf58661d8 dev: Add used/usable row metadata to `CircuitLayout`
- Black line showing the total used rows.
- Red shading for the unusable rows of the circuit.
- Annotations for the number of used and usable rows.
2021-07-27 02:25:07 +01:00
Daira Hopwood e3e39455be Table refactoring.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-07-27 01:34:51 +01:00
Sean Bowe 26982a6050
Update circuit graph tooling to account for selector optimization. 2021-07-22 10:06:48 -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
Jack Grigg 4417b4e480 Change canonical column ordering to Instance < Advice < Fixed
Closes zcash/halo2#325.
2021-07-20 20:24:37 +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
Sean Bowe 9023161988
Add bounds check to Assignment::query_instance impls. 2021-07-10 08:25:00 -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
Jack Grigg 6d0017f47c Introduce a FloorPlanner trait and integrate it into the Circuit trait
This is the beginning of the process to enable full floor planning
capabilities in `halo2`. For now, all that a floor planner can do is
synthesize a circuit, which makes it no more powerful than a layouter,
but easier to use (as moving to a multi-pass layouter no longer requires
changes to `Circuit::synthesize`).
2021-06-22 23:47:17 +01:00
Jack Grigg 251bc68c05 Introduce an Assigned struct into the Assignment trait APIs
Value closures can now return a `(numerator, denominator)` tuple, in
order to defer inversions until after assignment.
2021-06-12 19:34:13 +01:00
Jack Grigg faac7b798b dev: Render Selectors in a darker shade of blue
The regions are now rendered uniformly the same colour, by removing the
background bleed-through (which was more complex now that the fixed
columns are rendered in two colours).
2021-06-10 00:06:20 +01:00
Jack Grigg 49e18b2647 dev: Render labels last (so they are always the top layer) 2021-06-10 00:05:49 +01:00
Jack Grigg d4984ebf53 dev: Enable CircuitLayout labels to be hidden 2021-06-08 12:26:37 +01:00
Jack Grigg 52be437509 dev: Add CircuitLayout viewport controls 2021-06-08 12:26:37 +01:00
Jack Grigg 3e82c7b232 dev: Move halo2::dev::circuit_layout to halo2::dev::CircuitLayout::render
This makes it easier to add configuration to the renderer.
2021-06-08 12:13:18 +01:00
Jack Grigg e19407a749 Expose selector enablement to the Assignment backends 2021-05-27 12:51:25 +01:00
Jack Grigg 0df5bc4b45 dev: Track region offset correctly in halo2::dev::circuit_layout 2021-04-09 14:32:20 +12:00
therealyingtong 4ae21a905d Update tests 2021-02-24 00:21:12 +08:00
Daira Hopwood 760d69bd2c Rename "auxiliary column" to "instance column" in the book and in code. fixes #181
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-14 21:09:49 +00:00
Jack Grigg 5905230174 Fix stable clippy lints 2021-02-05 16:48:41 +00:00
Jack Grigg c95f0b7c0c circuit_layout: Darken the cells of the region that have been assigned to
We record every instance of a cell assignment, so that cells which are
double-assigned (which is usually a mistake) will appear darker.
2021-02-01 18:38:22 +00:00
Jack Grigg 3c1132ec59 Add halo2::dev::circuit_layout behind dev-graph feature flag
This method renders circuits as tables, showing how the various regions
within them have been layed out.
2021-02-01 18:38:20 +00:00