Param declared twice per node: factory().params() and schema().params must stay in lockstep #36

Closed
opened 2026-06-07 21:08:24 +02:00 by Brummel · 1 comment
Owner

Part of milestone "The World — parameter-space & sweep". Filed at the cycle-B (#31) audit as debt, not active drift. refs #31.

After cycle 0016, every param-bearing node declares its ParamSpecs in two places that must stay in lockstep:

  • factory() (e.g. crates/aura-std/src/sma.rs) — the param-generic recipe, read pre-build by Blueprint::param_space().
  • schema() on the built node — still reports the same slots (read post-build, e.g. by the param_space↔compile mirror tests).

The two are kept in agreement only by a per-node unit test (factory_params_match_built_node_schema in each of sma/exposure/lincomb/recorder/... ). A param added to one and not the other compiles — the drift surfaces only if the test is present and exercised for that node, and a newly-added node could omit the test entirely.

// the same declaration, twice — drift compiles
fn factory() -> LeafFactory {
    LeafFactory::new("SMA", vec![ParamSpec { name: "length".into(), kind: I64 }], /* build */)
}
fn schema(&self) -> NodeSchema {
    NodeSchema { /* ... */ params: vec![ParamSpec { name: "length".into(), kind: I64 }] }
}

Direction (none chosen): make one the single source — e.g. the built node's schema().params is derived from the factory's declared params, or a node declares its params once in a shared place both read. Closing the gap removes the per-node lockstep test and the silent-drift class.

context: not blocking — the agreement holds today and is tested per node; this is a structural duplication that wants a single source before the node roster grows. A sibling of the #34 traversal-duplication concern.

Part of milestone "The World — parameter-space & sweep". Filed at the cycle-B (#31) audit as debt, not active drift. refs #31. After cycle 0016, every param-bearing node declares its `ParamSpec`s in **two** places that must stay in lockstep: - `factory()` (e.g. `crates/aura-std/src/sma.rs`) — the param-generic recipe, read pre-build by `Blueprint::param_space()`. - `schema()` on the built node — still reports the same slots (read post-build, e.g. by the `param_space`↔compile mirror tests). The two are kept in agreement only by a per-node unit test (`factory_params_match_built_node_schema` in each of `sma`/`exposure`/`lincomb`/`recorder`/... ). A param added to one and not the other **compiles** — the drift surfaces only if the test is present and exercised for that node, and a newly-added node could omit the test entirely. ```rust // the same declaration, twice — drift compiles fn factory() -> LeafFactory { LeafFactory::new("SMA", vec![ParamSpec { name: "length".into(), kind: I64 }], /* build */) } fn schema(&self) -> NodeSchema { NodeSchema { /* ... */ params: vec![ParamSpec { name: "length".into(), kind: I64 }] } } ``` Direction (none chosen): make one the single source — e.g. the built node's `schema().params` is derived from the factory's declared `params`, or a node declares its params once in a shared place both read. Closing the gap removes the per-node lockstep test and the silent-drift class. context: not blocking — the agreement holds today and is tested per node; this is a structural duplication that wants a single source before the node roster grows. A sibling of the #34 traversal-duplication concern.
Brummel added this to the The World — parameter-space & sweep milestone 2026-06-07 21:08:24 +02:00
Brummel added the idea label 2026-06-07 21:08:24 +02:00
Author
Owner

Resolved in 1b39093 (cycle 0024): NodeSchema is now declared once on PrimitiveBuilder and the built node no longer re-declares it — the 8 per-node factory_params_match_built_node_schema lockstep tests are deleted, so the params-declared-twice drift is structurally impossible. Auto-close missed this on push (Gitea parses only the first id after a 'closes' keyword).

Resolved in 1b39093 (cycle 0024): NodeSchema is now declared once on PrimitiveBuilder and the built node no longer re-declares it — the 8 per-node factory_params_match_built_node_schema lockstep tests are deleted, so the params-declared-twice drift is structurally impossible. Auto-close missed this on push (Gitea parses only the first id after a 'closes' keyword).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Brummel/Aura#36