Summary
The body-aware per-row source[e] -> $⁚ltm⁚agg⁚{n} partials break the PREVIOUS(agg) anchor identity whenever the reducer body references TIME, a time builtin (PULSE/STEP/RAMP), or a nested PREVIOUS(x). freeze_pinned_body (src/simlin-engine/src/ltm_augment.rs ~3457) freezes only model dependencies, and reducer_body_ctx_parts (src/simlin-engine/src/db/ltm/link_scores.rs ~975) deliberately excludes TIME from the dep set -- so in a "fully frozen" term, TIME (and the time builtins, and nested PREVIOUS(x)) stays LIVE. A row whose every model dep is frozen therefore does NOT reproduce the previous-step value: R(all-frozen terms) != PREVIOUS(agg).
On the NONLINEAR arm (MIN/MAX/STDDEV), the partial's anchor subtraction R(live row, frozen rows) - PREVIOUS(agg) then attributes the full time-drift to EVERY row -- including provably non-influential ones -- destroying the frozen-argmin-scores-0 property.
Repro (demonstrated at eab752c8 on ltm-fix-batch-2)
grow = 1 + MIN(pop[*] * TIME)
The south row is never the argmin (its true ceteris-paribus partial is 0 at every step), yet it scores 0.9999, 0.9920, 0.9764, ... -- the drift pop_north_prev * delta-TIME duplicated onto every row.
Scope by arm
Why it matters
Low-medium severity: silently wrong per-row link scores (and the loop scores through those rows inherit the drift) for time-bearing reducer bodies -- an uncommon but perfectly legal equation shape. NOT a regression: the pre-#762 bare substitution emitted worse garbage for the same body, and the delta-ratio fallback would also score ~1 here. But it is a demonstrated wrong-value class that was invisible in the rustdoc (a doc caveat citing this issue is being added on the branch).
Component
src/simlin-engine/src/ltm_augment.rs (freeze_pinned_body, the MIN/MAX/STDDEV builders in generate_nonlinear_partial)
src/simlin-engine/src/db/ltm/link_scores.rs (reducer_body_ctx_parts's TIME exclusion)
Fix directions
- Bail to delta-ratio when the pinned body references
TIME, a time builtin, or PREVIOUS -- detectable during pinning. Honest relabeling (delta-ratio is the documented conservative fallback) rather than a better value.
- Freeze time-like terms too by anchoring both evaluations of the guard form at the SAME time sample, so the anchor identity
R(all-frozen) = PREVIOUS(agg) holds again. A deeper change to the guard form, but recovers the frozen-argmin-scores-0 property.
Cross-references (related, NOT duplicates)
Discovery context
Demonstrated during adversarial review of the GH #762 work on branch ltm-fix-batch-2 (commit eab752c8).
Summary
The body-aware per-row
source[e] -> $⁚ltm⁚agg⁚{n}partials break thePREVIOUS(agg)anchor identity whenever the reducer body referencesTIME, a time builtin (PULSE/STEP/RAMP), or a nestedPREVIOUS(x).freeze_pinned_body(src/simlin-engine/src/ltm_augment.rs~3457) freezes only model dependencies, andreducer_body_ctx_parts(src/simlin-engine/src/db/ltm/link_scores.rs~975) deliberately excludesTIMEfrom the dep set -- so in a "fully frozen" term,TIME(and the time builtins, and nestedPREVIOUS(x)) stays LIVE. A row whose every model dep is frozen therefore does NOT reproduce the previous-step value:R(all-frozen terms) != PREVIOUS(agg).On the NONLINEAR arm (MIN/MAX/STDDEV), the partial's anchor subtraction
R(live row, frozen rows) - PREVIOUS(agg)then attributes the full time-drift to EVERY row -- including provably non-influential ones -- destroying the frozen-argmin-scores-0 property.Repro (demonstrated at
eab752c8onltm-fix-batch-2)The south row is never the argmin (its true ceteris-paribus partial is 0 at every step), yet it scores 0.9999, 0.9920, 0.9764, ... -- the drift
pop_north_prev * delta-TIMEduplicated onto every row.Scope by arm
5a533bf6): the same deps-only-freeze convention only scales the live row's own delta (the per-row partial is a difference of two terms that share the frozen co-rows), so the effect is qualitatively benign there; the nonlinear arm's anchor identity is what breaks.Why it matters
Low-medium severity: silently wrong per-row link scores (and the loop scores through those rows inherit the drift) for time-bearing reducer bodies -- an uncommon but perfectly legal equation shape. NOT a regression: the pre-#762 bare substitution emitted worse garbage for the same body, and the delta-ratio fallback would also score ~1 here. But it is a demonstrated wrong-value class that was invisible in the rustdoc (a doc caveat citing this issue is being added on the branch).
Component
src/simlin-engine/src/ltm_augment.rs(freeze_pinned_body, the MIN/MAX/STDDEV builders ingenerate_nonlinear_partial)src/simlin-engine/src/db/ltm/link_scores.rs(reducer_body_ctx_parts's TIME exclusion)Fix directions
TIME, a time builtin, orPREVIOUS-- detectable during pinning. Honest relabeling (delta-ratio is the documented conservative fallback) rather than a better value.R(all-frozen) = PREVIOUS(agg)holds again. A deeper change to the guard form, but recovers the frozen-argmin-scores-0 property.Cross-references (related, NOT duplicates)
pin_body_to_row/freeze_pinned_bodymachinery (commit5a533bf6) carries the deps-only-freeze convention.Discovery context
Demonstrated during adversarial review of the GH #762 work on branch
ltm-fix-batch-2(commiteab752c8).