[series] Step 1 — primitive Series over {Int, Float} #61

Closed
opened 2026-06-02 12:00:23 +02:00 by Brummel · 1 comment
Owner

First, primitive tier of the series milestone (#8). Ship Series T for T ∈ {Int, Float} as a kernel-tier .ail library extension wrapping RawBuf.

What ships

  • series.ail kernel-tier module: a Series ADT ((ctor S (con RawBuf a) Int Int Int Int) — buffer + lookback/head/count/total), param-in (a Int Float).
  • Operations (all pure AILang, all own returns): new, push, at (financial indexing, 0 = newest), len, total_count. Signatures per 0007 §"Series — the library extension".
  • E2E coverage: the SMA worked example (0007 §"Worked example") as the headline fixture, plus check / run / build parity.

Acceptance

  • The SMA program checks, runs, and builds to a native binary with correct output.
  • Measure push in-place (milestone decision D5): confirm the uniqueness inference emits an in-place buffer store + counter updates for Series.push, not a per-push ~40-byte wrapper realloc. Use the bench harness; record the number. If push falls back to wrapper-realloc, file a follow-up pointing at the 0009 box path — do NOT block step 1 on it. clang -O2 will not rescue a missed elision (D5).

Guardrails (milestone #8 decisions)

  • No borrow returns (D1). No 0008 ("Iteration-totality story", #3) or 0009 dependency (D1, D2).
  • Element set is {Int, Float} only for this step; Bool deferred.

Anchor: design/models/0007-kernel-extensions.md. Entry path: brainstorm → planner → implement → fieldtest.

First, primitive tier of the `series` milestone (#8). Ship `Series T` for `T ∈ {Int, Float}` as a kernel-tier `.ail` library extension wrapping `RawBuf`. ## What ships - `series.ail` kernel-tier module: a `Series` ADT (`(ctor S (con RawBuf a) Int Int Int Int)` — buffer + lookback/head/count/total), `param-in (a Int Float)`. - Operations (all pure AILang, all `own` returns): `new`, `push`, `at` (financial indexing, 0 = newest), `len`, `total_count`. Signatures per 0007 §"Series — the library extension". - E2E coverage: the SMA worked example (0007 §"Worked example") as the headline fixture, plus check / run / build parity. ## Acceptance - The SMA program checks, runs, and builds to a native binary with correct output. - **Measure push in-place (milestone decision D5):** confirm the uniqueness inference emits an in-place buffer store + counter updates for `Series.push`, not a per-push ~40-byte wrapper realloc. Use the bench harness; record the number. If push falls back to wrapper-realloc, file a follow-up pointing at the 0009 `box` path — do NOT block step 1 on it. clang `-O2` will not rescue a missed elision (D5). ## Guardrails (milestone #8 decisions) - No borrow returns (D1). No 0008 ("Iteration-totality story", #3) or 0009 dependency (D1, D2). - Element set is {Int, Float} only for this step; Bool deferred. Anchor: `design/models/0007-kernel-extensions.md`. Entry path: brainstorm → planner → implement → fieldtest.
Brummel added this to the series milestone 2026-06-02 12:00:23 +02:00
Brummel added the feature label 2026-06-02 12:00:23 +02:00
Author
Owner

Step 1 SHIPPED and closed 2026-06-02. Primitive Series T for T in {Int, Float} ships as a kernel-tier .ail library extension over RawBuf (crates/ailang-kernel/src/series/): 5 ops (new/push/at/len/total_count), financial-style indexing (index 0 = newest), own-in/own-out linear push threading. SMA worked example builds, runs, and prints the correct rolling average; full workspace green; leak-clean (the drop-soundness tail #63, a general pre-existing 3-leg cluster surfaced via this milestone, is fully fixed — legs 1/2/3 across 68f500c/e3a9065/d72fe0c, series_sma live=0).

Commits: precondition b11a6d9 -> RED 6b7ee45 -> GREEN module 35a9bc6 -> model-0007 reconcile 73fbb24 -> fieldtest 3b3c8c4.

Step 2 (#62, SoA record-of-series) is DEFERRED and detached from this milestone: per its grounding comment it is not a pure-AILang library step (nominal-only language => no generic record-Series) but a base-tier/language decision. The series milestone closes at this delivered primitive tier.

Step 1 SHIPPED and closed 2026-06-02. Primitive Series T for T in {Int, Float} ships as a kernel-tier .ail library extension over RawBuf (crates/ailang-kernel/src/series/): 5 ops (new/push/at/len/total_count), financial-style indexing (index 0 = newest), own-in/own-out linear push threading. SMA worked example builds, runs, and prints the correct rolling average; full workspace green; leak-clean (the drop-soundness tail #63, a general pre-existing 3-leg cluster surfaced via this milestone, is fully fixed — legs 1/2/3 across 68f500c/e3a9065/d72fe0c, series_sma live=0). Commits: precondition b11a6d9 -> RED 6b7ee45 -> GREEN module 35a9bc6 -> model-0007 reconcile 73fbb24 -> fieldtest 3b3c8c4. Step 2 (#62, SoA record-of-series) is DEFERRED and detached from this milestone: per its grounding comment it is not a pure-AILang library step (nominal-only language => no generic record-Series) but a base-tier/language decision. The series milestone closes at this delivered primitive tier.
Sign in to join this conversation.