Skip to content

engine: C-LEARN cannot simulate because macros are not expanded #349

Closed

Description

@bpowers

C-LEARN uses Vensim macros (:MACRO: blocks: SAMPLE UNTIL, SSHAPE, RAMP FROM TO, INIT), and the engine parsed them but did not expand them, so the model could not simulate and simulates_clearn was ignored.

Status

Fixed on main.
Macros are expanded into module instances (MacroRegistry::resolve_call), C-LEARN's four macros import without macro errors, and simulates_clearn runs in the default test suite.
The non-macro compile errors that remained afterwards were #559, also fixed.

Pointers

  • src/simlin-engine/src/db/macro_registry.rs
  • src/simlin-engine/tests/integration/simulate.rs: simulates_clearn

Activity

  1. added
    engine
    compat
    on Jun 8, 2026
  2. changed the title [-]engine: C-LEARN macro expansion blocks 1 simulation test[/-] [+]engine: C-LEARN cannot simulate because macros are not expanded[/+] on Oct 12, 2026
  3. added
    enhancement
    on Oct 12, 2026
  4. bpowers commented on Oct 12, 2026

    @bpowers
    OwnerAuthor

    Closing: already fixed on main.

    Macros are expanded into module instances: the registry is built in src/simlin-engine/src/db/macro_registry.rs and calls are routed by MacroRegistry::resolve_call (src/simlin-engine/src/module_functions.rs:555, read by builtins_visitor.rs:140/843). simulates_clearn (tests/integration/simulate.rs:4011) is a plain #[test] comparing C-LEARN against Ref.vdf, and corpus_clearn_macros_import (simulate.rs:6851) pins the four macros importing cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatengineenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions