Skip to content

engine: period in a variable name breaks references from XMILE or the editor #702

Open

Description

@bpowers

A variable whose name contains a literal period, such as Goal 1.5 for Temperature, probably cannot be referenced when it comes from an XMILE file or is created in the editor.
The variable's own name and a quoted reference to it canonicalize to two different strings, so the reference fails with DoesNotExist.
This is traced from the code and has not been reproduced.

Example

<aux name="Goal 1.5 for Temperature"><eqn>1.5</eqn></aux>
<aux name="y"><eqn>"Goal 1.5 for Temperature" + 1</eqn></aux>

Expected: y = 2.5.
Traced behavior: y fails with DoesNotExist.

The XMILE reader and the editor store the name as written.
canonicalize reads an unquoted . as a module separator and maps it to · (U+00B7), so the variable is keyed goal_1·5_for_temperature.
The quoted reference maps its . to the literal-period marker ‥ (U+2024) and looks up goal_1‥5_for_temperature.
MDL import avoids this because it wraps such names in quotes, and stored projects avoid it because loading rewrites a stored . to U+2024.

Why it matters

C-LEARN has "Goal 1.5 for Temperature"; it works today only because it arrives through MDL.
No XMILE file or editor session has been seen to hit this.
Whether Stella writes names containing periods is unverified.

Fix

A . in a name field can only be literal.
Add one name-context canonicalization (. becomes U+2024) and use it everywhere a stored variable name, view-element name, or group member becomes an ident.
That one function also fixes the diagram mismatch in #704.
Alternative: refuse names containing . in the XMILE reader and the editor with a clear error; cheaper, but it would also refuse C-LEARN's names if they ever arrive through XMILE.

Pointers

Activity

  1. added
    bug
    on Jun 3, 2026
  2. added
    engine
    on Oct 12, 2026
  3. changed the title [-]engine: freshly imported/created period-named variables may fail to simulate at HEAD (XMILE-name + JSON ident boundaries skip name-context canonicalization, unlike the #690 serde fix)[/-] [+]engine: period in a variable name breaks references from XMILE or the editor[/+] 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

    bugengine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions