Skip to content

mdl: no round-trip test checks saved flow pipe flags #403

Open

Description

@bpowers

The MDL writer now sets a flow pipe's fourth field the way Vensim's files do: 4 on the pipe to the flow's downstream end, 100 on the pipe to its upstream end (#1076).
Two things are still open.

  1. No test compares saved pipe flags with Vensim's.
    mdl_format_roundtrip reduces each pipe record to its endpoint (normalize_pipe_line), so field 4 is dropped before comparison, and only hand-built unit tests pin the rule.
  2. Some Vensim-written files in the test corpus use other values (36 or 68).
    The importer does not keep the raw value, so a save rewrites them as 4 or 100.
    Vensim's sketch-format page does not document the field (vensim.com/documentation/24305.html); whether Vensim treats 36/68 differently from 4/100 is unverified.

Fix

Recommended: in normalize_pipe_line, keep field 4 when the original is 4 or 100, so the round trip of test/bobby/vdf/econ/mark2.mdl checks it.
Leave 36/68 rewritten unless a Vensim user sees a difference; keeping the raw value would add a field to the view model for a cosmetic match.

Pointers

  • src/simlin-engine/tests/integration/mdl_roundtrip.rs: normalize_pipe_line
  • src/simlin-engine/src/mdl/writer.rs: write_flow_pipe_connectors_with_context
  • src/simlin-engine/src/mdl/view/processing.rs: the direction field comment on the 36/68 values

Activity

  1. added
    engine
    compat
    on Jun 8, 2026
  2. added
    bug
    on Oct 12, 2026
  3. changed the title [-]MDL writer pipe connector flags may not match Vensim originals[/-] [+]mdl: saved flow pipe flags differ from Vensim's[/+] on Oct 12, 2026
  4. changed the title [-]mdl: saved flow pipe flags differ from Vensim's[/-] [+]mdl: no round-trip test checks saved flow pipe flags[/+] on Oct 12, 2026
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

    bugcompatengine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions