Skip to content

Mark models with non-standard Modelica as invalid - #427

Merged
sjoelund merged 2 commits into
masterfrom
nonstandard-modelica
Nov 17, 2026
Merged

sjoelund merged 2 commits into
masterfrom
nonstandard-modelica

Conversation

@sjoelund

Copy link
Copy Markdown
Member

Some libraries were tested with --allowNonStandardModelica and others were not. Thus the overviews counted some non-standard models as working, and did not show how far the others would get.

Testing:

  • test.py adds --warnNonStandardModelica to the default commands if omc accepts it, and the configurations no longer set --allowNonStandardModelica.
  • testmodel.py finds the "[Non-standard Modelica: ...]" tag in the messages of omc and writes the options to .stat.json.
  • Each branch table gets the column invalid (sqlite user_version 6).

Library reports put a red cross before the name of an invalid model and give the number of invalid models.

Overviews:

  • The newest run of master on each library says which models are invalid; --invalid-branch selects another branch, for the libraries that master does not test.
  • The counts and times leave out the invalid models. Buttons at the top show them included, or only them.
  • The "Now working in ..." tooltips are removed, and one query reads the rows of a library and branch.
  • New style sheet.

Merge this only after a nightly omc has --warnNonStandardModelica.

Fixes #426.

Assisted-by: Claude Opus 5.5

Some libraries were tested with --allowNonStandardModelica and others
were not. Thus the overviews counted some non-standard models as
working, and did not show how far the others would get.

Testing:
- test.py adds --warnNonStandardModelica to the default commands if
  omc accepts it, and the configurations no longer set
  --allowNonStandardModelica.
- testmodel.py finds the "[Non-standard Modelica: ...]" tag in the
  messages of omc and writes the options to .stat.json.
- Each branch table gets the column invalid (sqlite user_version 6).

Library reports put a red cross before the name of an invalid model
and give the number of invalid models.

Overviews:
- The newest run of master on each library says which models are
  invalid; --invalid-branch selects another branch, for the libraries
  that master does not test.
- The counts and times leave out the invalid models. Buttons at the
  top show them included, or only them.
- The "Now working in ..." tooltips are removed, and one query reads
  the rows of a library and branch.
- New style sheet.

Merge this only after a nightly omc has --warnNonStandardModelica.

Fixes #426.

Assisted-by: Claude Opus 5.5
The overview no longer puts each count in <a>, and </table> is now on
the next line. Thus the grep in the workflow did not find the row, and
all four jobs failed, although both models simulated and verified.

Assisted-by: Claude Opus 5.5
@sjoelund
sjoelund merged commit 4c7e384 into master Nov 17, 2026
7 checks passed
@sjoelund
sjoelund deleted the nonstandard-modelica branch November 17, 2026 17:10
sjoelund added a commit to sjoelund/OpenModelica that referenced this pull request Nov 18, 2026
With nonStdIntegersAsEnumeration, an Integer is cast to the
enumeration that is expected. Expression.typeCast changes an Integer
literal into the enumeration literal with that index. When there is no
such literal, Type.nthEnumLiteral fails. NFTypeCheck did not expect
this failure, thus the instantiation failed with no error message.
When it occurred during the overload resolution in NFCall, the
checkpoint of checkMatchingFunctions also stayed on the stack, and omc
could then abort with an ERROREXT checkpoint error.

There is no literal when the value is out of range, and also when the
expected type is enumeration(:), which has no literals. The first
overload of the builtin String has a parameter of this type. Thus
String(size(x, 1)) and String(3) failed when
--allowNonStandardModelica=nonStdIntegersAsEnumeration or
--warnNonStandardModelica (OpenModelica#18162) was set.
OpenModelica/OpenModelicaLibraryTesting#427 sets
--warnNonStandardModelica for all models, and about 380 models in
Buildings, IBPSA, IDEAS, AixLib and the MSL then failed with
"Instantiation of X failed with no error message".

Now matchTypes and matchExpressions give NOT_COMPATIBLE when typeCast
fails:

- String(3) uses String(Integer), and Integer(3) is a type error, as
  without the option.
- E e = 3, x[3] and 1:3, for an enumeration with two literals, give the
  usual type mismatch errors.
- [E.b, 1] and cat(1, {E.b}, {1}) work. Their element types are
  matched with a dummy Integer 0, which failed in the same way.
- An Integer that is not a literal is cast as before.

printBindingTypeError matches the element types again with an empty
expression to select its message. This match accepts any Integer as an
enumeration. Thus it gave a dimension mismatch for equal dimensions,
and it added the non-standard warning for #EMPTY#. Now it discards the
messages of this match, and it does not give a dimension mismatch when
the dimensions are known to be equal.

Assisted-by: Claude Opus 5.5
sjoelund added a commit to OpenModelica/OpenModelica that referenced this pull request Nov 18, 2026
With nonStdIntegersAsEnumeration, an Integer is cast to the
enumeration that is expected. Expression.typeCast changes an Integer
literal into the enumeration literal with that index. When there is no
such literal, Type.nthEnumLiteral fails. NFTypeCheck did not expect
this failure, thus the instantiation failed with no error message.
When it occurred during the overload resolution in NFCall, the
checkpoint of checkMatchingFunctions also stayed on the stack, and omc
could then abort with an ERROREXT checkpoint error.

There is no literal when the value is out of range, and also when the
expected type is enumeration(:), which has no literals. The first
overload of the builtin String has a parameter of this type. Thus
String(size(x, 1)) and String(3) failed when
--allowNonStandardModelica=nonStdIntegersAsEnumeration or
--warnNonStandardModelica (#18162) was set.
OpenModelica/OpenModelicaLibraryTesting#427 sets
--warnNonStandardModelica for all models, and about 380 models in
Buildings, IBPSA, IDEAS, AixLib and the MSL then failed with
"Instantiation of X failed with no error message".

Now matchTypes and matchExpressions give NOT_COMPATIBLE when typeCast
fails:

- String(3) uses String(Integer), and Integer(3) is a type error, as
  without the option.
- E e = 3, x[3] and 1:3, for an enumeration with two literals, give the
  usual type mismatch errors.
- [E.b, 1] and cat(1, {E.b}, {1}) work. Their element types are
  matched with a dummy Integer 0, which failed in the same way.
- An Integer that is not a literal is cast as before.

printBindingTypeError matches the element types again with an empty
expression to select its message. This match accepts any Integer as an
enumeration. Thus it gave a dimension mismatch for equal dimensions,
and it added the non-standard warning for #EMPTY#. Now it discards the
messages of this match, and it does not give a dimension mismatch when
the dimensions are known to be equal.

Assisted-by: Claude Opus 5.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mark models that need non-standard Modelica as invalid

1 participant