Expand description
Execution context for Milkdrop expressions.
Structs§
- Cold
Slab 🔒 - Indexed slab for cold variables. The bytecode VM resolves cold
names to slab indices at compile time and addresses them directly,
skipping the
HashMapContextprobe + theString::fromallocation thatMilkContext::setwould otherwise pay on every store. - HotVars 🔒
- Array-backed scratch slots. The bytecode VM addresses these by
index (one
f64array load per access — no enum-tag match). The parallelHotVars::slots_valuearray backs evalexpr’sContext::get_value(name) -> Option<&Value>contract and is kept in sync with the f64 array on every write. - Milk
Context - Execution context containing all Milkdrop variables.
Constants§
- HOT_A
- HOT_A2
- HOT_
ADDITIVE - HOT_ANG
- HOT_B
- HOT_B2
- HOT_
BORDER_ A - HOT_
BORDER_ B - HOT_
BORDER_ G - HOT_
BORDER_ R - HOT_
COUNT - HOT_G
- HOT_G2
- HOT_
INSTANCE - HOT_
NUM_ INST - HOT_R
- HOT_R2
- HOT_RAD
- HOT_
SAMPLE - HOT_
SIDES - HOT_
TEX_ ANG - HOT_
TEX_ ZOOM - HOT_
THICK - HOT_
VALU E1 - HOT_
VALU E2 - HOT_X
- HOT_Y
- Q_
CHANNEL_ NAMES_ 32 - Pre-baked
"q1".."q32"strings. Hot paths that need to refer to a q-channel by name (e.g. error messages, evalexpr trait methods that only take&str) can index into this table instead of paying aformat!("q{}", i)Stringallocation per call. Reads/writes of q-channel values themselves should go throughMilkContext::q_get_idx/MilkContext::q_set_idxwhich skip name lookup entirely.
Functions§
- hot_
index_ of - Map a Milkdrop hot-var name → its slot index. Used by the bytecode
compiler (
onedrop-eval::bytecode) and by evalexpr’sContextimpl below to short-circuit reads/writes of the hot vars without a HashMap probe orStringallocation. - is_
hot_ var - Returns
trueiffnameis a hot-path scratch variable (per-point, per-vertex, or per-shape) routed throughHotVarsrather than the underlyingHashMapContext. The parallel-samples analyser (onedrop-engine::wave_phase::carry) uses the same set. - q_
index_ of - Map a
qNidentifier (1 ≤ N ≤ 64) to its 0-based slot index in the q-vars array. ReturnsNonefor any non-qNname or out-of-range N. Used by the bytecode VM compiler and byMilkContext’sContextimpl to bypass HashMap probes for the q-channel reads/writes that dominate per_frame state passing.