The scheduled recovery circuit #
One circuit answers t requests Fin.append a z to a packed function (see
MassProduction.Pipeline.Packing), keeping every request in its input position:
- a shared table maps every prefix
ato its target point, copy and bit position (lookupStage, bybatchLookupCircuit); - a scheduler lists the points of pairwise disjoint punctured lines through the targets
(
scheduleStage); - every incidence of a request with a point of its line sends the request's suffix to the slot
of its copy and point (
scatterCircuit); since the lines are disjoint, a slot receives the suffix of at most one request, and unused slots receive zeros; - every slot evaluates every resource of its copy and point on its suffix once
(
bankCircuit), from caller-supplied resource circuits; - every incidence reads back the resource bit of its request (
gatherCircuit); - every request sums its gathered bits (
lineSums, at four gates per bit bycomplexity_lineSums_le).
The sum of a request is the requested value (lineSums_eval_recoveryCircuit). Requests may
repeat. Scatter and gather are shared OR lookups (batchOrCircuit) on keys made of a copy index,
point bits and, for the gather, a bit index.
Sizes count every gate, constants included (size_recoveryCircuit); they do not certify the
running time of the circuit constructors.
Main definitions #
Cslib.Circuits.Boolean.MassProduction.Pipeline.recoveryCircuit: stages one to five.Cslib.Circuits.Boolean.MassProduction.Pipeline.lineSums: stage six, as a function.Cslib.Circuits.Boolean.MassProduction.Pipeline.slotResource: the resource of a slot.
Main results #
Cslib.Circuits.Boolean.MassProduction.Pipeline.lineSums_eval_recoveryCircuit: correctness.Cslib.Circuits.Boolean.MassProduction.Pipeline.size_recoveryCircuit: the exact gate count.Cslib.Circuits.Boolean.MassProduction.Pipeline.complexity_lineSums_le: the cost of the sums.
References #
- Adapted from MassProduction/HighRate/{ResourceLayout,PrefixMetadata}.lean and MassProduction/Nonuniform/{IncidenceEvaluation,MaskedScatter,ResourceBank,ResourceGather, ScheduledRecovery}.lean in S. Schlesinger, Boolean circuit mass production formalization.
Shared OR lookup with one matching value #
If some source matches a query and every matching source carries the value V, the shared
OR lookup returns V to that query.
Encodings #
The width of the metadata of a request: its target point, copy and bit position.
Instances For
The width of the circuit state after scheduling: listed lines, metadata and the input.
Instances For
The stages #
The metadata of a prefix: the bits of its information point, its copy and its bit index.
Instances For
Stage one: look up the metadata of every prefix in one shared table, keeping the input.
Instances For
Stage three: every incidence sends the suffix of its request to the slot of its key.
Instances For
Stage five: every incidence reads the bank output at the slot of its key and the bit position of its request.
Instances For
The scheduled recovery circuit. Output (i, j) is the resource bit of request i at point
j of its line.
Instances For
Every gate is counted, including the constants of the lookups.
Summing the gathered bits costs four gates per bit and one constant per request.
Correctness #
The resource of slot q and bit position r.
Instances For
Correctness of scheduled recovery. Given a scheduler and circuits for the slot resources,
the outputs of every request along its line sum to f at its input block.