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
find_model_output_ports (src/simlin-engine/src/db/ltm/loops.rs ~line 107) returns its output-port set via output_ports.into_iter().collect() -- an unordered HashSet drain. enumerate_pathways_to_outputs iterates these ports and extends per-input-port pathway lists in that order; the composite fold keeps the earlier pathway on a magnitude tie (generate_max_abs_selection), and the $⁚ltm⁚path⁚{port}⁚{index} synthetic-var indices follow this same order.
For a module that has multiple output ports and tied pathway scores, both the selected winner and the path-var indices are therefore process-dependent (Rust's HashSet randomizes iteration order per process via DefaultHasher).
Why it matters
salsa cache values should be byte-stable across processes. Any downstream consumer that keys on the selected pathway or on $⁚ltm⁚path⁚{port}⁚{index} synthetic-var names (model snapshots, persisted UI state, deterministic tests, cached salsa outputs) sees flapping results for multi-output-port modules with tied pathway scores. This is harmless for single-output stdlib modules (the common case), which is why it has gone unnoticed, but it is a latent determinism gap.
This is a distinct code site from #497 (closed), which fixed sibling-cycle ID nondeterminism in assign_loop_ids (ltm.rs). #497 does not touch find_model_output_ports / the multi-output-port pathway-enumeration path in db/ltm/loops.rs.
Activity
engine: select per-exit-port pathway for module loop link scores
engine: pin sorted multi-output-port discovery for LTM pathways
engine: strengthen #680 sort test to 6 output ports