Skip to content

ltm: arrayed-owner Pinned/subset broadcast reduce slice loud-skipped; needs the PerElement broadcast rule on variable-backed owners #777

Closed

Description

@bpowers

Summary

T3 of the LTM shape-expressiveness phase (design: docs/design-plans/2026-06-11-ltm-shape-expressiveness.md, Architecture section 6; commit 0a1f27fe on branch ltm-shape-phase1) generalized the #752 gate to variable_backed_reduce_agg, admitting scalar-result variable-backed slices (total = SUM(pop[nyc,*])) -- but scoped that admission to SCALAR owners (to_dims.is_empty()). The ARRAYED-owner sibling is DECLINED into the #758-style loud skip and remains a design-mandated residual:

share[Region] = SUM(pop[nyc,*])

i.e. a whole-RHS variable-backed reducer whose slice has NO Iterated axis (Pinned or subset-Reduced only) and whose OWNING variable is arrayed over dims unrelated to the slice. The same applies to the subset twin:

share[Region] = SUM(arr[*:Sub])

Current behavior (post-T3, the loud skip)

Both the gate and try_cross_dimensional_link_scores' partial-reduce branch decline the shape; the edge routes to the #758 loud skip: one Warning via emit_unscoreable_broadcast_reduce_edge_warning (src/simlin-engine/src/db/ltm/link_scores.rs), no link-score variables, and every loop through the edge is dropped from LTM analysis.

This replaced the PRE-T3 state, which was silently wrong (recorded during T3's RED run): the unread rows (pop[boston,*] -> share[boston]) scored constant +1.0 although share[boston] = SUM(pop[nyc,*]) never reads them, while the TRUE dependency (pop[nyc,*] -> share[boston]) had NO score at all. Pinned by arrayed_owner_broadcast_pinned_slice_reduce_skips_loudly in src/simlin-engine/tests/integration/ltm_array_agg.rs (loud skip, no garbage, no phantom names).

Proper fix

The design's section 3 PerElement broadcast rule -- per-(row, full-target-element) emission -- applied to variable-backed owners: every target slot reads the same Pinned/subset slice, so emit the read rows fanned out across the target's full element set, with matching per-(row, slot) link scores. This is T6-style machinery that the design deliberately kept out of T3 ("specifiable later, but it is T6 machinery and does not belong in T3"). The fix should cover BOTH the Pinned shape (SUM(pop[nyc,*])) and the subset twin (SUM(arr[*:Sub])).

Why it matters

Severity: low. Legal but uncommon shape; the degradation is loud and conservative (no wrong numbers -- strictly better than the silent pre-T3 garbage), but each occurrence drops every loop through the edge.

Components affected

  • src/simlin-engine/src/ltm_agg.rs -- variable_backed_reduce_agg gate's to_dims.is_empty() scoping
  • src/simlin-engine/src/db/ltm/link_scores.rs -- try_cross_dimensional_link_scores partial-reduce branch decline; emit_unscoreable_broadcast_reduce_edge_warning

Related

Discovery context

Design-mandated residual recorded during T3 of the LTM shape-expressiveness phase on branch ltm-shape-phase1 (commit 0a1f27fe); the design doc explicitly defers it and requires filing if it survives the phase.

Activity

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