pub struct Circuit<F: TowerField> { /* private fields */ }Expand description
Recorder for one program: main-table declarations plus mounted and attached chiplets.
Implementations§
Source§impl<F: TowerField + HardwareField> Circuit<F>
impl<F: TowerField + HardwareField> Circuit<F>
pub fn num_rows(&self) -> usize
Sourcepub fn cs(&self) -> &ConstraintSystem<F>
pub fn cs(&self) -> &ConstraintSystem<F>
Constraint DSL over the recorded columns.
Column handles convert via Col::index.
pub fn column(&mut self, ty: ColumnType) -> Col
Sourcepub fn schema(&mut self, layout: &[ColumnType]) -> ColRange
pub fn schema(&mut self, layout: &[ColumnType]) -> ColRange
Records a define_columns! layout 1:1, physical to
virtual. Index the range with the schema’s own constants.
pub fn columns(&mut self, count: usize, ty: ColumnType) -> ColRange
Sourcepub fn pass_through(&mut self, count: usize, storage: ColumnType) -> ColRange
pub fn pass_through(&mut self, count: usize, storage: ColumnType) -> ColRange
Commits count storage columns that constraints see
whole, as one expander entry: columns merges adjacent
same-type runs and the entries enter program_id.
Sourcepub fn expand_bits(&mut self, count: usize, storage: ColumnType) -> Packed
pub fn expand_bits(&mut self, count: usize, storage: ColumnType) -> Packed
Commits count storage columns (B8 to B64) that
constraints see as bits: bits(i).at(k) is bit k of
column i. reuse_pass_through also shows them whole.
Sourcepub fn reuse_pass_through(&mut self, src: impl Into<PhysRange>) -> ColRange
pub fn reuse_pass_through(&mut self, src: impl Into<PhysRange>) -> ColRange
Lets constraints read committed columns src whole
without committing them again: the Packed from
expand_bits or a slice of Mounted::physical().
Sourcepub fn reuse_expand_bits(&mut self, src: impl Into<PhysRange>) -> Packed
pub fn reuse_expand_bits(&mut self, src: impl Into<PhysRange>) -> Packed
Lets constraints read committed columns src as bits
without committing them again. Bit numbering and the
B8 to B64 limit are those of expand_bits.
Sourcepub fn physical(&self, cols: ColRange) -> Result<PhysRange>
pub fn physical(&self, cols: ColRange) -> Result<PhysRange>
Committed columns behind cols, a range of
declared columns or of a whole-column view.
Sourcepub fn fix(&mut self, col: Col, shape: FixedShape<F>)
pub fn fix(&mut self, col: Col, shape: FixedShape<F>)
Pins col to shape; the verifier evaluates
the shape’s MLE for itself at r_final.
Sourcepub fn boundary(&mut self, col: Col, row: usize, value: F)
pub fn boundary(&mut self, col: Col, row: usize, value: F)
Constant-target pin;
public inputs enter only through publish.
Sourcepub fn call(
&mut self,
service: &Service,
values: &[Col],
selector: Col,
) -> Result<()>
pub fn call( &mut self, service: &Service, values: &[Col], selector: Col, ) -> Result<()>
Requester endpoint of service on this table.
Sourcepub fn bus(&mut self, bus_id: &str, spec: PermutationCheckSpec)
pub fn bus(&mut self, bus_id: &str, spec: PermutationCheckSpec)
Raw bus endpoint for shapes Service does
not model (positional, paired, waivered).
Sourcepub fn mount(&mut self, def: ChipletDef<F>) -> Mounted
pub fn mount(&mut self, def: ChipletDef<F>) -> Mounted
Mounts a chiplet inline: its artifacts and bus endpoints merge into this table at engine-computed offsets.
Sourcepub fn mount_unlinked(&mut self, def: ChipletDef<F>) -> Mounted
pub fn mount_unlinked(&mut self, def: ChipletDef<F>) -> Mounted
Mounts a chiplet used as the program’s own trace, whose declared bus has no partner here.
Sourcepub fn attach(&mut self, def: ChipletDef<F>)
pub fn attach(&mut self, def: ChipletDef<F>)
Attaches a chiplet as an independent table with its own trace, commitment, and ZeroCheck.
Sourcepub fn attach_namespaced(
&mut self,
namespace: &str,
defs: Vec<ChipletDef<F>>,
external: &[&str],
) -> Result<()>
pub fn attach_namespaced( &mut self, namespace: &str, defs: Vec<ChipletDef<F>>, external: &[&str], ) -> Result<()>
Attaches defs as independent tables, renaming every bus
but external to "{namespace}::{id}": two attached
groups whose buses share an id cannot trade tokens.
Sourcepub fn publish(&mut self, col: Col, row: usize) -> usize
pub fn publish(&mut self, col: Col, row: usize) -> usize
Pins col at row to a fresh public input slot,
returned. Whether the AIR determines the pinned
cell is the audited circuit’s burden, not checked.
Sourcepub fn compile(self) -> Result<CircuitProgram<F>>
pub fn compile(self) -> Result<CircuitProgram<F>>
Derives the program artifacts, running every structural validator on the recording.
Auto Trait Implementations§
impl<F> !Freeze for Circuit<F>
impl<F> !RefUnwindSafe for Circuit<F>
impl<F> !Sync for Circuit<F>
impl<F> Send for Circuit<F>where
ConstraintSystem<F>: Send,
Vec<FixedColumn<F>>: Send,
Vec<BoundaryConstraint<F>>: Send,
Vec<ChipletDef<F>>: Send,
impl<F> Unpin for Circuit<F>where
ConstraintSystem<F>: Unpin,
Vec<FixedColumn<F>>: Unpin,
Vec<BoundaryConstraint<F>>: Unpin,
Vec<ChipletDef<F>>: Unpin,
impl<F> UnsafeUnpin for Circuit<F>where
ConstraintSystem<F>: UnsafeUnpin,
Vec<FixedColumn<F>>: UnsafeUnpin,
Vec<BoundaryConstraint<F>>: UnsafeUnpin,
Vec<ChipletDef<F>>: UnsafeUnpin,
impl<F> UnwindSafe for Circuit<F>where
ConstraintSystem<F>: UnwindSafe,
Vec<FixedColumn<F>>: UnwindSafe,
Vec<BoundaryConstraint<F>>: UnwindSafe,
Vec<ChipletDef<F>>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more