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).
18 lines
548 B
Plaintext
18 lines
548 B
Plaintext
(module embabi1_1_ema_step
|
|
|
|
; Fixed-point exponential moving average, one sample per call.
|
|
; alpha = 1/4: new = old + (sample - old) / 4
|
|
; The host drives this in a loop, one chunk-sample at a time,
|
|
; carrying `state` across calls — the (State, Sample) -> State
|
|
; accumulator the embedding boundary exists for.
|
|
(fn ema_step
|
|
(export "ema_step")
|
|
(type
|
|
(fn-type
|
|
(params (con Int) (con Int))
|
|
(ret (con Int))))
|
|
(params state sample)
|
|
(body
|
|
(app + state
|
|
(app / (app - sample state) 4)))))
|