Skip to main content

Circuit

Struct Circuit 

Source
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>

Source

pub fn new(name: &str, num_rows: usize) -> Result<Self>

§Errors

num_rows not a power of two.

Source

pub fn num_rows(&self) -> usize

Source

pub fn cs(&self) -> &ConstraintSystem<F>

Constraint DSL over the recorded columns. Column handles convert via Col::index.

Source

pub fn column(&mut self, ty: ColumnType) -> Col

Source

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.

Source

pub fn columns(&mut self, count: usize, ty: ColumnType) -> ColRange

Source

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.

Source

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.

Source

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().

Source

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.

Source

pub fn physical(&self, cols: ColRange) -> Result<PhysRange>

Committed columns behind cols, a range of declared columns or of a whole-column view.

Source

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.

Source

pub fn boundary(&mut self, col: Col, row: usize, value: F)

Constant-target pin; public inputs enter only through publish.

Source

pub fn call( &mut self, service: &Service, values: &[Col], selector: Col, ) -> Result<()>

Requester endpoint of service on this table.

Source

pub fn bus(&mut self, bus_id: &str, spec: PermutationCheckSpec)

Raw bus endpoint for shapes Service does not model (positional, paired, waivered).

Source

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.

Source

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.

Source

pub fn attach(&mut self, def: ChipletDef<F>)

Attaches a chiplet as an independent table with its own trace, commitment, and ZeroCheck.

Source

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.

Source

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.

Source

pub fn compile(self) -> Result<CircuitProgram<F>>

Derives the program artifacts, running every structural validator on the recording.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.