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`).
These were all early examples that used the Circuit trait without any
layouter, which is incompatible with upcoming changes.
The minimal change to the PinnedVerificationKey is because the lookup
table is being allocated at the top of its columns instead of in-place.
Enabling selectors to be used in gates at non-zero rotations leads to
confusing gates, and inhibits our ability to create visualizations of
circuits. In most cases, a gate can be rearranged so that the selectors
have no rotation; in cases where cross-gate selector optimisations are
required, these can still be implemented using fixed columns.
The closure passed to `ConstraintSystem::create_gate` can now return:
- Tuples of `(&'static str, Expression<F>)`
- Anything implementing `IntoIterator` (e.g. `Some(Expression<F>)`)
This matches `ConstraintSystem::create_gate`.
At the same time, we bind the input and table expressions together as a
"table map" by requiring the closure to return a vector of tuples. This
ensures they are always the same length.
It is causing problems in (some) downstream crates, and we won't want
these annotations in the codebase anyway if a downstream crate is
collecting metrics. We'll be replacing this with the cost model binary
in https://github.com/zcash/halo2/pull/225 shortly.
This enables chips that e.g. want to load multiple lookup tables into
the same columns to store state about where each table was layed out.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
The `Curve` trait is now `CurveExt: group::prime::PrimeCurve`, and
`CurveAffine` is now `CurveAffine: group::prime::PrimeCurveAffine`.
There is no `CurveAffine` trait in `group`, and it's a widely-used
trait in this crate, so we don't rename it to `CurveAffineExt`.