Skip to content

ltm: per-element-equation (Ast::Arrayed) owner with strict-slice multi-source reducer gets a silent near-zero Bare A2A link-score stand-in #792

Closed

Description

@bpowers

Summary

A PER-ELEMENT-EQUATION owner (Equation::Arrayed, one equation per slot) whose slots hold an I1-declined strict-slice multi-source reducer never reaches try_cross_dimensional_link_scores' cartesian arm. Instead the edge falls through to emit_per_shape_link_scores with shape Bare, which emits ONE arrayed link score whose simulated value is ~-0.0 at every step -- a silent near-zero stand-in for an edge the equation genuinely depends on, with no per-edge warning.

This is the per-element spelling of the GH #791 shape. Neither the pre-791 cartesian garbage nor the new #791 strict-slice loud skip applies here: the gate's Ast::Arrayed => NotDescribable arm in ltm_agg::unhoisted_reducer_source_read is unobservable for this shape because the edge never gets that far.

Fixture (verified empirically 2026-06-12 at commit c1a16df4, branch ltm-phase1-residuals; PRE-EXISTING -- the per-element path is untouched by that commit)

Region = {nyc, boston}, D2 = {p, q}
pop[Region, D2]                          -- source (fed by a stock)
w[D2]                                    -- co-source
share[Region]                            -- Equation::Arrayed, EACH slot:
  share[nyc]    = SUM(pop[nyc,*]    * w[*])
  share[boston] = SUM(pop[boston,*] * w[*])
inflow[Region] = share[Region] * 0.01    -- closes the loop back into pop

(TestProject fixture array_with_ranges_direct shape; sim 0..8, dt 1.)

Observed behavior

  1. One arrayed $:ltm:link_score:pop->share (2 slots) is emitted via the Bare per-shape path; its simulated value is -0.0 at every step, although share genuinely depends on pop.
  2. Only ONE warning surfaces -- a single loop-score fragment-compile failure ($:ltm:loop_score:u5). The other enumerated loops compile and consume the silent ~0 link score, so their loop scores are unwarned wrong (near-zero) numbers.

This violates epic #488's standing "no silent wrong numbers" invariant: a near-zero stand-in score with no per-edge warning.

Why it matters

Severity: medium. The MDL importer expands single apply-to-all Vensim equations into N identical per-element equations (#651), so this spelling is exactly what real Vensim imports produce -- the per-element variant is arguably MORE reachable from imported models than the A2A spelling #791 fixed.

Components affected

  • src/simlin-engine/src/db/ltm/link_scores.rs -- try_cross_dimensional_link_scores (per-element owners never reach the cartesian/strict-slice arm) and emit_per_shape_link_scores (the Bare fallthrough that mints the near-zero stand-in)
  • src/simlin-engine/src/ltm_agg.rs -- unhoisted_reducer_source_read's Ast::Arrayed => NotDescribable arm is dead for this shape; the strict-slice decline logic needs a per-element-aware entry point

Suggested direction

Route the per-element-equation owner spelling to the same loud-skip contract #791's fix applies to the A2A spelling: detect the un-hoisted strict-slice multi-source reducer in Equation::Arrayed slots and decline via unscoreable_edges (warning + dependent loop drop per the #758/#780 contract), instead of letting the edge fall to the Bare per-shape stand-in. Longer term, per-slot pinned slices are statically describable (each slot pins its row), so a per-element hoist may be able to score this shape exactly.

Related

Discovery context

Empirically confirmed during the adversarial review of commit c1a16df4 (the GH #791 strict-slice cartesian decline) on branch ltm-phase1-residuals; pre-existing, not introduced by that commit.

Activity

  1. added
    ltm
    on Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ltm

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions