Repository navigation
Description
Summary
When generate_link_score_equation_for_link returns a PartialEquationError, the shaped compilation path emits the loud emit_ltm_partial_equation_warning and skips the link-score variable -- but the edge is not recorded in unscoreable_edges. Loop scores traversing the edge therefore reference the never-emitted link-score name, fail fragment compile, and degrade to warned constant-0 stubs.
Observed repro: 1 good edge warning + 21 cascading loop-score warnings, with every loop series constant 0.
Mechanism
link_score_equation_text_shaped's generator call (src/simlin-engine/src/db/ltm/compile.rs:222-225at commitfa8fa774, branchltm-shape-phase1) mapsPartialEquationErrortoemit_ltm_partial_equation_warning+return None-- the GH ltm-augment: parse fallback can silently break ceteris-paribus logic #311 loud skip.- The per-shape emission loop in
emit_per_shape_link_scores(src/simlin-engine/src/db/ltm/link_scores.rs:1346-1385) receivesunscoreable_edges: &mut HashSet<(String, String)>(it already inserts for the GH ltm: declined element-mapped sliced reducer emits a non-compiling scalar link score on the conservative path (loop scores stub to 0) #758 dim-incompatible class and the broadcast-reduce class at line ~1340/~493), but when the shaped query returnsNoneit simply doesn't push the variable -- the edge never enters the set. - The ltm: declined element-mapped sliced reducer emits a non-compiling scalar link score on the conservative path (loop scores stub to 0) #758 drop machinery (
traverses_unscoreableinsrc/simlin-engine/src/db/ltm/mod.rs~1602, consumed for detected loops ~1622-1628 and pinned loops ~1888) therefore never sees these edges; loop scores through them are emitted, fail fragment compile against the missing link-score name, andassemble_modulestubs them to constant 0 with per-loop AssemblyWarnings.
This conflicts with the standing invariant established by #758: ONE loud warning naming the edge, no link-score variable, and dependent loop scores dropped -- not warned-garbage zeros.
Reachability
PartialEquationError is reachable via:
- GH ltm-augment: parse fallback can silently break ceteris-paribus logic #311 parse failures (defense-in-depth; effectively unreachable in production today), and
- since the T7 ltm-augment: is_other_dep_iterated_dim_subscript collapse is magnitude-imprecise for a transposed non-live array dep #526 commit
fa8fa774(branchltm-shape-phase1), the new both-legs-doomed mismatched-dep class -- which makes the gap practically reachable.
The gap is pre-existing for every emit_ltm_partial_equation_warning call site (including the direct one at link_scores.rs:766); T7 only extends its reach. Note this is loud, not silent, and is a strict improvement over the pre-T7 behavior on the same model (which emitted warned-garbage ~885.0 scores into the loops), so severity is moderate (low-medium), not critical.
Why it matters
- Cascading warning noise: one root-cause edge produces N+1 warnings (1 edge + N loop scores), burying the actionable one.
- Constant-0 loop scores look like legitimate computed values to anything reading the series without checking diagnostics -- the exact "warned wrong number" shape the ltm: declined element-mapped sliced reducer emits a non-compiling scalar link score on the conservative path (loop scores stub to 0) #758 drop exists to prevent.
- Inconsistent contract: the dim-incompatible and broadcast-reduce unscoreable classes drop dependent loops; the partial-equation class does not.
Components affected
src/simlin-engine/src/db/ltm/compile.rs-- thePartialEquationError -> Noneskip (~222-225)src/simlin-engine/src/db/ltm/link_scores.rs--emit_per_shape_link_scores(~1346-1385; already threads&mut unscoreable_edges), the direct warning call site (~766)src/simlin-engine/src/db/ltm/mod.rs-- the ltm: declined element-mapped sliced reducer emits a non-compiling scalar link score on the conservative path (loop scores stub to 0) #758traverses_unscoreableconsumers (no change needed once the set is populated)
Suggested fix
Route PartialEquationError skips in the per-shape emission loop into unscoreable_edges exactly like the #758 gate: when the shaped path returns None for a partial-equation failure, insert (from, to) so dependent loop scores are dropped alongside the single edge warning. The shaped salsa query currently collapses "error" into None; the loop either needs the error signal surfaced (e.g. return an enum / check a side-channel) or to treat a None from this path as unscoreable.
Discovery context
Found by the adversarial review of T7 commits 3779f381/fa8fa774 (Phase 1 of the shape-expressiveness design, docs/design-plans/2026-06-11-ltm-shape-expressiveness.md). Part of LTM tracking epic #488. Related: #758 (the drop pattern), #311 (made the skip loud), #768 (the pathway/composite leg of the same drop gap).
Activity
engine: defend ltm feeder slot pin and agg source slices (#787)