Skip to content

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

Closed

Description

@bpowers

Summary

An I1-DECLINED multi-source whole-RHS reducer with an arrayed owner whose dims are a strict SUBSET of the source's dims falls through try_cross_dimensional_link_scores (src/simlin-engine/src/db/ltm/link_scores.rs) to the legacy CARTESIAN partial-reduce derivation, emitting silently wrong per-(row, slot) link scores -- including confident +1.0 constants for source rows the equation NEVER reads.

Shape:

Region = {nyc, boston}, D2 = {p, q}
pop[Region, D2]                          -- source (fed by a stock)
w[D2]                                    -- co-source
share[Region] = SUM(pop[nyc,*] * w[*])   -- mismatched co-source slices: [Pinned, Reduced] vs [Reduced]
inflow[Region] = share[Region] * 0.01    -- closes the loop back into pop

accept_source_slices declines the mismatched co-source slices, so NO variable-backed AggNode is minted (I1-declined). But the legacy cartesian branch's result_axis_names containment check passes (Region is a subset of {Region, D2}), so instead of the loud co-source degradation the design's boundary (c) promises for I1-declined feeders, the edge takes the cartesian partial-reduce derivation.

Empirically verified behavior (repro fixture at commit 0fcfba58, branch ltm-phase1-residuals; PRE-EXISTING)

  1. Silent wrong LINK scores. Diagonal per-(row, slot) link scores are emitted for EVERY source row including UNREAD rows: $:ltm:link_score:pop[boston,p]->share[boston] exists and reads a constant confident +1.0, although share[boston] = SUM(pop[nyc,*]*w[*]) never reads pop[boston,*]. The read rows are also wrong: pop[nyc,p]->share[nyc] reads 1.0 where the true SUM contribution share is 0.5 (two equal rows) -- the un-pinnable mismatched-arity body (w[*]) dooms the changed-first partial to the delta-ratio fallback (|dz/dz| = 1). Zero warnings on this surface.
  2. Only the LOOP surface degrades loudly. 5 Assembly warnings; $:ltm:loop_score:u1..u5 fail fragment compile because the conservative cross-product element edges create circuits referencing off-diagonal names like pop[boston,p]->share[nyc] that the cartesian derivation never emits, so those loops are warned 0-stubs.

So the loop surface is the (wrong-mode but loud) degradation, while the link-score surface carries unwarned wrong numbers -- violating epic #488's standing "no silent wrong numbers" invariant.

Why it matters

Severity: medium. This is the pre-T3 "cartesian garbage" class (cf. the #765 / #777 history) SURVIVING for the no-agg multi-source family. #765's fix corrected the slice derivation for agg-backed edges, and T3's gate routes the no-Iterated-axis shapes to the #758 loud skip (#777) -- but when the arrayed owner's dims happen to be a subset of the source's dims, the I1-declined multi-source shape slips past both and lands on the legacy cartesian branch, producing confident constants on unread rows with no warning.

Components affected

  • src/simlin-engine/src/db/ltm/link_scores.rs -- try_cross_dimensional_link_scores: the legacy cartesian partial-reduce branch's result_axis_names containment check admits I1-declined no-agg multi-source edges
  • src/simlin-engine/src/ltm_agg.rs -- accept_source_slices (the I1 decline that leaves the edge agg-less)

Suggested direction

The cartesian partial-reduce branch should DECLINE (loud skip via unscoreable_edges, per the #758/#780 contract) when classify_reducer's body references arrayed deps that are not resolvable per-row, or more generally when no agg backs the edge and the body is not the bare source -- or at minimum, gate the cartesian derivation on a variable-backed agg existing for the edge.

Related

Discovery context

Empirically confirmed during the adversarial review of commit 0fcfba58 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