Expand description
The typed extension registry: how generators, modifiers, and planners are declared, discovered, and turned into runnable operators.
Everything a value operator does is split across two lifetimes:
- Factories (
GeneratorFactory,ModifierFactory,PlannerFactory) are the static half. Each carries a&'staticdescriptor that advertises itskind, aliases, acceptedSqlTypeFamilyvalues, ownership/read declarations, and determinism/buffering/verification capabilities. A factory validates a config once andcompiles it into a runtime operator. - Compiled operators (
CompiledGenerator,CompiledModifier,CompiledPlanner) are the hot half. They run once per row (or per plan) and are deliberately allocation-lean: a generator overwrites a caller-ownedGeneratedValuerather than returning a fresh one.
ExtensionRegistry owns three [Catalog]s (one per operator role).
Each catalog keeps a BTreeMap of primary kinds — so discovery order is
deterministic regardless of registration order — plus a second map from
alias to primary kind. Registration keeps the two namespaces disjoint:
a primary kind may not be registered twice, and an alias may neither
shadow a primary kind nor duplicate another alias.
Structs§
- Argument
Spec - A single named argument a factory reads out of its config.
- Compile
Context - Everything a factory needs to
compilea config into a runtime operator: the table and (for column-scoped operators) the column being compiled, the run’sSeedRoot, and the config’s YAML path for diagnostics. - Extension
Registry - The registry of all generator, modifier, and planner factories available
to a compilation. Build an empty one with
ExtensionRegistry::newor the phase’s built-in set withExtensionRegistry::standard. - Family
SumCheck - A cross-table sum invariant: over the child rows of the
CompiledPlanner::family_child_tablethat reference a given parent row, the integer value ofchild_columnsums exactly to the integer value of the parent’sparent_column. Money columns are compared in currency minor units, so a verifier normalizes decimal/text renderings to the same fixed scale before summing. - Generator
Descriptor - Static description of a registered generator.
- Modifier
Descriptor - Static description of a registered modifier. Mirrors
GeneratorDescriptor, butacceptslists the families the modifier can transform rather than populate. - Plan
Context - Context handed to a compiled planner. Planners run once per table before any row is generated, so they see the whole table and the run seed.
- Planner
Descriptor - Static description of a registered planner. Planners operate at table
scope rather than on a single column’s type, so there is no
acceptsfamily list;writes/readsdescribe the columns the planner coordinates. - RowContext
- Per-row context handed to a compiled generator or modifier.
Enums§
- Buffering
- Whether an operator can stream row-by-row or must buffer rows first.
- Column
Scope - Which columns an operator reads from or writes to, declared statically so the compiler can reason about ownership before a single row is generated.
- Determinism
- Whether an operator’s output is reproducible from its seed alone.
- KeyRecipe
- How a generator materializes as a random-access key domain when its column
is a primary key referenced by a child foreign key. Context-free: the engine
supplies the parent table/column/seed. A generator that is not a
reproducible random-access key returns
NonefromCompiledGenerator::key_recipe. - Planner
Predicate - A machine-checkable invariant a planner guarantees over the columns it owns.
- Predicate
Guard - A row-level condition selecting which rows a
PlannerPredicateapplies to. - Verification
- Whether an operator can verify its own output against the model’s expectations (uniqueness, referential integrity, value distributions).
Constants§
- INHERENT_
UNIQUENESS_ ENTROPY_ BITS - The minimum output entropy (in bits) at which a random-string generator is
treated as unique by construction. Below ~1e-9 birthday-collision
probability for tables up to ten billion rows — far past any table a
uniquetracking budget could hold — so tracking such a column is pointless and only imposes themax_trackedceiling.
Traits§
- Compiled
Generator - A compiled generator: produces one value per row into a caller-owned slot.
- Compiled
Modifier - A compiled modifier: transforms a value in place after generation.
- Compiled
Planner - A compiled planner: coordinates several columns of a table together.
- Generator
Factory - Compiles a
GeneratorConfiginto a runnable generator. - Modifier
Factory - Compiles a
ModifierConfiginto a runnable modifier. - Planner
Factory - Compiles a
PlannerConfiginto a runnable planner. - RowView
- Read access to the other columns of the row currently being generated.