Repository navigation
Description
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 likeTime=y2009is 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, andAnnual change of CO2 emissionsreadsCO2 Emissions at y2009only 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 thetake(15)capsrc/simlin-engine/src/mdl/xmile_compat.rs: the"sample if true"rewritetest/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
[-]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[/+]