Skip to content

ltm: strict-slice reducer read silently unattributed when a sibling hoisted reducer routes the edge through its agg #793

Closed

Description

@bpowers

Summary

In emit_link_scores_for_edge (src/simlin-engine/src/db/ltm/link_scores.rs, ~line 2893 at commit c1a16df4), when ANY synthetic agg of to reads from, routed_aggs is non-empty and the (from, to) edge is scored EXCLUSIVELY via the agg halves ({from}->$⁚ltm⁚agg⁚{n} and $⁚ltm⁚agg⁚{n}->{to}). try_cross_dimensional_link_scores -- and therefore the GH #791 strict-slice gate added by c1a16df4 -- is never consulted for that edge.

So when the same equation contains a SECOND, I1-DECLINED strict-slice reducer read of the same source, that read contributes to the target's value but gets NO link-score attribution and NO warning. The agg halves are correct for the hoisted reducer ALONE; the strict-slice read's contribution is silently missing from the edge's total attribution.

Empirical repro (verified 2026-06-12 at c1a16df4, branch ltm-phase1-residuals)

Region = {nyc, boston}, D2 = {p, q}
pop[Region, D2] = stock[Region] * 0.1
w[D2] = 0.5
share[Region] = SUM(pop[nyc, *] * w[*]) + SUM(pop[*, *])
inflow[Region] = share * 0.05
stock integrates inflow

Observed:

  • ZERO Assembly warnings.
  • The only pop -> share scores are the agg halves: pop[r,d] -> $⁚ltm⁚agg⁚0 = 0.25 and $⁚ltm⁚agg⁚0 -> share[e] = 0.8 -- both correct for the second reducer ALONE. The missing 0.2 of share's change (the strict-slice read's contribution) is attributed to nothing.
  • 8 loop scores (r1-r8) are emitted from this partial attribution, so downstream loop dominance is computed from incomplete numbers with no signal.

Why it matters

Severity: medium. Same "silent wrong/incomplete number for a strict-slice read" class as GH #791, surviving on the agg-routed leg -- it violates epic #488's standing no-silent-wrong-numbers invariant (an unattributed contribution is indistinguishable from a complete attribution on every surface).

Root cause

The reference-site IR's per-site routing criterion is too coarse: route_through_agg = (any agg of toreadsfrom) && in_reducer (src/simlin-engine/src/db/ltm_ir.rs). The site INSIDE the DECLINED reducer is routed through the OTHER reducer's agg, because the criterion keys on the (from, to) pair plus "inside some reducer", not on WHICH reducer the site sits in / whether that reducer was actually hoisted.

Possible approaches

Components affected

  • src/simlin-engine/src/db/ltm_ir.rs -- per-site routing criterion (route_through_agg)
  • src/simlin-engine/src/db/ltm/link_scores.rs -- emit_link_scores_for_edge (~line 2893): the routed_aggs-non-empty branch scores the edge exclusively via agg halves

Related

Discovery context

Discovered during the adversarial review of commit c1a16df4 (gh791 strict-slice cartesian decline) on branch ltm-phase1-residuals. PRE-EXISTING: the routing logic is untouched by that commit.

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