Skip to content

ltm: C-LEARN check flags 24 always-zero link scores that look correct #1064

Open

Description

@bpowers

The clearn_discover example flags link scores that are 0 at every saved step even though both endpoints change somewhere in the run, to catch link-score equations that silently fail (the #587 failure).
On C-LEARN it flags 24 of 7,636 link scores and prints only the first 15.
Nobody has confirmed whether the 24 are bugs or correct zeros; until that is settled the list is noise a real failure could hide in.

Example

CLEARN_SKIP_DISCOVERY=1 cargo run --release -p simlin-engine --example clearn_discover

Every flagged link involves Vensim's SAMPLE IF TRUE, which the MDL importer rewrites to IF cond THEN input ELSE PREVIOUS(SELF, init), or an IF THEN ELSE arm.
Reading the equations, all three groups look like correct zeros:

  • 14 self links of a sample-and-hold variable (Global CO2eq peak, CO2 Emissions at y2009, ...).
    While sampling the equation does not read itself; while holding the value does not change.
  • 7 links into a sample-and-hold variable.
    A condition like Time=y2009 is evaluated with TIME held at the previous step (ltm: should a ceteris-paribus partial freeze TIME? (today it does not, and the target's autonomous time evolution is attributed to the link) #1016), so the input arm never counts at the sampling step; in the others the target is constant while the source moves, and vice versa.
  • 3 links read only on an inactive arm: Control other forcings = 0, Global percent of reference emissions = 0, and Annual change of CO2 emissions reads CO2 Emissions at y2009 only after it stops changing.

Fix

Confirm the reasoning above against the run's series (an hour), then print the full list instead of take(15) and record these 24 as expected in the example.
Making the heuristic itself tell a structural zero from a failed equation would need per-arm knowledge the example does not have; not worth it.

Pointers

  • src/simlin-engine/examples/clearn_discover.rs: the suspect-zero check (around line 175) and the take(15) cap
  • src/simlin-engine/src/mdl/xmile_compat.rs: the "sample if true" rewrite
  • test/xmutil_test_models/C-LEARN v77 for Vensim.mdl
  • Related: ltm: skipped link-score slot reports 0 where the target is NaN #1022 (an omitted link-score slot reports 0)

Activity

  1. added
    ltm
    on Sep 11, 2026
  2. changed the title [-]ltm: 24 C-LEARN link scores are identically zero in discovery mode although both endpoints vary[/-] [+]ltm: C-LEARN check flags 24 always-zero link scores that look correct[/+] on Oct 12, 2026
  3. added
    hygiene
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    hygieneltm

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions