Skip to main content

CompileOptions

Struct CompileOptions 

Source
pub struct CompileOptions {
    pub oversampling: OversamplingFactor,
    pub tolerance: ToleranceEngine,
    pub thermal: bool,
    pub collapse_nl: bool,
    pub skip_k_tables: bool,
    pub skip_blockwise: bool,
    pub force_serial_blockwise: bool,
    pub force_serial_blockwise_feedback_gain: f64,
    pub disable_iir: bool,
    pub coupled_blockwise_newton: bool,
}

Fields§

§oversampling: OversamplingFactor§tolerance: ToleranceEngine§thermal: bool§collapse_nl: bool

When true, collapse ALL nonlinear elements into a single MultiNlStage instead of planning them as individual stages. Used for sidechain sub-circuits where the entire NL network should be solved as one multi-junction system (shared MNA + scattering matrix).

§skip_k_tables: bool

When true, skip K-method lookup table generation. NL roots fall back to Newton-Raphson iteration at runtime. Use for fast debug builds — K-table generation is the main compile-time bottleneck (65536-entry 2D sweeps per NL root).

§skip_blockwise: bool

When true, skip blockwise decomposition of multi-NL groups. Falls back to monolithic R-type adaptor. Use when blockwise produces incorrect pot bindings or signal routing.

§force_serial_blockwise: bool

Diagnostic mode: build blockwise-decomposed nonlinear ladders as serial WDF/K-method rung stages instead of packaging them into one delay-free Blockwise coupling stage. This intentionally breaks delay-free feedback, so it is only useful for isolating rung behavior.

§force_serial_blockwise_feedback_gain: f64

Diagnostic mode: when force_serial_blockwise is enabled, wrap the serial rung stages in a one-sample output feedback loop with this gain. 0.0 preserves the plain forced-serial behavior.

§disable_iir: bool

Diagnostic mode: do not synthesize IIR stages from rigid subgraphs. Rigid passive networks fall through to StateSpace where possible, and active feedback networks fall through to the existing WDF adaptors.

§coupled_blockwise_newton: bool

Solve coupled blockwise K-method stages with the full delay-free Newton/Jacobian iteration. This is useful for compiler validation and offline reference renders, but too expensive for some realtime targets. When false, coupled blockwise stages use table-driven fixed-point iteration without building/solving the full Jacobian.

Implementations§

Source§

impl CompileOptions

Source

pub fn force_monolithic(self) -> Self

Return a copy of these options with blockwise decomposition disabled, forcing all nonlinear groups through the monolithic/rigid MNA path.

Use this for differential testing: compile the same circuit twice (default() and force_monolithic()) and compare outputs sample-wise. Any deviation indicates that blockwise is behaving as a dialect change rather than a pure optimization — which is a bug.

Follows the same opt-in pattern as CompileOptions::thermal: default false (blockwise enabled), set true to override.

Source

pub fn release() -> Self

Default options for release builds: full optimization including K-tables.

Source

pub fn debug() -> Self

Fast options for debug builds: skip K-table generation. NL elements use Newton-Raphson iteration instead (correct but slower at runtime).

Source

pub fn from_cargo_profile() -> Self

Auto-detect from the PROFILE env var set by Cargo during build.rs. Returns release() for “release” profile, debug() for everything else.

Use in build.rs:

let options = pedalkernel::compiler::CompileOptions::from_cargo_profile();

Trait Implementations§

Source§

impl Clone for CompileOptions

Source§

fn clone(&self) -> CompileOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for CompileOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more