Expand description
Improv computation engine.
Phase 1. Before building the full formula compiler on differential dataflow,
this module contains the DD-viability spike (see AGENT_STEERING.md
Constraint 1): proof that a Coordinate-keyed, f64-valued incremental
computation (Revenue = Price * Quantity) works on differential dataflow,
including a live delta after the initial run.
Encoding at the dataflow boundary (timely 0.13’s exchange bound is serde
Serialize + Deserialize plus Ord + Hash for keys; a Coordinate’s
BTreeMap and a raw f64 are encoded rather than used directly):
- DD key = the coordinate as a sorted
Vec<(u32, u32)>(category, item). Deterministic andOrd + Hash. - cell value =
CellValue: a number asf64::to_bits()(so it isEq + Hash), or a boolean, text, date (epoch ms) or error. - diff
Rstaysisizemultiplicity; areducecollapses to one value/key.
core_model types convert to/from these encodings at the edge.
Modules§
- builtins
- Evaluation of the scalar built-in functions in
[
improv_core_model::functions::all]: one value per argument in, one value out. The dataflow maps this over aligned cells and the scalar evaluator calls it directly, so both give bit-identical results. - compiler
- The formula compiler:
core_model::Formula->TypedExpr->PlanNode. - dataflow
- Build a differential-dataflow graph from compiled
PlanNodes and run a wholeModelto a set of computed derived-measure values. - external
- Host-side evaluation of external-function measures (Phase 6).
- plan
- The operator plan: a lowered, dimension-explicit representation of a formula that maps directly onto differential-dataflow operators.
- reduce
- The reductions: what an aggregation (
SUM(x OVER T),CORREL(x, y OVER T),NPV(rate, cf OVER T)) computes from one group’s rows. - scalar
- A pure scalar evaluator: one formula, one value per input, no dimensions.
- session
- Live incremental edit API.
- typed
- Typed expression layer: the formula AST enriched with inferred value type and dimension (the set of categories a subexpression ranges over).
Enums§
- Cell
Value - The dataflow encoding of a cell value.
Functions§
- decode_
coord - Decode a dataflow key back into a
Coordinate. - display_
number - A number as people read it: at most 15 significant digits, the precision
an
f64always carries through decimal, so binary noise like58.650000000000006(from1173 * 0.05) shows as58.65. The value itself is untouched; exports (CSV, SQL, Postgres) keep every bit. - encode_
coord - Encode a
Coordinateas its dataflow key (BTreeMap already iterates sorted). - project_
key - Project a coord key down to a subset of category ids (join key / broadcast).
Exactly the pairs whose category is kept, in order (proven in
improv_verified::keys::project).
Type Aliases§
- Coord
Key - The dataflow encoding of a coordinate: sorted
(category_id, item_id)pairs.