Skip to content

ltm: variable-backed partial reducers with broadcast or permuted axes keep the conservative cross-product (loop scores stub to 0) #764

Closed

Description

@bpowers

Summary

The #752 fix gave aligned variable-backed partial reducers (inflow[D1] = SUM(matrix[D1,*]), result dims == target dims in declared order) read-slice element edges via the new ltm_agg::variable_backed_partial_reduce_agg gate. The gate deliberately requires result_dims == target dims in order, so two sibling shapes remain on the conservative cross-product with no matching per-(row, slot) link scores -- loop scores through them reference missing names, fail fragment compile (Assembly Warnings), and silently stub to constant 0.

The two residual shapes

  1. BROADCAST over extra target dims -- out[D1,D3] = SUM(matrix[D1,*]): the reducer's result axis (D1) is a strict subset of the target's dims ([D1,D3]). This is the variable-backed twin of the synthetic-agg broadcast case ltm: agg→target link score over-subscripts an arrayed synthetic agg in the broadcast case (agg[D1] feeding to[D1,D2]) #528 (fixed in PR ltm: core-algorithm batch of root-caused fixes from epic #488 #761).
  2. PERMUTED axes -- the reducer's iterated axes appear in a different order than the target's declared dims.

Both shapes keep the conservative cross-product element edges, and try_cross_dimensional_link_scores (src/simlin-engine/src/ltm_augment.rs) declines both, so NO per-(row, slot) link scores are emitted for them at all. The resulting failure mode is the same silent-zero family as #752 was for the aligned shape: loop-score fragments reference never-emitted link-score names, assemble_module drops them, and each loop score reads constant 0, visible only via fragment diagnostics.

Why it matters

Low-medium. Silent zero loop scores for legal (if less common than the aligned form) Vensim/XMILE shapes. The model compiles and simulates fine; the degradation is warned via fragment diagnostics (Assembly Warnings) but never surfaces as wrong-looking results -- it surfaces as loops that appear to not matter.

Components affected

  • src/simlin-engine/src/ltm_agg.rs -- variable_backed_partial_reduce_agg gate (requires result_dims == target dims in order) and emit_agg_routed_edges's variable-backed arm
  • src/simlin-engine/src/ltm_augment.rs -- try_cross_dimensional_link_scores declines both shapes, so no matching link-score emission exists

Possible approach

Extend the gate plus emit_agg_routed_edges's variable-backed arm with the #528-style result_dims projection (for the broadcast shape) and a permutation map (for the permuted shape), plus the matching per-(row, slot) link-score emission in try_cross_dimensional_link_scores.

Related

Discovery context

Identified during GH #752 work on branch ltm-fix-batch-2 (commit b20f4637); the implementor scoped the #752 fix to the aligned shape and explicitly deferred these two sibling shapes.

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