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
engine: INITIAL in a macro output reads inf during initialization #584
When a module (or a macro, which compiles to one) has an output defined as INITIAL(x), and the parent model reads that output while initializing, the module did not compute the output during initialization.
The parent read an unwritten slot (inf) and kept it for the whole run.
Example
C-LEARN defines
:MACRO: INIT(x)
INIT = INITIAL(x)
:END OF MACRO:
and calls it about 177 times, for example volumetric heat capacity = INITIAL(mass heat cap*...).
Simlin gave volumetric heat capacity = inf (Vensim: 0.1327), and the climate sector went inf/NaN from there.
Status
Fixed on main.
A pass-through macro like the one above now compiles straight to the INITIAL opcode at the call site (#600), and a model used as a module now evaluates every value-bearing variable during initialization, because a parent can read any of its outputs then (#1028, closed).
C-LEARN's volumetric heat capacity matches Vensim.
changed the title [-]engine: INITIAL()-backed module/macro primary output omitted from the initials runlist (spurious inf)[/-][+]engine: INITIAL in a macro output reads inf during initialization[/+]on Oct 12, 2026
The initials runlist seeds INITIAL-backed variables and every value-bearing variable of a model instantiated as a module or macro (src/simlin-engine/src/db/dep_graph.rs:2603-2660, GH #584/#1028). Pinned by issue_584_initial_backed_macro_output_is_written_during_initials (src/macro_expansion_tests.rs:1093) and by simulates_clearn, whose residual exclusion list does not include volumetric heat capacity.
Activity
engine: C-LEARN incremental structural-gate test (AC7.1-7.3, AC7.5)
doc: index element-cycle-resolution plan; test-requirements finalizat…
engine: element-level cycle resolution (C-LEARN hero model) (#592)
[-]engine: INITIAL()-backed module/macro primary output omitted from the initials runlist (spurious inf)[/-][+]engine: INITIAL in a macro output reads inf during initialization[/+]bpowers commentedon Oct 12, 2026
Closing: already fixed on main.
The initials runlist seeds INITIAL-backed variables and every value-bearing variable of a model instantiated as a module or macro (src/simlin-engine/src/db/dep_graph.rs:2603-2660, GH #584/#1028). Pinned by issue_584_initial_backed_macro_output_is_written_during_initials (src/macro_expansion_tests.rs:1093) and by simulates_clearn, whose residual exclusion list does not include volumetric heat capacity.