Skip to content

xmile: spec-form bare <connect to="Input"> leaves module input unwired #1053

Open

Description

@bpowers

XMILE 1.0 section 4.7.1 writes a module input connection with a bare to naming the submodel's input: <connect to="Input" from=".Root_Model_Output"/> on <module name="Sub_Model">.
Simlin only wires the form newer Stella writes, to="Sub_Model.Input".
The bare form binds nothing: the module runs on its input's default equation, with a false warning ("input wiring target 'input' does not name an input of model 'sub_model'"), and if the input carries Stella's placeholder equation the whole model is refused.

Example

<model><variables>
<module name="Sub_Model">
  <connect to="Input" from=".Root_Model_Output"/>
</module>
<aux name="Root_Model_Output" access="output"><eqn>7</eqn></aux>
<aux name="reader"><eqn>Sub_Model.Output</eqn></aux>
</variables></model>
<model name="Sub_Model"><variables>
<aux name="Input" access="input"><eqn>0</eqn></aux>
<aux name="Output" access="output"><eqn>Input * 2</eqn></aux>
</variables></model>

Expected reader = 14; actual 0 plus the warning above.
With to="Sub_Model.Input" it gives 14.
With Input's equation set to Stella's {Enter equation for use when not hooked up to other models}, the bare form fails with empty_equation and not_simulatable.

Why it matters

A spec-conformant file using the spec's own example spelling is silently miswired or refused.
Stella 10.0.6 wrote the bare form (test/test-models/samples/bpowers-hares_and_lynxes_modules/model_legacy.stmx), but that file is pre-1.0 draft XMILE Simlin cannot read, and every other <connect> in test/ uses the qualified form.
So no model we can open today hits this.

The test bare_dst_warns asserts the bare form must warn; it guards an old editor bug but also forbids the spec's form.

Fix

Qualify at the XMILE reader: in impl From<Module> for datamodel::Module, rewrite a to with no module prefix to {module}·{to}, so the rest of the engine keeps one internal form.
A to="a.b" where a is not this module is the spec's nested-submodel form, which Simlin does not support; keep warning, with a message that says so.
Add a reader test for the spec example and cite section 4.7.1 in port_of's rustdoc.
Do not change the writer: whether current Stella reads the bare form is unverified.

Alternative: accept a bare dst everywhere (port_of plus the rename paths in patch.rs); wider, but would also cover bare dst rows that the JSON/pysimlin upsert_module path stores today.

Pointers

  • src/simlin-engine/src/xmile/model.rs: impl From<Module> for datamodel::Module
  • src/simlin-engine/src/db/assemble.rs: port_of, bound_port
  • src/simlin-engine/src/db/diagnostic.rs: model_module_wiring_diagnostics
  • src/simlin-engine/src/db/module_wiring_tests.rs: bare_dst_warns
  • xmile: Stella module-to-module connects raise a false wiring warning #1048: other <connect> shapes the reader does not classify; same function, fix together

Activity

  1. added
    engine
    compat
    on Oct 12, 2026
  2. changed the title [-]engine: XMILE 1.0 section 4.7.1 bare <connect to="Input"> (the spec's own module-input spelling; Stella 10.0.6 writer) binds no port -- BadModuleInputDst warning, empty_equation refusal; only Stella's module-qualified to= wires[/-] [+]xmile: spec-form bare <connect to="Input"> leaves module input unwired[/+] on Oct 12, 2026
  3. added
    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