Skip to content

ltm: a loop across a dimension mapping is reported once per element #755

Closed as not planned

Description

@bpowers

A feedback loop that crosses a dimension mapping is reported as one scalar loop per element instead of one arrayed loop.
For stock[State] -> x[Region] -> stock[State] with a State -> Region mapping, each circuit (stock[s1] -> x[r1] -> stock[s1], ...) becomes its own loop r1, r2, ..., where a loop over a single dimension would be one loop r1 with a score per element.
The scores are correct; only the grouping differs.

Why it happens

build_element_level_loops decides whether a circuit stays on one element by comparing the first subscript element of each node by name.
s1 and r1 differ as names even though the mapping pairs them, so the circuit is treated as crossing elements.

Fix

Compare elements through the mapping (DimensionsContext::executed_read_correspondence) instead of by name.
This is the same change to the same grouping test as #658 (loops through a scalar SUM reported per element); do them together.

Pointers

Activity

  1. added
    engine
    ltm
    on Jun 10, 2026
  2. added
    enhancement
    on Oct 12, 2026
  3. changed the title [-]ltm: collapse mapped-diagonal loop families into one arrayed loop score (cross-element check defeats grouping across dimension mappings)[/-] [+]ltm: a loop across a dimension mapping is reported once per element[/+] on Oct 12, 2026
  4. added
    duplicate
    on Oct 12, 2026
  5. bpowers commented on Oct 12, 2026

    @bpowers
    OwnerAuthor

    Closing as a duplicate of #658.

    Same grouping check in build_element_level_loops as #658 needs widening; one change covers both.

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

    duplicateengineenhancementltm

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions