Skip to content

ltm: un-hoisted multi-source iterated-dim-feeder reducer emits silent garbage arrayed loop score (combined_read_slice slice-disagreement carve-out) #743

Closed

Description

@bpowers

Summary

An apply-to-all (A2A) equation whose RHS embeds a multi-source reducer whose per-row feeder is arrayed over the iterated dimension is declined for aggregate-node hoisting by combined_read_slice (src/simlin-engine/src/ltm_agg.rs), falls back to the conservative (un-hoisted) path, and the resulting arrayed loop score variable is silent garbage -- approximately -250 at every step for a trivially reinforcing feedback loop. Not zero (a recognizable "unscored" sentinel), but an actively wrong, plausible-looking number.

Fixture shape

D1 = {r1, r2}, D2 = {c1, c2}
matrix[D1, D2]                          -- arrayed dep
frac[D1]                                -- per-row feeder, arrayed over the iterated dim
growth[D1] = SUM(matrix[D1, *] * frac[D1])   -- A2A over D1, reducer embedded as a sub-expression
... a feedback loop closed through (matrix or frac) and growth, trivially reinforcing

With LTM enabled the model compiles and simulates, the arrayed loop is enumerated (loop id u1), but its loop score reads ~-250 at every step. Verified identical at commit 1dcf899f and its parent -- pre-existing on main, not a regression of the ltm-core-batch work.

Mechanism

  1. combined_read_slice (src/simlin-engine/src/ltm_agg.rs, ~line 892) folds each arrayed source reference's compute_read_slice and requires them all to agree. Here matrix[D1,*] reads [Iterated(D1), Reduced] while frac[D1] reads [Iterated(D1)] -- incompatible slices, so it returns None (the documented multi-source-disagreement carve-out, see the function's doc comment: "a multi-source reducer whose references read incompatible slices").
  2. No synthetic $⁚ltm⁚agg⁚{n} node is minted; the reducer references stay on the conservative (un-hoisted) path.
  3. Whatever the conservative path emits for these references (src/simlin-engine/src/db/ltm/link_scores.rs) feeds a partial equation built by src/simlin-engine/src/ltm_augment.rs whose magnitude is garbage -- the constant ~-250 per step. The exact partial-equation defect producing that magnitude has not been root-caused; that is part of this issue's scope.

Why it matters

Medium. This is the silent-garbage class #737 was about, but for the arrayed-feeder / un-hoisted case: a legal, not-exotic model shape (per-row total = SUM(row * per-row coefficient), e.g. weighted row sums with per-region weights) where LTM produces a confidently wrong arrayed loop score with no diagnostic. Unlike #534's conservative fallback (correct-but-imprecise over-approximation), the fallback here is actively wrong, and unlike #737's silent zero (at least recognizable as degenerate), this is a non-zero garbage value a user could mistake for a real dominance signal.

Components affected

  • src/simlin-engine/src/ltm_agg.rs -- combined_read_slice (the multi-source slice-disagreement carve-out that declines the hoist) and collect_arrayed_source_slices
  • src/simlin-engine/src/db/ltm/link_scores.rs -- what gets emitted for the un-hoisted conservative path for these reference sites
  • src/simlin-engine/src/ltm_augment.rs -- the partial-equation builder producing the garbage magnitude

Possible approaches

Discovery context

Demonstrated by a reviewer during adversarial review on branch ltm-core-batch (out of scope for that batch). Verified identical at 1dcf899f and its parent.

Tracking

Part of LTM tracking epic #488 and the array-support umbrella #273. Related but distinct: #737 (the scalar-feeder sibling -- hoisted agg, loop-builder never routes through it, silent zero; fixed on branch ltm-core-batch), #738 (scalar-target agg fragment fails to compile, stubbed to 0 with a warning), #534 (the mapped-dimension hoisting carve-out in compute_read_slice -- different decline reason, and its conservative fallback is correct-but-imprecise rather than garbage), #514 (the Phase-4 sliced-reducer hoisting work that introduced the carve-out list).

Activity

  1. added
    ltm
    on Jun 10, 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