Skip to content

xmile: Stella module-to-module connects raise a false wiring warning #1048

Open

Description

@bpowers

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"/> on bridge) binds nothing and warns bad_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 warns bad_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 to is 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::Module
  • src/simlin-engine/src/db/diagnostic.rs: model_module_wiring_diagnostics
  • src/simlin-engine/src/db/assemble.rs: bound_port
  • src/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

  1. bpowers commented on Sep 4, 2026

    @bpowers
    OwnerAuthor

    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's to="Input" must bind Sub_Model's Input -- but both touch model_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-to file, test/test-models/samples/bpowers-hares_and_lynxes_modules/model_legacy.stmx, written by Stella 10.0.6 with Stella's output.csv beside 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 with empty_equation. Details and CLI repros in #1053.

  2. changed the title [-]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[/+] on Oct 12, 2026
  3. added
    engine
    compat
    bug
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcompatengine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions