Skip to content

ltm: docs still say a bare reducer argument in a slot is declined #1041

Closed

Description

@bpowers

LTM now scores a bare reducer argument in a per-element equation as the row it reads (#1087): with m[d1, d2], slot[a] = SUM(m) * 0.001 is scored exactly like SUM(m[a, *]) * 0.001.
What is left is follow-through.

  1. Docs and comments still describe the old behavior, declining the edge with a warning:
    • docs/design/ltm--loops-that-matter.md, "Two executed reads are declined rather than described" (calls this "the tracked follow-up")
    • src/simlin-engine/src/ltm_agg.rs, comments near lines 1066, 2870 and 2900
    • src/simlin-engine/CLAUDE.md, the LTM "No silent wrong numbers" rule, which cites the scoring test as evidence of a decline
  2. Slots with different reducers and bare arguments (slot[a] = SUM(m), slot[b] = MEAN(m)) have no loop-score test.
    The only mixed-reducer test (per_element_arrayed_target_mints_one_agg_per_element_reducer in ltm_agg_tests.rs) uses explicit [*] and checks only that the helper nodes are created.

Fix

Rewrite the stale text to describe current behavior, check whether the bare-argument decline in unhoisted_reducer_source_read can still fire (delete it if not), and add the mixed-reducer row beside the existing scoring tests.

Pointers

  • src/simlin-engine/src/compiler/fragment.rs: FragmentInput::elementwise_target
  • src/simlin-engine/src/ltm_elementwise_tests.rs: a_slots_bare_reducer_argument_is_scored_as_the_row_it_reads
  • src/simlin-engine/src/ltm_agg.rs: unhoisted_reducer_source_read, reducer_reads_source_bare

Activity

  1. added
    enhancement
    engine
    ltm
    on Sep 3, 2026
  2. changed the title [-]ltm: bare reducer argument in a per-element (Ast::Arrayed) slot is declined loudly -- spell the slot's pinned element so the hoisted node is per slot[/-] [+]ltm: bare reducer argument in a per-element equation is not scored[/+] on Oct 12, 2026
  3. changed the title [-]ltm: bare reducer argument in a per-element equation is not scored[/-] [+]ltm: docs still say a bare reducer argument in a slot is declined[/+] on Oct 12, 2026
  4. bpowers commented on Oct 12, 2026

    @bpowers
    OwnerAuthor

    Closing: fixed on main by #1087. 12b1df5 corrects the docs and comments and adds slots_with_different_reducers_of_a_bare_argument_are_scored_as_their_rows. The old decline stays: it can still be reached when a slot's lowered equation is unavailable (for example another element of the same variable reads an undeclared name); that was established by reading the code, not by a test.

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

    engineenhancementltm

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions