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.
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`).
This layouter improves on the single-pass strategy in two ways:
- Regions are layed out with a "first fit" strategy (using the algorithm
described in https://github.com/zcash/halo2/issues/93) instead of a
"last fit" strategy. This enables gaps in the circuit to be filled.
- Regions are sorted by their "advice area" (columns * rows), and are
then layed out biggest-first. This takes advantage of the regularity
of circuits, and that the advice columns have the most contention. It
also leads to larger gaps between early layed-out regions that are more
easily filled by subsequent smaller regions.
The V1 layouter is a dual-pass layouter, that has visibility into the
entire `Circuit::synthesize` step.
This first commit implements the same strategy as `SingleChipLayouter`,
behaving as if it were a single-pass layouter.
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>