Repository navigation
Description
Variables that read the output of a SMOOTH or DELAY call fail unit checking because the checker cannot find units for the call's output.
The output's units are well defined (SMTH1, SMTH3, DELAY1 and DELAY3 return the units of their input), so readers should be checked against them.
Example
On World3 (test/metasd/WRLD3-03/wrld3-03.mdl), every SMOOTH and DELAY call site reported:
units error in model 'main' variable 'persistent_pollution_appearance_rate': does_not_exist -- can't find or no units for dependency '$⁚persistent_pollution_appearance_rate⁚0⁚delay3·output'
units error in model 'main' variable 'average_industrial_output_per_capita': does_not_exist -- can't find or no units for dependency '$⁚average_industrial_output_per_capita⁚0⁚smth1·output'
The name in quotes is the internal module the engine creates for each SMOOTH/DELAY call.
Why it matters
Smooths and delays are in nearly every real model, and an unresolved output also hides genuine mismatches downstream.
Seen on World3.
Fix
Unit inference already walks into each stdlib module and gives its output a unit variable, so readers should pick up the inferred units.
Two things defeated this on World3: inference threw away all its results when it hit any conflict, and the checker treated a dependency with unknown units as an error instead of skipping it.
Confirm on World3 that neither message appears and that a reader with the wrong declared units is still caught.
Pointers
src/simlin-engine/src/units_infer.rs(module constraints, around theVarKind::Modulearm)src/simlin-engine/src/units_check.rs(check_against_expected, which skips unknown units)src/simlin-engine/src/unit_checking_test.rs(SMTH1/DELAY1 unit tests)- Related: engine: Vensim unit equivalences like Resource unit/units are ignored #454, engine: stock/flow unit check uses 'time' instead of the time unit #455, engine: a bad unit declaration is reported against a nameless model #456 (same World3 unit run)
Activity
[-]engine: stdlib module output units not propagated to consumers[/-][+]engine: readers of a SMOOTH or DELAY output fail unit checking[/+]bpowers commentedon Oct 12, 2026
Closing: already fixed on main.
A dependency with unknown units is skipped, not reported: every reader path drops
DoesNotExist(src/simlin-engine/src/units_check.rs:648, 681, 745; #615), so the "can't find or no units for dependency" message can no longer reach a diagnostic. Inference keeps partial results (#618, 14fed2a) and resolves SMOOTH/DELAY outputs (units_infer.rs tests around line 1332 assertSMTH1/DELAY1results infer the input's units);unknown_dependency_units_do_not_hard_errorandtest_smth1_in_complex_modelpin the reader side.