compile() re-calls dyn Node::schema() (fresh Vec alloc) at each resolve site; duplicates bootstrap's kind-derivation #25

Closed
opened 2026-06-05 14:05:45 +02:00 by Brummel · 1 comment
Owner

From the 0012 cycle-close audit (commit a4fb5d7). The inliner in crates/aura-engine/src/blueprint.rs re-calls dyn Node::schema() at each kind/field resolve site (lines ~84,87,224,273,311), each allocating a fresh NodeSchema Vec, and re-derives kind information that Harness::bootstrap already owns. This is compile-time only (the bootstrap phase, NOT the run loop), so there is no C7 hot-path cost and C1 is untouched — but it duplicates derivation logic and allocates per resolve. Low priority. Natural to revisit when the C23 optimisation passes land (they will want a cached, hashable per-node identity anyway, per the spec's forward-looking notes).

From the 0012 cycle-close audit (commit a4fb5d7). The inliner in crates/aura-engine/src/blueprint.rs re-calls `dyn Node::schema()` at each kind/field resolve site (lines ~84,87,224,273,311), each allocating a fresh NodeSchema Vec, and re-derives kind information that `Harness::bootstrap` already owns. This is compile-time only (the bootstrap phase, NOT the run loop), so there is no C7 hot-path cost and C1 is untouched — but it duplicates derivation logic and allocates per resolve. Low priority. Natural to revisit when the C23 optimisation passes land (they will want a cached, hashable per-node identity anyway, per the spec's forward-looking notes).
Brummel added the idea label 2026-06-05 14:05:45 +02:00
Author
Owner

Resolved by cycle 0024 (1b39093). Node::schema() on the built node is removed; lower_items() now gathers each primitive's signature exactly once from PrimitiveBuilder::schema() into FlatGraph.signatures (blueprint.rs:587), the resolve sites (rewrite_edge / output resolution) read that already-gathered Vec by borrow, and Harness::bootstrap consumes the carried signatures instead of re-deriving kinds. The per-resolve-site dyn-schema re-call and the bootstrap-derivation duplication this issue named no longer exist.

Resolved by cycle 0024 (1b39093). Node::schema() on the built node is removed; lower_items() now gathers each primitive's signature exactly once from PrimitiveBuilder::schema() into FlatGraph.signatures (blueprint.rs:587), the resolve sites (rewrite_edge / output resolution) read that already-gathered Vec by borrow, and Harness::bootstrap consumes the carried signatures instead of re-deriving kinds. The per-resolve-site dyn-schema re-call and the bootstrap-derivation duplication this issue named no longer exist.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Brummel/Aura#25