You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ltm: pinned loop silently scores one of two loops over the same variables #674
A pinned loop is stored as a set of variables, and the engine picks the cycle to score itself: the first one in alphabetical order.
When one set of variables forms two different directed loops, the pin silently scores whichever comes first, and the user cannot choose the other direction.
Example
In the three-party arms race (test/arms_race_3party/arms_race.stmx), the loop A -> B -> C -> A and the loop A -> C -> B -> A (each through the parties' arms, targets, and change flows) pass through the same nine variables.
Pinning those variables always scores the alphabetically first direction, with no warning that a second loop exists.
In exhaustive mode both directions are also found and scored as ordinary loops, so the problem shows in discovery mode or when the user wanted the other direction.
Why it matters
The arms race is a textbook LTM example, but pins over such a set are rare.
The real problem is that the result is silent: a confidently reported score for a loop the user may not have meant.
Fix
Recommended: honor the order the user gave.
The pin's variable ids are already stored as an ordered list in the file (LoopMetadata.uids, the <simlin:loop-metadata> extension), but sync sorts and deduplicates them.
If that order forms a cycle, score that cycle; otherwise fall back to the current search.
Cheaper alternative: keep the current behavior and emit a warning when the set has more than one directed cycle, naming the direction that was scored.
Pointers
src/simlin-engine/src/db/input.rs (PinnedLoopSpec, where the order is dropped)
changed the title [-]ltm: pinned loops cannot express both directed cycles over a shared variable set[/-][+]ltm: pinned loop silently scores one of two loops over the same variables[/+]on Oct 12, 2026
Activity
ltm: core-algorithm batch of root-caused fixes from epic #488 (#761)
[-]ltm: pinned loops cannot express both directed cycles over a shared variable set[/-][+]ltm: pinned loop silently scores one of two loops over the same variables[/+]