#[non_exhaustive]pub struct Options {
pub enable_gate_fusion: bool,
pub enable_constant_propagation: bool,
pub enable_common_subexpression_elimination: bool,
pub enable_dead_code_elimination: bool,
pub enable_algebraic_folding: bool,
pub enable_scratch_pooling: bool,
pub enable_zero_propagation: bool,
}Expand description
Which compiler passes run.
This is the only knob: a circuit compiles the same way whatever the process environment holds.
A caller that wants a non-default pass set builds through CircuitBuilder::with_opts,
overriding the fields it cares about:
use binius_frontend::{CircuitBuilder, Options};
let mut opts = Options::default();
opts.enable_gate_fusion = false;
let builder = CircuitBuilder::with_opts(opts);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enable_gate_fusion: boolInline linear definitions into the non-linear gates that consume them.
enable_constant_propagation: boolFold gates whose inputs are all constants.
enable_common_subexpression_elimination: boolCollapse structurally identical gates.
enable_dead_code_elimination: boolDrop gates that cannot affect the constraint system.
enable_algebraic_folding: boolApply the identities that make an operation return a wire it already has.
- Covers a repeated operand, an absorbing or neutral constant operand, and a zero shift.
- Off means every operation emits its gate.
enable_scratch_pooling: boolShare scratch slots between values whose lifetimes do not overlap.
- Shrinks the uncommitted segment to the largest number of values alive at once.
- Changes no constraint, since an uncommitted value appears in no operand.
- An uncommitted value’s slot can then be reused by a later one.
- Reading an uncommitted value back through a witness filler panics as a result.
enable_zero_propagation: boolForward past the gates a zero operand turns into the identity.
Trait Implementations§
impl Copy for Options
impl Eq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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