Summary
Umbrella tracking item for the smaller residual clusters of C-LEARN's numeric divergence from the genuine-Vensim reference output (test/xmutil_test_models/Ref.vdf) that remain after the element-cycle-resolution work. C-LEARN now compiles, runs to FINAL TIME, and matches Ref.vdf within 1% on 96.3% of matched cells (after the per-element-GF mapping fix #589 / commit 61573545 and a :NA:-aware + near-zero-robust comparator in ensure_vdf_results). The decision was made to bank the 96.3% and track the residual: every variable below is excluded from the simulates_clearn gate via the documented EXPECTED_VDF_RESIDUAL exclusion constant, so the test passes on the reconciled set.
The dominant residual cluster (whole variables importing as a literal 0+0 stub) is tracked in a separate issue. This umbrella collects everything else.
Discovered on branch clearn-hero-model, HEAD 8775ae97; element-cycle-resolution AC8.1.
Residual clusters
1. SAMPLE UNTIL / INIT-of-:NA: / target-policy (COP dimension, often cop_developing_b)
A :NA:-arithmetic edge and/or SAMPLE UNTIL semantics. Vensim performs NA-arithmetic yielding e.g. -2*NA where Simlin yields a bare :NA: sentinel or 0:
last_set_target_year -- Vensim = -1.298e33 (i.e. -2*NA) vs Simlin = 0; equation is INIT(VECTOR SELECT(...))
last_active_target_year -- INIT with a -6.49e32 (:NA:) guard
time_from_target_to_ultimate_target -- rel ~ 0.96
target_emissions_for_rate / ultimate_target_value_from_rate -- SAMPLE UNTIL
depth_at_bottom -- INIT recurrence
emissions_with_stopped_growth
This subsumes the 2-variable "NA-mismatch" bucket (spurious :NA:, e.g. last_set_target_year).
2. Genuine ~25% numeric tail (meaningful-value divergence, not near-zero)
A connected chain that diverges by rel ~ 0.247 on substantial values -- needs a numeric root-cause, not comparator tuning:
im_3_emissions / im_3_ff_co2 / im_3_emissions_vs_rs / relative_emissions_to_equity / relative_emissions_to_equity_target -- e.g. oecd_us @ step 187
co2eq_gap_closing_percentage -- large rel but tiny absolute (~1.4e-3); a near-zero-ratio percentage, mostly comparator-ish rather than a true divergence.
3. other-NaN (NaN-vs-:NA: representation mismatch)
~9 variables, led by slr_inches_from_2000[deterministic] (sea-level-rise), where Vensim writes literal IEEE NaN for all 251 steps while Simlin writes the :NA: sentinel (-6.49e32). A NaN-vs-:NA: representation mismatch on a deterministic-scenario series.
Why it matters
- Correctness / Vensim fidelity:
:NA:-arithmetic (e.g. -2*NA), SAMPLE UNTIL semantics, and NaN-vs-:NA: representation are each places where Simlin's runtime diverges from genuine Vensim on real model logic.
- The ~25%
im_3_emissions chain is a meaningful-magnitude divergence (not near-zero noise) and is the most likely to indicate a substantive engine bug rather than a representation/comparator nuance.
Components affected
src/simlin-engine/src/ -- builtins / SAMPLE UNTIL, :NA:-arithmetic, VDF NaN handling
- Test fixtures:
test/xmutil_test_models/C-LEARN v77 for Vensim.mdl, test/xmutil_test_models/Ref.vdf
src/simlin-engine/tests/simulate.rs -- simulates_clearn; the exact exhaustive list of excluded vars lives in its EXPECTED_VDF_RESIDUAL exclusion constant.
Discovery context
Identified during the C-LEARN hero-model element-cycle-resolution work (branch clearn-hero-model, HEAD 8775ae97), element-cycle-resolution AC8.1. All variables above are excluded from the simulates_clearn gate and tracked here.
Relationship to existing issues (all DISTINCT)
Summary
Umbrella tracking item for the smaller residual clusters of C-LEARN's numeric divergence from the genuine-Vensim reference output (
test/xmutil_test_models/Ref.vdf) that remain after the element-cycle-resolution work. C-LEARN now compiles, runs to FINAL TIME, and matchesRef.vdfwithin 1% on 96.3% of matched cells (after the per-element-GF mapping fix #589 / commit61573545and a:NA:-aware + near-zero-robust comparator inensure_vdf_results). The decision was made to bank the 96.3% and track the residual: every variable below is excluded from thesimulates_clearngate via the documentedEXPECTED_VDF_RESIDUALexclusion constant, so the test passes on the reconciled set.The dominant residual cluster (whole variables importing as a literal
0+0stub) is tracked in a separate issue. This umbrella collects everything else.Discovered on branch
clearn-hero-model, HEAD8775ae97; element-cycle-resolution AC8.1.Residual clusters
1. SAMPLE UNTIL / INIT-of-:NA: / target-policy (COP dimension, often
cop_developing_b)A
:NA:-arithmetic edge and/orSAMPLE UNTILsemantics. Vensim performs NA-arithmetic yielding e.g.-2*NAwhere Simlin yields a bare:NA:sentinel or0:last_set_target_year-- Vensim =-1.298e33(i.e.-2*NA) vs Simlin =0; equation isINIT(VECTOR SELECT(...))last_active_target_year--INITwith a-6.49e32(:NA:) guardtime_from_target_to_ultimate_target-- rel ~ 0.96target_emissions_for_rate/ultimate_target_value_from_rate--SAMPLE UNTILdepth_at_bottom--INITrecurrenceemissions_with_stopped_growthThis subsumes the 2-variable "NA-mismatch" bucket (spurious
:NA:, e.g.last_set_target_year).2. Genuine ~25% numeric tail (meaningful-value divergence, not near-zero)
A connected chain that diverges by rel ~ 0.247 on substantial values -- needs a numeric root-cause, not comparator tuning:
im_3_emissions/im_3_ff_co2/im_3_emissions_vs_rs/relative_emissions_to_equity/relative_emissions_to_equity_target-- e.g.oecd_us@ step 187co2eq_gap_closing_percentage-- large rel but tiny absolute (~1.4e-3); a near-zero-ratio percentage, mostly comparator-ish rather than a true divergence.3. other-NaN (NaN-vs-:NA: representation mismatch)
~9 variables, led by
slr_inches_from_2000[deterministic](sea-level-rise), where Vensim writes literal IEEE NaN for all 251 steps while Simlin writes the:NA:sentinel (-6.49e32). A NaN-vs-:NA:representation mismatch on a deterministic-scenario series.Why it matters
:NA:-arithmetic (e.g.-2*NA),SAMPLE UNTILsemantics, and NaN-vs-:NA:representation are each places where Simlin's runtime diverges from genuine Vensim on real model logic.im_3_emissionschain is a meaningful-magnitude divergence (not near-zero noise) and is the most likely to indicate a substantive engine bug rather than a representation/comparator nuance.Components affected
src/simlin-engine/src/-- builtins /SAMPLE UNTIL,:NA:-arithmetic, VDF NaN handlingtest/xmutil_test_models/C-LEARN v77 for Vensim.mdl,test/xmutil_test_models/Ref.vdfsrc/simlin-engine/tests/simulate.rs--simulates_clearn; the exact exhaustive list of excluded vars lives in itsEXPECTED_VDF_RESIDUALexclusion constant.Discovery context
Identified during the C-LEARN hero-model element-cycle-resolution work (branch
clearn-hero-model, HEAD8775ae97), element-cycle-resolution AC8.1. All variables above are excluded from thesimulates_clearngate and tracked here.Relationship to existing issues (all DISTINCT)
:NA:mishandled as IEEE NaN -> finite sentinel-2^109) -- FIXED; established the runtime:NA:sentinel. The clusters here are the remaining numeric residual after that fix::NA:-arithmetic results (-2*NA),SAMPLE UNTIL, and the VDF NaN-vs-:NA:representation gap. engine: Vensim :NA: was mishandled as IEEE NaN (should be the finite sentinel -2^109) #586's own "Remaining follow-on" (test comparator reconciling sentinel-vs-VDF-0.0) is the comparator now inensure_vdf_results; this issue is the genuine divergence that comparator does not paper over.0+0-stub lookup/data import cluster is tracked in a separate issue.