Problem
4 simulation integration tests in src/simlin-engine/tests/simulate.rs are #[ignore] because DELAY FIXED uses a first-order approximation instead of proper ring-buffer semantics:
simulates_delayfixed_xmile
simulates_delayfixed_mdl
simulates_delayfixed2_xmile
simulates_delayfixed2_mdl
DELAY FIXED in Vensim uses an internal ring buffer to store historical values and return the value from exactly N time steps ago. The current engine implementation uses a first-order exponential approximation, which diverges from reference output.
Why it matters
DELAY FIXED is a commonly used Vensim builtin. Correctness requires exact delay semantics (ring buffer), not an approximation. Models relying on DELAY FIXED will produce incorrect simulation results.
Components affected
src/simlin-engine (VM runtime state, bytecode compilation for DELAY FIXED)
Possible approach
Implement VM-level ring buffer state for DELAY FIXED. This requires:
- Per-instance ring buffer allocation in the VM state
- Bytecode ops to push current value and read delayed value
- Proper initialization of the ring buffer with the initial value argument
Context
Identified during review of 15 ignored simulation tests on the mdl-full-compat branch.
Problem
4 simulation integration tests in
src/simlin-engine/tests/simulate.rsare#[ignore]because DELAY FIXED uses a first-order approximation instead of proper ring-buffer semantics:simulates_delayfixed_xmilesimulates_delayfixed_mdlsimulates_delayfixed2_xmilesimulates_delayfixed2_mdlDELAY FIXED in Vensim uses an internal ring buffer to store historical values and return the value from exactly N time steps ago. The current engine implementation uses a first-order exponential approximation, which diverges from reference output.
Why it matters
DELAY FIXED is a commonly used Vensim builtin. Correctness requires exact delay semantics (ring buffer), not an approximation. Models relying on DELAY FIXED will produce incorrect simulation results.
Components affected
src/simlin-engine(VM runtime state, bytecode compilation for DELAY FIXED)Possible approach
Implement VM-level ring buffer state for DELAY FIXED. This requires:
Context
Identified during review of 15 ignored simulation tests on the
mdl-full-compatbranch.