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: Vensim unit equivalences like Resource unit/units are ignored #454
World3 declares Resource unit and Resource units as the same unit (22:Resource unit,Resource units in the MDL footer), but unit checking treats them as different units and reports mismatches.
units error in model 'main' variable 'resource_usage_rate': unit_mismatch -- computed units 'resource_unit/year' don't match specified units
error in model 'main': ... unit_mismatch -- unit checking failed; conflicting constraint:
1 == resource_unit/resource_units
Why it matters
Singular/plural unit equivalences are a common Vensim idiom, so this produces false errors on otherwise valid models.
Seen on World3.
Fix
World3's footer lists each 22: line twice.
The units context rejected the repeat as a duplicate declaration and the engine fell back to an empty context, which drops every alias (and the model's time unit, see #455).
Repeating an identical equivalence should be accepted; only a contradictory redeclaration is an error, and even then the rest of the units should still be usable.
wrld3_resource_unit_alias_should_not_conflict checks this on World3.
Confirm with the CLI that no resource_unit vs resource_units mismatch remains.
changed the title [-]engine: resource_unit/resource_units alias not honored during unit inference[/-][+]engine: Vensim unit equivalences like Resource unit/units are ignored[/+]on Oct 12, 2026
Context::new accepts an identical repeated declaration and only reports contradictory ones (src/simlin-engine/src/units.rs:329-410, 8bc2660), and project_units_context_result keeps the partial context instead of falling back to an empty one (src/simlin-engine/src/db/query.rs:69-83). wrld3_resource_unit_alias_should_not_conflict (tests/integration/wrld3_unit_errors.rs:122) runs un-ignored on World3, and test_redundant_duplicate_unit_declarations_are_benign (units.rs:1391) pins alias resolution.
Activity
[-]engine: resource_unit/resource_units alias not honored during unit inference[/-][+]engine: Vensim unit equivalences like Resource unit/units are ignored[/+]bpowers commentedon Oct 12, 2026
Closing: already fixed on main.
Context::newaccepts an identical repeated declaration and only reports contradictory ones (src/simlin-engine/src/units.rs:329-410, 8bc2660), andproject_units_context_resultkeeps the partial context instead of falling back to an empty one (src/simlin-engine/src/db/query.rs:69-83).wrld3_resource_unit_alias_should_not_conflict(tests/integration/wrld3_unit_errors.rs:122) runs un-ignored on World3, andtest_redundant_duplicate_unit_declarations_are_benign(units.rs:1391) pins alias resolution.