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: XMILE <element> without <eqn> fails whole-file parse with opaque 'missing field eqn' (gf-only and len-only elements are spec-legal) #907
The XMILE reader's <element> struct (VarElement in src/simlin-engine/src/xmile/variables.rs) declares pub eqn: String as a required field. Any <element> block WITHOUT an <eqn> child therefore fails deserialization of the ENTIRE file with the opaque error:
ModelError{xml_deserialization: missing field 'eqn'}
The error names neither the variable nor the element, so users have no way to locate the offending block.
Element blocks without an <eqn> are legal XMILE. Spec section 4.5.2 allows each <element> to carry per-element simulation attributes and per-element graphical functions, e.g.:
a graphical-function-only element: <element subscript="a"><gf>...</gf></element> (lookup-only per-element definitions)
a conveyor per-element <len>-only element: <element subscript="a"><len>2</len></element>
Concrete evidence
The vendored corpus file test/test-models/samples/arrays/non-a2a/non-a2a-gf.stmx cannot be opened at all today -- open_xmile returns exactly the error above. It is not wired into the simulate corpus (its sibling non-a2a.stmx is), so the breakage is invisible to CI.
A minimal synthetic file with <element subscript="a"><len>2</len></element> on an arrayed conveyor fails the whole-file parse the same way.
Make eqn optional on VarElement (defaulting to an empty equation, which the engine already treats as lookup-only when a gf is present), or at minimum surface a targeted diagnostic naming the variable and element subscript. This would let non-a2a-gf.stmx open and potentially join the simulate test corpus.
Context
Confirmed while working #904/#905 on branch conveyor-engine (PR #869 line of work, 2026-07-08). Related but distinct: #904 (per-element <len> silently dropped when <eqn> present), #888 (same hard-fail-on-unknown pattern in the <options> block), #90 (other Stella loading issues, including a different missing-field error on empty <variables/>).
Activity
engine: warn on unresolvable arrayed element subscripts
engine: warn on unresolvable arrayed element subscripts