Skip to content

engine: DELAY FIXED is refused instead of simulated #346

Open

Description

@bpowers

The engine refuses Vensim's DELAY FIXED (XMILE DELAY, a pipeline delay) with NotSimulatable.
It should support it: the output is the input exactly one delay time ago, and the initial value until then.

Example

receiving = DELAY FIXED(shipping, shipping time, shipping)

The variable is refused with "DELAY (Vensim's DELAY FIXED) delays its input by exactly the delay time, which is not supported yet".
Vensim's expected output is in test/sdeverywhere/models/delayfixed/delayfixed.dat (also delayfixed2, test/test-models/tests/delay_fixed, and Stella-side test/test-models/tests/delay_xmile).

Why it matters

Seen in real models: metasd bathtub-statistics/integration3.mdl, social-network-valuation/groupon 1-3.mdl and early-warnings-catastrophe/catastropeWarning2.mdl all use it.
Vensim's DELAY MATERIAL is the same kind of delay (used by thyroid-2008-d.mdl), and the engine does not recognize it at all.

Fix

Give each pipeline-delay instance a ring buffer in the VM holding the input for the last delay-time / DT steps, filled with the initial value at the start.
It needs opcodes to push the current input and read the oldest value, and the wasm backend must match.
Vensim rounds a delay time that is not a whole number of DTs (test/test-models/tests/delay_pipeline/README.md); copy that rounding and test it against the fixture.
Decide whether a delay time that changes during the run is allowed.
If supporting it adds much complexity, refuse it with a clear error.
DELAY MATERIAL can then be mapped onto the same machinery.

Pointers

Activity

  1. added
    engine
    on Jun 8, 2026
  2. added
    compat
    enhancement
    on Oct 12, 2026
  3. changed the title [-]engine: DELAY FIXED ring-buffer semantics blocks 4 simulation tests[/-] [+]engine: DELAY FIXED is refused instead of simulated[/+] 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

    compatengineenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions