From f5b754dafe28da7a27a9e96e88abd2fa6448f936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sj=C3=B6lund?= Date: Tue, 17 Nov 2026 07:33:30 +0100 Subject: [PATCH] Export the FMUs with --fmiFilter=internal An FMU run writes only the variables of the modelDescription.xml to the result file. The default --fmiFilter=protected removes all protected variables from it, so -emit_protected cannot add them. simulate() writes them, and the references contain them, for example the protected controlBus of Modelica.Blocks.Examples.BusUsage. Since OpenModelica #17888, diffSimulationResults fails when a variable of the reference is not in the result. Before, it ignored the variable. The wasm-jit-cs run of 2026-11-16 had 1269 such Verify -> Simulate rows that master and wasm-jit verify. - testmodel.py: when the model has a reference, export the FMU with --fmiFilter=internal. This applies to the wasm FMU runners and to the FMI lanes. Tested with a two-model library through test.py --wasmfmu=me,cs: a model that extends BusUsage went from Verify -> Simulate (3 bus signals missing) to verified in both lanes. In a sample of 28 failing rows from 7 libraries, 24 had all missing variables in the modelDescription.xml after the change. The other 4 lacked only names that simulate() also does not write (CPUtime, NonlinearSystems.*, constants), which the verification already skips. Assisted-by: Claude Opus 5.5 --- testmodel.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testmodel.py b/testmodel.py index 7005d91..9305429 100755 --- a/testmodel.py +++ b/testmodel.py @@ -811,6 +811,11 @@ def simulateCmd(resimulate): if conf.get("fmi") and any(shared.fmiVersionOfSimulator(name) == "3.0" for (name, _) in fmisimulators): fmiVersion = "2.0+3.0" +# An FMU result holds only the modelDescription variables, and the default +# --fmiFilter=protected leaves out what -emit_protected writes for simulate(). +if emit_protected and (conf.get("fmi") or useWasmFmu): + sendExpressionOldOrNew('setCommandLineOptions("--fmiFilter=internal")') + start=monotonic() timeout = conf["ulimitOmc"] # If the command has to be killed there is no way to tell which phase it was in,