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-augment: STDDEV/RANK partials silently fall back to delta-ratio #483
generate_nonlinear_partial in src/simlin-engine/src/ltm_augment.rs returns the target variable itself for STDDEV and RANK, yielding a delta-ratio (target - PREV(target)) / (source[d] - PREV(source[d])) instead of a true ceteris-paribus partial. Under uniform scaling of all elements, STDDEV does not change but the delta-ratio still reports nonzero per-element attributions -- the score is silently wrong.
MIN and MAX (the scalar two-arg forms) are now handled correctly via explicit nested binary calls with selective PREVIOUS() wrapping at ltm_augment.rs:1348-1372. Only STDDEV and RANK remain.
Locations
src/simlin-engine/src/ltm_augment.rs:1374-1381 -- the catch-all returning target_q.to_string() for STDDEV and RANK
src/simlin-engine/src/ltm_augment.rs:1375 -- code comment now documents the limitation
Suggested fix
Unroll STDDEV element-by-element with the standard formula, holding the source element live and wrapping all other elements in PREVIOUS():
Resolved by 26ed48d, dd838dd, e866d8a — Phase 6 of the LTM arrays hardening plan (docs/design-plans/2026-05-11-ltm-arrays-hardening.md). generate_nonlinear_partial now builds the analytic STDDEV ceteris-paribus partial — the unrolled population-variance sqrt formula (divisor N, matching vm.rs::Opcode::ArrayStddev, with the mean string-inlined; single-element variance is identically 0) — instead of the delta-ratio stand-in. RANK keeps the delta-ratio by design (an order statistic, non-differentiable, and unreachable as a real scalar/A2A reducer RHS since it returns an array), pinned by test_generate_rank_keeps_delta_ratio so the choice is explicit, not a silent fallback.
Activity
doc: add LTM arrays hardening design plan
bpowers commentedon May 13, 2026
Resolved by 26ed48d, dd838dd, e866d8a — Phase 6 of the LTM arrays hardening plan (docs/design-plans/2026-05-11-ltm-arrays-hardening.md).
generate_nonlinear_partialnow builds the analytic STDDEV ceteris-paribus partial — the unrolled population-variancesqrtformula (divisorN, matchingvm.rs::Opcode::ArrayStddev, with the mean string-inlined; single-element variance is identically 0) — instead of the delta-ratio stand-in. RANK keeps the delta-ratio by design (an order statistic, non-differentiable, and unreachable as a real scalar/A2A reducer RHS since it returns an array), pinned bytest_generate_rank_keeps_delta_ratioso the choice is explicit, not a silent fallback.