You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
engine: no simulation test covers out-of-range VECTOR ELM MAP offsets #579
VECTOR ELM MAP returns NaN when an offset lands outside the source array, and picks between reading the whole source and a slice of it, based on the source's total length.
No end-to-end simulation test checks either decision.
If that length were computed wrong, the Vensim-output tests (vector.dat, vector_simple.dat) would still pass, because neither model has an out-of-range offset or a sliced source.
Example
y[DimA] = VECTOR ELM MAP(d[DimA, B1], offset[DimA]), where the offset for A3 walks past the end of d's storage, should give NaN for y[A3].
Forcing the length to a wrong value in the compiler left every simulation test green.
Why it matters
A wrong length gives a wrong number or a missed NaN, silently.
No real model is known to hit it; this is a test gap, not an observed bug.
Fix
Add one small model-level test per branch (whole-array source and sliced source) with an out-of-range offset, asserting NaN.
Whether real Vensim returns :NA: for an out-of-range offset is unverified.
Pointers
src/simlin-engine/src/vm_vector_elm_map.rs
src/simlin-engine/src/array_tests.rs (the out_of_bounds_element_returns_nan_* tests)
changed the title [-]engine: VECTOR ELM MAP full_source_len has no genuine-Vensim numeric end-to-end test gate (defense-in-depth coverage gap)[/-][+]engine: no simulation test covers out-of-range VECTOR ELM MAP offsets[/+]on Oct 12, 2026
Both branches have a model-level out-of-range test asserting NaN in src/simlin-engine/src/array_tests.rs: whole-array source in out_of_bounds_element_returns_nan_vm (:3524) and sliced source d[DimA,B1] in strict_slice_source_oob_returns_nan_vm (:3676, added by PR #736).
Activity
engine: close out the VECTOR builtin issues (#576/#578/#579) (#736)
[-]engine: VECTOR ELM MAP full_source_len has no genuine-Vensim numeric end-to-end test gate (defense-in-depth coverage gap)[/-][+]engine: no simulation test covers out-of-range VECTOR ELM MAP offsets[/+]bpowers commentedon Oct 12, 2026
Closing: already fixed on main.
Both branches have a model-level out-of-range test asserting NaN in src/simlin-engine/src/array_tests.rs: whole-array source in out_of_bounds_element_returns_nan_vm (:3524) and sliced source d[DimA,B1] in strict_slice_source_oob_returns_nan_vm (:3676, added by PR #736).