Collapse the duplicated fan-in alias-validity check and the triplicated per-node alias count #45

Closed
opened 2026-06-08 15:53:27 +02:00 by Brummel · 0 comments
Owner

Cycle 0021 (fan-in distinguishability, 3f4d756) introduced the structural
pre-pass check_fan_in_distinguishability ahead of the param-arity gate in
compile_with_params. The architect drift review at cycle close flagged two
correctness-neutral debt items it created.

Duplicated BadInteriorIndex raise-site

check_composite_fan_in replicates the alias-index validity check at its head
(crates/aura-engine/src/blueprint.rs:336-345) so a bogus alias surfaces as
BadInteriorIndex before the fan-in fault. Because the pre-pass recurses into
every composite before lowering, inline_composite's own alias-validity loop
(blueprint.rs:503-509) is now reached only after the pre-pass has already
raised the same fault — it is effectively dead for that error.

# verified: out_of_range_param_alias_rejected still green, raised by the pre-pass
cargo test -p aura-engine out_of_range_param_alias_rejected  # => ok

Two raise-sites for one invariant is a latent divergence hazard: a future change
to alias-index semantics must touch both or they drift.

Triplicated per-node alias count

A node's base-signature length (type initial + one per alias) is re-derived in
three places with no shared anchor:

  • signature_of base, crates/aura-engine/src/blueprint.rs:279
  • leaf_has_unaliased_param, crates/aura-engine/src/blueprint.rs:383
  • signature_base_len, crates/aura-cli/src/graph.rs:255

An alias-semantics change must touch all three in lockstep.

Direction

Collapse the alias-validity check to a single owner (the pre-pass covers every
composite lowering reaches) and fold the per-node alias-count into one shared
helper. Behaviour-preserving: the existing fan-in / alias / param_space tests
are the guard. No ledger change (the C9 refinement already landed).

Cycle 0021 (fan-in distinguishability, `3f4d756`) introduced the structural pre-pass `check_fan_in_distinguishability` ahead of the param-arity gate in `compile_with_params`. The architect drift review at cycle close flagged two correctness-neutral debt items it created. ## Duplicated `BadInteriorIndex` raise-site `check_composite_fan_in` replicates the alias-index validity check at its head (`crates/aura-engine/src/blueprint.rs:336-345`) so a bogus alias surfaces as `BadInteriorIndex` before the fan-in fault. Because the pre-pass recurses into every composite before lowering, `inline_composite`'s own alias-validity loop (`blueprint.rs:503-509`) is now reached only after the pre-pass has already raised the same fault — it is effectively dead for that error. ``` # verified: out_of_range_param_alias_rejected still green, raised by the pre-pass cargo test -p aura-engine out_of_range_param_alias_rejected # => ok ``` Two raise-sites for one invariant is a latent divergence hazard: a future change to alias-index semantics must touch both or they drift. ## Triplicated per-node alias count A node's base-signature length (type initial + one per alias) is re-derived in three places with no shared anchor: - `signature_of` base, `crates/aura-engine/src/blueprint.rs:279` - `leaf_has_unaliased_param`, `crates/aura-engine/src/blueprint.rs:383` - `signature_base_len`, `crates/aura-cli/src/graph.rs:255` An alias-semantics change must touch all three in lockstep. ## Direction Collapse the alias-validity check to a single owner (the pre-pass covers every composite lowering reaches) and fold the per-node alias-count into one shared helper. Behaviour-preserving: the existing fan-in / alias / param_space tests are the guard. No ledger change (the C9 refinement already landed).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Brummel/Aura#45