pub(crate) struct CompiledWave {
pub(crate) init: CompiledBlock,
pub(crate) per_frame: CompiledBlock,
pub(crate) per_point: Vec<Node>,
pub(crate) per_point_parallelism: PerPointParallelism,
pub(crate) per_point_bytecode: Option<CompiledBytecode>,
}Expand description
Pre-compiled equation Nodes for one wavecode_N block. We compile
each phase exactly once per load_preset; per-frame and per-point
evaluation just runs the cached Nodes, skipping the regex-based
preprocess that MilkEvaluator::eval performs every call. This is
load-bearing for performance: a single 512-sample wave with 5
per-point statements runs the loop 2 560 times per frame.
init and per_frame are wrapped in CompiledBlock so they
transparently pick the bytecode VM when the block lowers cleanly
(~80 % of corpus presets) and fall back to evalexpr nodes otherwise.
per_point keeps its raw Vec<Node> + separate
Option<CompiledBytecode> because the parallel-samples branch in
compute_one_wave needs them addressable individually (carry-safe
presets fan samples out across rayon workers, with each worker
running either path).
Fields§
§init: CompiledBlock§per_frame: CompiledBlock§per_point: Vec<Node>§per_point_parallelism: PerPointParallelismCached carry-analysis verdict — Safe means samples can be
evaluated in parallel via rayon (no cross-sample state),
Sequential means we must thread the previous sample’s output
into the next call (MD2 default semantics).
per_point_bytecode: Option<CompiledBytecode>Bytecode-VM compilation of per_point. Some when every node
in the block lowered cleanly; None when at least one operator
or function falls outside the VM’s supported set (rand,
gmegabuf, loop, …) — in that case compute_one_wave falls back
to the evalexpr Node path so behaviour is preserved.
Trait Implementations§
Source§impl Debug for CompiledWave
impl Debug for CompiledWave
Auto Trait Implementations§
impl Freeze for CompiledWave
impl RefUnwindSafe for CompiledWave
impl Send for CompiledWave
impl Sync for CompiledWave
impl Unpin for CompiledWave
impl UnwindSafe for CompiledWave
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().