Repository navigation
Description
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
SUM(pop[*,*])hoists cleanly into$⁚ltm⁚agg⁚0, sorouted_aggsis non-empty for the(pop, share)edge.SUM(pop[nyc,*] * w[*])is I1-declined (mismatched co-source slices), the exact shape ltm: I1-declined multi-source reducer with subset-dim arrayed owner falls through to cartesian derivation (silent +1.0 link scores on unread rows) #791's strict-slice gate exists to catch -- but the gate never runs because the edge took the agg-exclusive branch.
Observed:
- ZERO Assembly warnings.
- The only
pop -> sharescores 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 ofshare'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
- Make the routing criterion site-precise: a site routes
ThroughAgg { agg }only when it lies inside the specific reducer that mintedagg; sites inside a declined reducer stayDirectand flow totry_cross_dimensional_link_scores, where the ltm: I1-declined multi-source reducer with subset-dim arrayed owner falls through to cartesian derivation (silent +1.0 link scores on unread rows) #791 strict-slice gate (loud skip viaunscoreable_edgesper the ltm: declined element-mapped sliced reducer emits a non-compiling scalar link score on the conservative path (loop scores stub to 0) #758/ltm: PartialEquationError link-score skips don't drop dependent loop scores via unscoreable_edges #780 contract) applies. - Alternatively, when
routed_aggsis non-empty but the edge has residual non-agg-routed sites, still consult the cross-dimensional/strict-slice path for those sites (or at minimum loud-skip the whole edge instead of emitting confidently partial agg halves).
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): therouted_aggs-non-empty branch scores the edge exclusively via agg halves
Related
- ltm: I1-declined multi-source reducer with subset-dim arrayed owner falls through to cartesian derivation (silent +1.0 link scores on unread rows) #791 -- the no-agg leg of the same strict-slice class, fixed by
c1a16df4; this is the surviving agg-routed sibling - ltm: declined element-mapped sliced reducer emits a non-compiling scalar link score on the conservative path (loop scores stub to 0) #758 (closed) / ltm: PartialEquationError link-score skips don't drop dependent loop scores via unscoreable_edges #780 -- the loud-skip + loop-drop contract a decline should follow
- ltm: sliced reducer sub-expressions are not hoisted into aggregate nodes (stay on the wildcard-link-score path) #514 (closed) -- the original sliced-reducer hoisting work; the I1 decline family descends from its acceptance gates
- epic: Loops that Matter (LTM) -- open work #488 -- LTM tracking epic (no-silent-wrong-numbers invariant)
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.
Activity
engine: delete the LTM occurrence fields nothing reads
engine: delete the LTM input-side round trip and the last Expr0 class…