pub enum StaticModel {
Show 23 variants
WavenetStandard(Box<WaveNetModel<16, 3, 8>>),
WavenetLite(Box<WaveNetModel<12, 3, 6>>),
WavenetFeather(Box<WaveNetModel<8, 3, 4>>),
WavenetNano(Box<WaveNetModel<4, 3, 2>>),
WavenetA2Full(Box<WaveNetA2<8>>),
WavenetA2Lite(Box<WaveNetA2<3>>),
WavenetA2Dyn(Box<WaveNetA2Dyn>),
WavenetA2Cascade(Box<WaveNetA2Cascade>),
WavenetDyn(Box<WaveNetModelDyn>),
Lstm1x3(Box<Lstm1x3>),
Lstm1x8(Box<Lstm1x8>),
Lstm1x12(Box<Lstm1x12>),
Lstm1x16(Box<Lstm1x16>),
Lstm1x24(Box<Lstm1x24>),
Lstm2x8(Box<Lstm2x8>),
Lstm2x12(Box<Lstm2x12>),
Lstm2x16(Box<Lstm2x16>),
Lstm1x40(Box<Lstm1x40>),
Lstm2x24(Box<Lstm2x24>),
LstmDyn(Box<LstmModelDyn>),
Container(Box<ContainerModel>),
Linear(Box<LinearModel>),
ConvNet(Box<ConvNetModel>),
}Expand description
Wrapper enum for trained model variants. Enables static dispatch of DSP calls to the concrete variant, avoiding vtable overhead.
Named StaticModel because all variants are compile-time-fixed geometries.
The legacy “Dynamic” mode (arbitrary geometry at runtime) has been retired.
Variants§
WavenetStandard(Box<WaveNetModel<16, 3, 8>>)
WaveNet Standard (16 channels, kernel 3, dilation 8).
WavenetLite(Box<WaveNetModel<12, 3, 6>>)
WaveNet Lite (12 channels, kernel 3, dilation 6).
WavenetFeather(Box<WaveNetModel<8, 3, 4>>)
WaveNet Feather (8 channels, kernel 3, dilation 4).
WavenetNano(Box<WaveNetModel<4, 3, 2>>)
WaveNet Nano (4 channels, kernel 3, dilation 2).
WavenetA2Full(Box<WaveNetA2<8>>)
WaveNet A2 Full (8 channels, real inference).
WavenetA2Lite(Box<WaveNetA2<3>>)
WaveNet A2 Lite (3 channels, real inference).
WavenetA2Dyn(Box<WaveNetA2Dyn>)
WaveNet A2 Dynamic (runtime-dimensioned, full topology spectrum).
WavenetA2Cascade(Box<WaveNetA2Cascade>)
WaveNet A2 Cascade (multi-array chain of Dynamic engines).
WavenetDyn(Box<WaveNetModelDyn>)
WaveNet Dynamic (runtime-dimensioned, free geometry).
Lstm1x3(Box<Lstm1x3>)
LSTM 1 Layer × 3 hidden units.
Lstm1x8(Box<Lstm1x8>)
LSTM 1 Layer × 8 hidden units.
Lstm1x12(Box<Lstm1x12>)
LSTM 1 Layer × 12 hidden units.
Lstm1x16(Box<Lstm1x16>)
LSTM 1 Layer × 16 hidden units.
Lstm1x24(Box<Lstm1x24>)
LSTM 1 Layer × 24 hidden units.
Lstm2x8(Box<Lstm2x8>)
LSTM 2 Layers × 8 hidden units.
Lstm2x12(Box<Lstm2x12>)
LSTM 2 Layers × 12 hidden units.
Lstm2x16(Box<Lstm2x16>)
LSTM 2 Layers × 16 hidden units.
Lstm1x40(Box<Lstm1x40>)
LSTM 1 Layer × 40 hidden units.
Lstm2x24(Box<Lstm2x24>)
LSTM 2 Layers × 24 hidden units.
LstmDyn(Box<LstmModelDyn>)
LSTM Dynamic — runtime-dimensioned, free geometry (F7 fallback).
Container(Box<ContainerModel>)
SlimmableContainer — bundle of submodels selected by quality threshold.
Linear(Box<LinearModel>)
Linear — FIR-based model (dot product of input history with weights + bias).
ConvNet(Box<ConvNetModel>)
ConvNet feed-forward model (F4).
Implementations§
Source§impl StaticModel
impl StaticModel
Sourcepub fn inject_rt_status(&mut self, rt_status: Arc<RtStatusFlags>)
pub fn inject_rt_status(&mut self, rt_status: Arc<RtStatusFlags>)
Injects RtStatusFlags into the model so it can signal its state
to the UI via atomic flags.
Sourcepub fn process_scalar(&mut self, input: &[f32], output: &mut [f32])
pub fn process_scalar(&mut self, input: &[f32], output: &mut [f32])
Scalar processing path for LSTM models (exact tanh/sigmoid via libm).
Only available under #[cfg(test)] or #[cfg(feature = "testing")].
For non-LSTM models, delegates to process().
Sourcepub fn set_effective_layers(&mut self, n: usize)
pub fn set_effective_layers(&mut self, n: usize)
Sets the effective number of layers for soft-degrade. Only applies to WaveNet variants. LSTM handles reduction at the pipeline level.
Sourcepub fn backup_buffer_starts(&self, starts: &mut [usize], offset: &mut usize)
pub fn backup_buffer_starts(&self, starts: &mut [usize], offset: &mut usize)
Backs up WaveNet buffer starts. No-op for non-WaveNet models.
Sourcepub fn restore_buffer_starts(&mut self, starts: &[usize], offset: &mut usize)
pub fn restore_buffer_starts(&mut self, starts: &[usize], offset: &mut usize)
Restores WaveNet buffer starts. No-op for non-WaveNet models.
Sourcepub fn set_slimmable_size(
&mut self,
val: f32,
rt_status: Option<&RtStatusFlags>,
)
pub fn set_slimmable_size( &mut self, val: f32, rt_status: Option<&RtStatusFlags>, )
Sets the slimmable quality level for SlimmableModel variants.
Only applies to Container. Other variants are a no-op.
rt_status — when on the RT hot-path, pass Some(&rt_status) so errors
can be signaled atomically. Pass None in tests or off-RT contexts.
Sourcepub fn slimmable_breakpoints(&self) -> Vec<f64>
pub fn slimmable_breakpoints(&self) -> Vec<f64>
Returns the slimmable quality breakpoints for this model.
Delegates to ContainerModel::slimmable_breakpoints() when this is a
Container variant. Returns an empty vector for all other variants.
Sourcepub fn layer_count(&self) -> usize
pub fn layer_count(&self) -> usize
Returns the total number of layers for the model (0 for non-WaveNet). Used by the adaptive FSM to compute how many to keep.
Sourcepub fn class_label(&self) -> String
pub fn class_label(&self) -> String
Returns a human-readable classification label for this model variant.
Used by nondist_validation.rs to cross-check against the manifest’s
expected_class field and detect dispatcher routing errors.
Sourcepub fn is_wavenet(&self) -> bool
pub fn is_wavenet(&self) -> bool
Returns true if this is a WaveNet model.
Sourcepub fn supports_layer_skip(&self) -> bool
pub fn supports_layer_skip(&self) -> bool
Returns true if this model supports layer skipping (WaveNet A1 variants only).
A2 architectures use MirroredBuffer + layer_buffer_starts/head_write_pos
and cannot safely participate in the double-pass crossfade mechanism.
Sourcepub fn is_container(&self) -> bool
pub fn is_container(&self) -> bool
Returns true if this is a SlimmableContainer model.
Sourcepub fn in_channels(&self) -> usize
pub fn in_channels(&self) -> usize
Returns the number of input channels consumed by the model’s process().
- WaveNet variants and LSTM: always 1 (single sample per frame).
- ConvNet:
in_channelsfrom configuration (defaults to 1). - Container: delegates to active sub-model.
Sourcepub fn receptive_field(&self) -> usize
pub fn receptive_field(&self) -> usize
Returns the receptive field size of the model (or 0 for LSTM/Container).
Sourcepub fn num_output_channels(&self) -> usize
pub fn num_output_channels(&self) -> usize
Returns the number of output channels produced by the model’s process().
Mirrors C++ DSP::NumOutputChannels():
- WaveNet A1 without post-stack head: last array’s
head_size(wave_net_output_channels) - LSTM:
hidden_size - Linear: 1
- Container: delegates to active sub-model
Trait Implementations§
Source§impl NamModel for StaticModel
impl NamModel for StaticModel
Source§fn process(&mut self, input: &[f32], output: &mut [f32])
fn process(&mut self, input: &[f32], output: &mut [f32])
Source§fn prewarm(&mut self, num_samples: usize)
fn prewarm(&mut self, num_samples: usize)
prewarm).Source§fn prewarm_on_reset(&self) -> bool
fn prewarm_on_reset(&self) -> bool
reset(). Read moreSource§fn set_prewarm_on_reset(&mut self, val: bool)
fn set_prewarm_on_reset(&mut self, val: bool)
reset(). Read moreSource§fn reset(&mut self, sample_rate: u32, max_buffer_size: usize) -> Result<()>
fn reset(&mut self, sample_rate: u32, max_buffer_size: usize) -> Result<()>
Source§fn set_max_buffer_size(&mut self, max_buf: usize) -> Result<()>
fn set_max_buffer_size(&mut self, max_buf: usize) -> Result<()>
Source§fn prewarm_samples(&self) -> usize
fn prewarm_samples(&self) -> usize
Auto Trait Implementations§
impl Freeze for StaticModel
impl RefUnwindSafe for StaticModel
impl Send for StaticModel
impl Sync for StaticModel
impl Unpin for StaticModel
impl UnsafeUnpin for StaticModel
impl UnwindSafe for StaticModel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.