refactor(aura-core): own FieldSpec.name to drop the derive_signature heap leak
FieldSpec.name was &'static str, forcing derive_signature to Box::leak every re-exported composite OutField name. Because compile_with_params reruns derive_signature per sweep point, an N-point sweep over an M-output-field composite leaked N×M boundary names unbounded — a scaling wall the moment the World/sweep layer compiles families per point. Pull FieldSpec.name to String, mirroring the already-owned PortSpec.name and ParamSpec.name: a composite re-exports interior fields under runtime boundary names, so ownership is the correct model, not a workaround. FieldSpec loses Copy; the only fallout is one borrow at the render site. leak_name/Box::leak deleted. Behaviour-preserving: signature contents unchanged, all 231 tests green.
This commit is contained in:
@@ -33,8 +33,9 @@ pub enum Firing {
|
||||
/// window = its `length`). The `name` is a **non-load-bearing** debug symbol (C23):
|
||||
/// identity is the positional slot, the name is for tracing / graph rendering
|
||||
/// (#13), never read by bootstrap or the run loop (which wire by index). A
|
||||
/// `String`, not `&'static str` like `FieldSpec.name`: a variadic node generates
|
||||
/// per-slot names (`term[0]`), exactly as `ParamSpec.name` does (`weights[0]`).
|
||||
/// `String` (as `FieldSpec.name` and `ParamSpec.name` are): a variadic node
|
||||
/// generates per-slot names (`term[0]`), needing ownership, exactly as
|
||||
/// `ParamSpec.name` does (`weights[0]`).
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct PortSpec {
|
||||
pub kind: ScalarKind,
|
||||
@@ -45,10 +46,13 @@ pub struct PortSpec {
|
||||
/// One declared output column of a node's record: its name (metadata for sinks /
|
||||
/// the playground, C18) and its scalar kind. The position of a `FieldSpec` in
|
||||
/// `NodeSchema.output` is what an `Edge` binds (`Edge::from_field`); the name is
|
||||
/// not load-bearing for wiring.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
/// not load-bearing for wiring. The `name` is a `String` (not `Copy`): a composite
|
||||
/// re-exports an interior field under a runtime boundary name (`OutField.name`,
|
||||
/// derived in `derive_signature`), so ownership is required — the same reason
|
||||
/// `PortSpec.name` and `ParamSpec.name` are owned.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct FieldSpec {
|
||||
pub name: &'static str,
|
||||
pub name: String,
|
||||
pub kind: ScalarKind,
|
||||
}
|
||||
|
||||
@@ -56,8 +60,8 @@ pub struct FieldSpec {
|
||||
/// kind. The name is a **non-load-bearing** debug symbol (path-qualified at
|
||||
/// aggregation, as `FieldSpec.name` already is); a param's identity is its
|
||||
/// positional slot in the blueprint's aggregated param-space (C23 — by index, not
|
||||
/// by name). Unlike `FieldSpec.name` (`&'static str`), the name is a `String`: a
|
||||
/// vector knob carries a runtime index (`weights[0]`) and aggregation prefixes the
|
||||
/// by name). The name is a `String` (as `FieldSpec.name` and `PortSpec.name` are):
|
||||
/// a vector knob carries a runtime index (`weights[0]`) and aggregation prefixes the
|
||||
/// composite path (`strategy.weights[0]`). Permitted kinds: `I64`/`F64`/`Bool`;
|
||||
/// `Timestamp` is a structural axis (C20), never a numeric knob.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
|
||||
Reference in New Issue
Block a user