-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Problem
1 simulation integration test in src/simlin-engine/tests/simulate.rs is #[ignore] because macro expansion is not implemented:
simulates_clearn-- the C-LEARN test model uses Vensim macros; parsing is complete but conversion/inlining is not implemented, so the model is NotSimulatable
Vensim macros (:MACRO: blocks) define reusable equation templates that are expanded/inlined at compilation time. The engine can parse these macro definitions but does not yet perform the expansion step needed to produce simulatable equations.
Why it matters
Macros are used in complex Vensim models (C-LEARN is a notable example) to factor out repeated equation patterns. Without macro expansion, these models cannot simulate at all.
Components affected
src/simlin-engine(macro expansion/inlining in the compilation pipeline)
Possible approach
- After parsing, identify macro invocations in variable equations
- Expand each invocation by substituting actual arguments into the macro template
- Inline the expanded equations into the model's variable set
- Ensure expanded variables participate in normal dependency analysis and compilation
Related
Tech-debt item #1 (MDL Parser C-LEARN Equivalence) tracks parser-level differences with xmutil but not the macro expansion gap itself.
Context
Identified during review of 15 ignored simulation tests on the mdl-full-compat branch.