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-finding: multiply_score_series/max_abs_score_series silently truncate to the shorter operand #678
Two link-score series combinators in src/simlin-engine/src/ltm_finding.rs silently truncate to the shorter of their two operands:
multiply_score_series (~line 888): let n = a.len().min(b.len());
max_abs_score_series (~line 906): let n = a.len().min(b.len());
Both helpers compose two per-timestep link-score series (e.g. when collapsing a synthetic chain into a composite). If the two series ever differ in length, len().min(...) silently shortens the composite to the shorter operand with no diagnostic, which would corrupt downstream timestep alignment (the composite would no longer span step_count, and any consumer indexing by timestep would read misaligned or missing values).
Why it matters
This is a latent robustness gap. Today both inputs always span step_count, so the mismatch path is unreachable and the truncation is a no-op. But the silent min means that if a future change ever produces mismatched-length series (a real possibility as the synthetic-chain / aggregate machinery evolves), the failure would be a quiet numeric corruption of composite link scores rather than a loud crash -- exactly the kind of bug LTM correctness work has repeatedly had to hunt down after the fact.
Add a debug_assert_eq!(a.len(), b.len()) in both helpers so a length mismatch fails loudly in debug/test builds while production keeps the defensive min.
Or return None / propagate an explicit error on mismatch rather than silently truncating.
Severity
Minor -- currently unreachable; latent robustness / fail-loud gap.
Context
Identified during a 2026-06-02 LTM design review. Tracking epic: #488.
Activity
engine: fail loudly on mismatched LTM score-series lengths