Skip to content

engine: dimension name in a different case from its declaration fails #1018

Open

Description

@bpowers

A variable declared over a dimension spelled in different case from the dimension's own declaration (variable over dima, dimension declared DimA) fails with bad_dimension_name.
Everywhere else the engine matches names case- and separator-insensitively, so this should resolve.

Example

Project dimension DimA = {a1, a2}; variable x whose equation is apply-to-all over dima.
Expected: x has two elements.
Actual: x's dimension does not resolve.
This is from code reading; it has not been reproduced with a model.

Why it matters

Seen only in constructed cases.
It needs a variable whose dimension list is spelled differently from the declaration, which a hand-edited XMILE file, a JSON/MCP edit, or an importer that canonicalizes one side but not the other could produce; whether any importer does today is unknown.
The bug is a plain inconsistency, and the fix is small.

Fix

Before parsing a variable, the engine narrows the project's dimensions to the ones the variable is declared over (plus anything reachable through dimension mappings), so editing an unrelated dimension does not invalidate every cached parse.
That filter compares the variable's dimension names as written against each dimension's display name with exact string equality.
Names reached through a mapping are converted to display names first; the variable's own names are not.

Compare canonical names on both sides of the filter (or map the variable's names through the same canonical-to-display table the mapping targets use).
Do it in both copies of the filter, which must stay identical, and add one test with a case-differing dimension that is not reachable through a mapping.

Pointers

  • src/simlin-engine/src/db/query.rs: parse_source_variable and variable_dimensions (the two filters), variable_relevant_dimensions
  • src/simlin-engine/src/db/sync.rs: expand_maps_to_chains
  • src/simlin-engine/src/db/dimension_invalidation_tests.rs

Activity

  1. added
    engine
    on Aug 10, 2026
  2. changed the title [-]engine: the per-variable dimension narrowing matches raw equation spellings against display names, so a case-differing dimension reference is dropped before canonical matching[/-] [+]engine: dimension name in a different case from its declaration fails[/+] 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

    bugengine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions