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: some --ltm output prints in a different order each run #1036
With --ltm, some output still comes out in a different order from one process to the next for the same binary and model.
The set of lines is stable; only the order moves.
It should be a function of the model.
The largest source is fixed: the causal-edge map LTM walks to emit link-score warnings is now a BTreeMap (#1071), so C-LEARN's 25 warnings, where this was first seen, should now print in a fixed order (not re-checked).
Two hash-ordered loops remain:
In model_ltm_variables, the loop over a module's input-port pathways iterates a HashMap, so the "unresolved pathway link" warnings of a sub-model come out in random order.
ltm_loop_report in the CLI iterates the project's models from a HashMap, so a multi-model project prints its # Loops in model '...' blocks in random order.
Why it matters
Low severity: text only, no numbers change.
But diffing --ltm output between two builds needs a sort first, and diagnostics are meant to be deterministic.
Fix
Sort at both sites: iterate the pathways' input ports in name order, and iterate models in name order in the CLI.
Add one LTM-enabled case to diagnostic_determinism_tests.rs (it has none today): a model with a sub-model that produces at least two unresolved-pathway warnings, checked across fresh databases.
Pointers
src/simlin-engine/src/db/ltm/mod.rs: for (input_port, port_pathways) in &pathways in model_ltm_variables
src/simlin-engine/src/ltm/graph.rs: ModulePathways is a HashMap
changed the title [-]ltm: --ltm warning order is process-random (model_ltm_variables iterates CausalEdgesResult.edges HashMap)[/-][+]ltm: some --ltm output prints in a different order each run[/+]on Oct 12, 2026
Activity
[-]ltm: --ltm warning order is process-random (model_ltm_variables iterates CausalEdgesResult.edges HashMap)[/-][+]ltm: some --ltm output prints in a different order each run[/+]