Repository navigation
Description
Summary
A degenerate square-source reducer -- x[D1] = 1 + SUM(cube[D1,D1,*] * frac[D1,D1]) with cube[D1,D1,D2] and frac[D1,D1] -- mints a synthetic agg whose result_dims == ["D1","D1"]: both axes classify Iterated with the same target dim. The LTM machinery enumerates agg slots over the full square while the executed A2A simulation reads only the diagonal, and several emission paths resolve subscript indices by FIRST-MATCH dim name -- which is ambiguous when a dim repeats in result_dims.
Commit 1461b6dc (branch ltm-shape-phase1, follow-up to merged PR #784) defended the FEEDER half: pin_iterated_dim_indices now bails on duplicate dim names, converting the score to the #743-style UnfreezablePartial loud skip (fixture: square_source_duplicate_dim_feeder_scores_are_loudly_skipped in src/simlin-engine/src/db/ltm_unified_tests.rs).
The other two halves still pin by dim name and likely share the first-match hazard on this shape:
- Co-source half (
cube -> aggrow partials viapin_body_to_row): may emit confident values pinned to the wrong slot. An adversarial review of1461b6dcis concurrently assessing whether this half emits silent wrong values post-fix -- its conclusion may refine this issue's severity. - Agg-to-target half (the ltm: agg→target link score over-subscripts an arrayed synthetic agg in the broadcast case (agg[D1] feeding to[D1,D2]) #528 projection:
positions_in_to_dims/qualified_pin_for_targetinsrc/simlin-engine/src/db/ltm/link_scores.rs): observed emitting only theagg[r1,r1] -> x[r1]diagonal form.
Why it matters
If the co-source half resolves a repeated dim by first match and emits a numerically wrong but confident link score, that violates the no-silent-wrong-numbers invariant (the loud-skip discipline from #743/#762). Even if all halves turn out merely inconsistent rather than silently wrong, the asymmetry (one half loudly skipped, the others not) makes the surface incoherent on this shape.
Components affected
src/simlin-engine/src/db/ltm/link_scores.rs--pin_body_to_row(co-source row partials),positions_in_to_dims/qualified_pin_for_target(agg-to-target projection),pin_iterated_dim_indices(feeder; already defended)enumerate_agg_nodes-- mints the squareresult_dimsagg in the first place
Fix direction
Either:
- Decline the hoist for repeated-dim
result_dimsatenumerate_agg_nodes(conservative, simplest). The executed simulation reads only the diagonal ofcube[D1,D1,*], so the square slot enumeration is structurally questionable anyway; declining routes the shape to existing fallback handling. - Generalize positional resolution (the
resolve_mismatched_index_positionpattern) across all three halves so a repeated dim name resolves by position, not first match.
Cross-reference the engine-side question of what cube[D1,D1,*] execution actually reads (the diagonal) vs LTM's square slot enumeration -- a diagonalizing canonicalization (per #778's option 1) would make all halves agree by construction.
Related
- ltm: duplicated-result-dim aggregate fans out phantom off-diagonal agg->target element edges (warned 0-stub loops) #778 -- same trigger shape (duplicated
result_dims), different mechanism: agg-to-target slot fan-out vs score-projection disagreement (loud 0-stubs). This issue is about first-match dim-name index resolution in the pinning paths, with possible silent wrong values on the co-source half. - ltm: agg→target link score over-subscripts an arrayed synthetic agg in the broadcast case (agg[D1] feeding to[D1,D2]) #528 -- the agg-to-target projection whose fix (
positions_in_to_dims/qualified_pin_for_target) is one of the suspect halves - ltm: un-hoisted multi-source iterated-dim-feeder reducer emits silent garbage arrayed loop score (combined_read_slice slice-disagreement carve-out) #743 / ltm-augment: generate_nonlinear_partial is body-blind for non-bare MIN/MAX/STDDEV reducer bodies (garbage per-row link scores) #762 -- the loud-skip (
UnfreezablePartial) discipline the feeder-half fix uses - epic: Loops that Matter (LTM) -- open work #488 -- LTM tracking epic (cluster A: read-slice / shape expressiveness)
Discovery context
Identified while fixing PR #784's automated-review P3 findings on branch ltm-shape-phase1 (commit 1461b6dc), 2026-06-11.
Activity
bpowers commentedon Jun 11, 2026
Severity refinement from the adversarial review of commit 1461b6d (the feeder-half defense), as this issue anticipated:
Empirically, with the co-source made endogenous (cube[D1,D1,D2] = 0.0001*pop[D1]), the co-source half post-1461b6dc emits 8 confident per-(row, slot) scores. pin_body_to_row bails on the ambiguous frac[d1,d1] index via the pre-existing resolve_mismatched_index_position uniqueness defense and falls back to the delta-ratio form (magnitude +/-1) -- including on the 4 phantom off-diagonal cube[r1,r2,c] -> agg[r1,r2] edges the executed simulation never reads.
Containment is loop-level only: all 17 loops traversing a phantom edge or the skipped feeder link fail fragment compile loudly (warned constant-0 stubs, the #780 pattern), and only the 4 diagonal cube loops compile. But the phantom +/-1 LINK scores enter the results slab and the link-level surfaces -- analyze_links synthetic collapse, rel-link denominators, discovery mode -- with no warning attached.
So this remains a real silent-wrong-number on the LINK surface for the square shape (pre-existing; 1461b6d neither introduced nor touched it). The phantom-edge fan-out itself is #778; this issue covers the first-match pin ambiguity across the co-source and agg-to-target halves.
engine: defend ltm feeder slot pin and agg source slices (#787)