Skip to main content

Module recurrence

Module recurrence 

Source
Expand description

Recurrence intrinsics — partial migration to typed marshal layer (cross-crate-dual-consumer pattern; see docs/defections.md 2026-05-07 intrinsics-typed-CC entry’s N1 sub-decision).

__intrinsic_linear_recurrence has two distinct consumers:

  1. Compiler-typed-call-sites consumer — typed entry via create_recurrence_intrinsics_module (register_typed_fn_3_full using the N1 FromSlot<Option<f64>> impl from marshal.rs).

  2. Shape-vm BuiltinFunction dispatcher consumer — references the legacy intrinsic_linear_recurrence body directly from crates/shape-vm/src/executor/builtins/runtime_delegated.rs:138. No vm_intrinsic_linear_recurrence shape-vm-side parallel copy exists (unlike rolling/random/distributions which have vm_intrinsic_* copies in crates/shape-vm/src/executor/builtins/intrinsics/).

Both consumers are real and structurally distinct. This is two-consumer- two-paths, NOT dual-registration soft-fail. Consolidation (drop legacy body + edit shape-vm dispatcher) is deferred to the shape-vm cleanup workstream per M-A scope binding.

Computes y[t] = y[t-1] * decay + input[t]. Used for recursive indicators (EMA, etc.). Optional initial value: when omitted/null, y[0] = input[0].

Functions§

create_recurrence_intrinsics_module
Create the recurrence intrinsics module with the typed-marshal entry for __intrinsic_linear_recurrence.
intrinsic_linear_recurrence
Intrinsic: Linear Recurrence