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: pins on a model with no stocks are dropped without a warning #772
On a model with no state (no stocks, no PREVIOUS, no stateful modules), LTM returns early before it validates pinned loops.
A pin on such a model, including a misspelled one, is dropped without the usual invalid-pin warning.
It should get a warning saying pins are ignored because the model has no state.
Example
A model with only auxiliaries, plus a pinned loop over {a, b}: no LTM output and no diagnostic.
The same pin on a model with one stock gets "contains no stock" or "do not form a closed feedback loop" as appropriate.
Why it matters
Low severity and uncommon: a model with no stocks has no feedback loops to pin (an instantaneous cycle is a compile error), so the only realistic case is a model whose stocks were deleted after a loop was pinned.
The pin then silently does nothing.
A second case, a loop whose only state is a PREVIOUS inside a sub-model, is reported in the loop list but never scored; that is #773, and fixing it there makes the model count as having state.
An instantaneous cycle through a module with no stock does not compile (pinned_loop_through_stockless_passthrough_rejected), so it is not a case here.
Fix
In the stateless early return of model_ltm_variables, emit one warning per pinned loop ("ignored: the model has no stocks or other state").
Alternative: let pin validation run before the early return, so pins get the same messages as on any other model.
Pointers
src/simlin-engine/src/db/ltm/mod.rs: the model_is_stateless early return in model_ltm_variables
changed the title [-]ltm: model_detected_loops has no stateless gate -- stateless-but-cyclic shapes report unscoreable loops and silently drop pins[/-][+]ltm: pins on a model with no stocks are dropped without a warning[/+]on Oct 12, 2026
Activity
[-]ltm: model_detected_loops has no stateless gate -- stateless-but-cyclic shapes report unscoreable loops and silently drop pins[/-][+]ltm: pins on a model with no stocks are dropped without a warning[/+]