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
mdl: C-LEARN lookup-only variables simulate as zero #590
In C-LEARN, a variable that is only a lookup table (no equation, just the graphical function, written 0+0 by the importer) used to simulate as a series of zeros, while Vensim's reference run showed real values for it.
About 17 variables were affected, for example Historical GDP LOOKUP and RS HFC125.
This is fixed on main.
A lookup-only variable is now a static table: it has no series, is left out of every runlist, and a bare reference to it (without an input) is the error LookupReferencedWithoutArgument.
The variables that call these tables match Vensim.
The VDF reader's handling of the lookup-only columns in Ref.vdf was fixed separately (#597, closed), and the intermediate gf(Time) lowering was replaced by the static-table rule (#606, closed). EXPECTED_VDF_RESIDUAL lists none of these variables any more.
The full residual measurement methodology + the three-measurement histogram progression (baseline 28% genuine-divergence → post-GF-fix 3.27% → post-comparator 3.12%, across 873,982 matched cells) — i.e. the quantitative investigation context for this 0+0 cluster and all the residual clusters — is recorded in a comment on the companion umbrella issue #591. This 0+0 cluster is the dominant portion of that 3.12% genuine residual (rel = 1.0, whole variables zeroed).
Exact EXPECTED_VDF_RESIDUAL membership (measured on clearn-hero-model, un-stubbed simulates_clearn)
The exact exhaustive exclusion set is now baked into EXPECTED_VDF_RESIDUAL in src/simlin-engine/tests/simulate.rs. This 0+0 data/graph-lookup-import cluster accounts for 17 of the 32 excluded bases:
These are exactly the variables named in the issue body (the 0+0 whole-variable-zeroed cluster, relative error 1.0). Note: the BARE historical_gdp (without _lookup) is NOT in this cluster -- it imports fine and its only divergence is -2*NA NA-arithmetic cells, so it is attributed to #591 cluster 1 instead. The remaining 15 of 32 excluded bases are #591's SAMPLE UNTIL / NA-arithmetic / numeric-tail clusters.
Disposition: the engine 0+0 zeroing is FIXED; the residual is now a VDF-reader artifact (tracked in #597)
Closing-recommendation. The engine bug this issue describes (graph-lookup / lookup-only variables importing as a literal 0+0 stub, so the whole variable runs at 0) is resolved.
What was fixed
Phase 1 (commit 45596177): a lookup-only variable now lowers to gf(Time) (the graphical function applied to Time) instead of the 0+0 stub. The engine's output for every affected base now matches the model's tables byte-for-byte, and every applied consumer of these variables matches Ref.vdf exactly.
So candidate (a) in this issue ("MDL-import / lowering bug dropping a lookup to 0+0") was the real defect, and it is fixed. Candidate (b) ("genuine missing external data") does not apply -- the data is inline graphical-function tables, not external data.
Why these bases still appear in EXPECTED_VDF_RESIDUAL
The remaining divergence for these same bases is not an engine bug. It is a reference-side decode artifact: our Ref.vdf reader mis-decodes the standalone graphical-function ("lookup-only") descriptor columns (the engine value is correct; the reference column we read is wrong). This is now tracked precisely in #597, which supersedes this issue's "engine 0+0" framing:
The scalar half of the reader decode was fixed in commit d69754bc (standalone_descriptor_rebinds, proven byte-exact for global_emissions_from_graph_lookup -> OT 1612, which has dropped out of the carve-out).
The engine correctness bug is resolved -- recommend closing this issue and letting #597 carry the reference-reader decode work. (Filing this as a comment rather than auto-closing so a human can confirm the disposition.) These 17 bases remain in tests/simulate.rs::EXPECTED_VDF_RESIDUAL as documented VDF-decode-artifact carve-outs, each with a one-line sourced reason, guarded for exactness by clearn_residual_exactness.
changed the title [-]engine: C-LEARN data/graph-lookup variables import as 0+0 (zeroed) instead of their lookup/data values[/-][+]mdl: C-LEARN lookup-only variables simulate as zero[/+]on Oct 12, 2026
A lookup-only variable is now a static table with no series, and a bare reference is LookupReferencedWithoutArgument (src/simlin-engine/src/db/var_fragment.rs:788; tests in src/simlin-engine/src/lookup_only_tests.rs). EXPECTED_VDF_RESIDUAL (src/simlin-engine/tests/integration/simulate.rs:3925) has no lookup-only entries, and simulates_clearn plus clearn_residual_exactness run by default, so the variables that call these tables are held to the 1% gate against Ref.vdf.
Activity
bpowers commentedon May 20, 2026
The full residual measurement methodology + the three-measurement histogram progression (baseline 28% genuine-divergence → post-GF-fix 3.27% → post-comparator 3.12%, across 873,982 matched cells) — i.e. the quantitative investigation context for this
0+0cluster and all the residual clusters — is recorded in a comment on the companion umbrella issue #591. This0+0cluster is the dominant portion of that 3.12% genuine residual (rel = 1.0, whole variables zeroed).bpowers commentedon May 20, 2026
Exact
EXPECTED_VDF_RESIDUALmembership (measured onclearn-hero-model, un-stubbedsimulates_clearn)The exact exhaustive exclusion set is now baked into
EXPECTED_VDF_RESIDUALinsrc/simlin-engine/tests/simulate.rs. This0+0data/graph-lookup-import cluster accounts for 17 of the 32 excluded bases:global_emissions_from_graph_lookup,ref_global_emissions_from_graph_lookup,historical_forestry_lookup,historical_gdp_lookup,oc,_bc,_and_bio_aerosol_forcings,other_forcings_composite_plus_rcp85,other_forcings_smooth_plus_rcp85,ozone_precursor_forcings,rs_ch4,rs_hfc125,rs_hfc134a,rs_hfc143a,rs_hfc152a,rs_hfc227ea,rs_hfc23,rs_hfc245ca,rs_hfc32.These are exactly the variables named in the issue body (the
0+0whole-variable-zeroed cluster, relative error 1.0). Note: the BAREhistorical_gdp(without_lookup) is NOT in this cluster -- it imports fine and its only divergence is-2*NANA-arithmetic cells, so it is attributed to #591 cluster 1 instead. The remaining 15 of 32 excluded bases are #591's SAMPLE UNTIL / NA-arithmetic / numeric-tail clusters.doc: index element-cycle-resolution plan; test-requirements finalizat…
engine: element-level cycle resolution (C-LEARN hero model) (#592)
docs: add C-LEARN residual design plan; drop dead impl-plan links
bpowers commentedon May 20, 2026
Disposition: the engine
0+0zeroing is FIXED; the residual is now a VDF-reader artifact (tracked in #597)Closing-recommendation. The engine bug this issue describes (graph-lookup / lookup-only variables importing as a literal
0+0stub, so the whole variable runs at 0) is resolved.What was fixed
45596177): a lookup-only variable now lowers togf(Time)(the graphical function applied toTime) instead of the0+0stub. The engine's output for every affected base now matches the model's tables byte-for-byte, and every applied consumer of these variables matchesRef.vdfexactly.So candidate (a) in this issue ("MDL-import / lowering bug dropping a lookup to
0+0") was the real defect, and it is fixed. Candidate (b) ("genuine missing external data") does not apply -- the data is inline graphical-function tables, not external data.Why these bases still appear in
EXPECTED_VDF_RESIDUALThe remaining divergence for these same bases is not an engine bug. It is a reference-side decode artifact: our
Ref.vdfreader mis-decodes the standalone graphical-function ("lookup-only") descriptor columns (the engine value is correct; the reference column we read is wrong). This is now tracked precisely in #597, which supersedes this issue's "engine0+0" framing:d69754bc(standalone_descriptor_rebinds, proven byte-exact forglobal_emissions_from_graph_lookup-> OT 1612, which has dropped out of the carve-out).historical_forestry_lookup,historical_gdp_lookup,rs_ch4,rs_co2_ff,rs_gdp_in_trillions,rs_hfc125,rs_hfc134a,rs_hfc143a,rs_hfc152a,rs_hfc227ea,rs_hfc23,rs_hfc245ca,rs_hfc32) plus 4 scalar no-distinct-column cases (ref_global_emissions_from_graph_lookup,ozone_precursor_forcings,oc,_bc,_and_bio_aerosol_forcings,other_forcings_smooth_plus_rcp85) are tracked in engine: VDF reader mis-decodes arrayed standalone graphical-function ("lookup-only") descriptor columns (Ref.vdf) #597.Recommendation
The engine correctness bug is resolved -- recommend closing this issue and letting #597 carry the reference-reader decode work. (Filing this as a comment rather than auto-closing so a human can confirm the disposition.) These 17 bases remain in
tests/simulate.rs::EXPECTED_VDF_RESIDUALas documentedVDF-decode-artifactcarve-outs, each with a one-line sourced reason, guarded for exactness byclearn_residual_exactness.engine: tighten C-LEARN VDF residual carve-out to the proven remainder
docs: update engine/cli context for C-LEARN residual closure
engine: deterministic VDF slot-table decode + arrayed lookup-only des…
[-]engine: C-LEARN data/graph-lookup variables import as 0+0 (zeroed) instead of their lookup/data values[/-][+]mdl: C-LEARN lookup-only variables simulate as zero[/+]bpowers commentedon Oct 12, 2026
Closing: already fixed on main.
A lookup-only variable is now a static table with no series, and a bare reference is
LookupReferencedWithoutArgument(src/simlin-engine/src/db/var_fragment.rs:788; tests in src/simlin-engine/src/lookup_only_tests.rs).EXPECTED_VDF_RESIDUAL(src/simlin-engine/tests/integration/simulate.rs:3925) has no lookup-only entries, andsimulates_clearnplusclearn_residual_exactnessrun by default, so the variables that call these tables are held to the 1% gate against Ref.vdf.