Repository navigation
Description
The XMILE reader copies every <connect> on a module into the module's input wiring without asking what kind of connect it is.
Connects whose from is inside a module then either bind nothing or raise a wiring warning.
One of these shapes is written by Stella for every module-to-module link, so real Stella models get a false warning.
Example
Stella records each module-to-module link on both modules.
From test/modules_hares_and_foxes/modules_hares_and_foxes.stmx:
<module name="hares">
<connect to="lynxes.hare_density" from="hares.hare_density"/>
...
<module name="lynxes">
<connect to="lynxes.hare_density" from="hares.hare_density"/>The copy on lynxes binds the input.
The copy on hares names another module's input, so model_module_wiring_diagnostics warns bad_module_input_dst ("input wiring target ... does not name an input of model ...").
The model simulates correctly; the warning is noise.
This is by code reading; the test a_cross_instance_reference_on_the_source_instance_is_a_dst_report_only pins the warning.
The same file layout appears in test/modules2/, test/modules_with_complex_idents/, test/ai-information/WithModulesAndArrays.stmx and the hares-and-lynxes sample.
Two other shapes, neither seen in a real file:
- A connect from a module to its own input (
<connect to="bridge.input" from="bridge.output"/>onbridge) binds nothing and warnsbad_module_input_src. Section 4.7.1 does not give it a meaning, and no writer is known to emit it. - The spec's own output connect,
<connect to=".Root_Model_Input" from="Sub_Model.Output"/>(section 4.7.1), also warnsbad_module_input_dst. Simlin reads module outputs through equations (Sub_Model.Output), not connects.
Fix
Classify connects in the XMILE reader:
- drop a connect whose
tois another module's input (Stella's second copy; the target module carries the binding one); - keep the module-to-itself connect as a warning, and state in
bound_port's rustdoc that it is treated as malformed; - for an output connect, either turn it into an equation on the parent variable or reject it with a clear message; rejecting is fine until a real file needs it.
Pointers
src/simlin-engine/src/xmile/model.rs:impl From<Module> for datamodel::Modulesrc/simlin-engine/src/db/diagnostic.rs:model_module_wiring_diagnosticssrc/simlin-engine/src/db/assemble.rs:bound_portsrc/simlin-engine/src/db/module_wiring_tests.rs- xmile: spec-form bare <connect to="Input"> leaves module input unwired #1053: the spec's bare
to="Input"spelling; same function, fix together
Activity
bpowers commentedon Sep 4, 2026
The "Related but distinct" paragraph (the spec example's BARE
<connect to="Input" .../>) is now filed as #1053. It is independent of this issue's answer -- whichever reading settles the same-instance source, section 4.7.1'sto="Input"must bindSub_Model'sInput-- but both touchmodel_module_wiring_diagnostics, so the arms should be settled in one pass with each citing its 4.7.1 sentence. Two corrections to the premise recorded here: the corpus DOES hold a bare-tofile,test/test-models/samples/bpowers-hares_and_lynxes_modules/model_legacy.stmx, written by Stella 10.0.6 with Stella'soutput.csvbeside it (no test reads it and the reader cannot parse its pre-1.0 draft container), and the spec's form is not only warned: with Stella's placeholder-comment input ports the model is refused withempty_equation. Details and CLI repros in #1053.[-]engine: same-instance XMILE <connect> (from=bridge.output to=bridge.input) has no settled meaning; binds nothing + BadModuleInputSrc warning since V9a-2[/-][+]xmile: Stella module-to-module connects raise a false wiring warning[/+]