Repository navigation
Description
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_cycleonly follows edges between the named variables, and there is no directdriver -> smoothededge. - Pinning the instance itself fails:
SetLoopNameresolves names to datamodel variables and returnsDoesNotExist.
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_cyclesrc/simlin-engine/src/db/ltm/pinned.rs: consumer of the ordered cyclesrc/simlin-engine/src/patch.rs:apply_set_loop_namesrc/simlin-engine/src/db/sync.rs:pinned_loops_from_datamodel
Activity
[-]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[/+]