Skip to content

ltm: loops through SMOOTH, DELAY or TREND calls cannot be pinned #747

Open

Description

@bpowers

A feedback loop that runs through a SMOOTH, DELAY or TREND call cannot be pinned.
LTM finds and scores the loop on its own, but a user cannot name it: pinning the visible variables fails, and the hidden module instance that implements the call has no name a user can give.

Example

smoothed = SMTH1(driver, 3)
driver   = 10 - 0.5 * smoothed

The causal graph is driver -> $⁚smoothed⁚0⁚smth1 -> smoothed -> driver, where the middle node is the instance the engine creates for the SMTH1 call.

  • Pinning {driver, smoothed} is rejected with "do not form a closed feedback loop in the model's causal graph": order_variable_cycle only follows edges between the named variables, and there is no direct driver -> smoothed edge.
  • Pinning the instance itself fails: SetLoopName resolves names to datamodel variables and returns DoesNotExist.

Loops through an explicit user sub-model can be pinned, because the module is an ordinary variable.

Why it matters

Loops through smoothing and delays are the standard motivating case for loop scores, and these builtins are everywhere in real models.
Pinning is how a user tracks a specific loop, and in discovery mode (large models) it is the only way to get that loop's score.
There is no workaround.

Fix

Let order_variable_cycle pass through engine-created builtin instances (names starting with $⁚) that are not in the named set, when that closes the cycle.
The pin keeps naming only user variables; the engine fills in the hidden step, the same way enumerated loops already include it.

Alternative: resolve pins against the graph after builtin expansion, so hidden nodes can be named.
That exposes engine-internal names to users, so it is worse.

Pointers

  • src/simlin-engine/src/ltm/graph.rs: CausalGraph::order_variable_cycle
  • src/simlin-engine/src/db/ltm/pinned.rs: consumer of the ordered cycle
  • src/simlin-engine/src/patch.rs: apply_set_loop_name
  • src/simlin-engine/src/db/sync.rs: pinned_loops_from_datamodel

Activity

  1. added
    ltm
    on Jun 10, 2026
  2. changed the title [-]ltm: loops through SMOOTH/DELAY/TREND builtin calls are unpinnable (synthetic module node unnameable and unbridgeable by order_variable_cycle)[/-] [+]ltm: loops through SMOOTH, DELAY or TREND calls cannot be pinned[/+] on Oct 12, 2026
  3. added
    enhancement
    on Oct 12, 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

    enhancementltm

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions