6a4e8669a3
Surface-touch fieldtest of M1's (export "<sym>") + --emit=staticlib + scalar/effect-free gate. DESIGN.md + public examples only (no compiler source). The M1 thesis is empirically substantiated: - [working] Int EMA + Float leaky-integrator both first-try clean end-to-end (author -> --emit=staticlib -> C link -> typed scalar return; s==67 / s==1.875, exit 0). Clause-1 confirmed. - [working] Both clause-3 rejections precise + self-correcting (export-non-scalar-signature on IntList param; export-has-effects on !IO). Clause-3 confirmed. - [working] (export) orthogonality + zero-export staticlib guard match spec. - [friction] form_a.md 'wrap every param in own/borrow' misdirects the headline scalar export -> body-pointing use-after-consume / consume-while-borrowed; only bare (con Int) checks. Pre-existing form_a.md defect M1 made acute (not introduced). - [spec_gap] form_a.md item 1 unconditional; scalar params take no mode (shares root with the friction). - [spec_gap] no public emit-ir --emit=staticlib though Decision 5 makes kernel-IR readability load-bearing. Boss verified independently via the public CLI (positive E2E builds both archives; both rejections fire the documented codes). 0 bugs: M1 capability + gate sound. Findings route to the roadmap as follow-up (not M1-blocking, no debug).
17 lines
544 B
Plaintext
17 lines
544 B
Plaintext
(module embabi1_2_leaky_integrator
|
|
|
|
; Leaky integrator over Float samples, one sample per host call:
|
|
; new = state * 0.5 + sample
|
|
; This is the Float-scalar counterpart of the Int EMA fold —
|
|
; same (State, Sample) -> State host-driven accumulator shape,
|
|
; exercising the other M1 scalar type across the C boundary.
|
|
(fn leaky_step
|
|
(export "leaky_step")
|
|
(type
|
|
(fn-type
|
|
(params (con Float) (con Float))
|
|
(ret (con Float))))
|
|
(params state sample)
|
|
(body
|
|
(app + (app * state 0.5) sample))))
|