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: per-element equations with no dimensions compile as a scalar #697
A variable with per-element equations but no dimensions is accepted and compiled as a single scalar, with no error.
It should be rejected with an error that names the variable.
Example
The XMILE reader produces this from <element> children with no <dimensions>:
arr becomes Equation::Arrayed with an empty dimension list, gets a variable size of 1, and compiles.
The same holds for an Equation::ApplyToAll with an empty dimension list.
Exactly which element's equation the scalar ends up computing has not been checked.
Why it matters
A malformed file or a buggy importer gets plausible numbers with no signal.
It was found when a hand-built test fixture of this shape produced all-zero LTM link scores, which looked like an LTM bug.
Not seen in a real model.
Fix
At parse time, reject an Arrayed or ApplyToAll equation with an empty dimension list, naming the variable ("arr has per-element equations but no dimensions").
This also removes a code path that exists only for this shape: the dimensionless case of instantiate_implicit_modules' Ast::Arrayed branch, and its test fixture undimensioned_arrayed_project in db/fragment_determinism_tests.rs.
Pointers
src/simlin-engine/src/variable.rs: parse_equation
src/simlin-engine/src/xmile/variables.rs: convert_equation! (missing <dimensions> becomes an empty list)
src/simlin-engine/src/db/query.rs: variable_size (empty dimensions means size 1)
changed the title [-]engine: Arrayed/ApplyToAll equation on a variable with no declared dimensions is silently collapsed to scalar instead of rejected[/-][+]engine: per-element equations with no dimensions compile as a scalar[/+]on Oct 12, 2026
Activity
[-]engine: Arrayed/ApplyToAll equation on a variable with no declared dimensions is silently collapsed to scalar instead of rejected[/-][+]engine: per-element equations with no dimensions compile as a scalar[/+]