Repository navigation
Closed
Description
Summary
The black-box module link score equation collapses magnitude to ~1 whenever active, because it computes ABS((Δto)/(Δto)) * sign(...).
Why this is a problem
LTM link-score magnitude is supposed to represent fractional contribution (|Δ_x(z)/Δ(z)|). For black-box module links, the current equation loses that information entirely and encodes mostly sign + activity. This can distort loop-score magnitudes and ranking when any loop includes black-box-scored module edges.
Literature / algorithm alignment
- Reference doc Section 3.1 defines instantaneous link magnitude as
|Δ_x(z)/Δ(z)|with ceteris-paribus partial change. - For hidden structure (macros/modules), the integration approach uses pathway/composite scores (Section 6), not a unit-magnitude substitute.
Expected algorithmic behavior: even when internal structure is abstracted, link magnitude should remain contribution-sensitive, not constant-one when active.
Current implementation behavior
generate_module_link_score_equation emits:
- zero guards for
Δto == 0/Δfrom == 0 ABS((Δto)/(Δto)) * sign((Δto)/(Δfrom))
Location:
src/simlin-engine/src/ltm_augment.rs(generate_module_link_score_equation)
Impact
- Loops containing black-box module edges can be over- or under-weighted relative to loops with full ceteris-paribus/composite scoring.
- Results can depend on whether a dependency crosses a module boundary that uses this fallback.
Success criteria
- Replace or constrain the black-box fallback so magnitude is not identically 1 when active.
- Preferred: compute a contribution-consistent magnitude using available structure (composite/pathway where possible, ceteris-paribus equivalent where available).
- If a truly equivalent magnitude cannot be computed for some module class, surface that explicitly in output/metadata and avoid treating it as fully comparable to regular link scores.
- Add regression tests asserting that black-box module links can take nontrivial magnitudes (not just {0, ±1}) in at least one realistic scenario.
- Update LTM design docs to describe the exact fallback semantics and limitations.
Notes
This issue is independent of the known intentional flow-to-stock timing shift.
Metadata
Metadata
Assignees
Labels
No labels
Activity
bpowers commentedon Apr 30, 2026
Fixed in commit c16d9a9 ("engine: fix LTM var sort ordering and extract black-box formula helper").
The old
ABS((delta_to)/(delta_to)) * sign(...)formula that collapsed magnitude to ~1 has been replaced. The current black-box module-link-score formula is a true delta-ratio, preserving magnitude information:The new formula computes
delta_to / delta_from: magnitude reflects how much the target changes per unit change in the source, with proper zero-guards for both numerator and denominator. Used at all module-boundary fallback call sites indb.rs(lines ~2075-2112) anddb_ltm.rs(lines ~343-373).The success criteria from the issue (non-trivial magnitudes, not just {0, +/-1}) are met by construction.
Verified on
mainat HEAD 630fceb (2026-04-29).doc: refresh LTM tech-debt entries after triage of open issues