From 79d953165ae8f506c594b1af4d84ee59363da55c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sj=C3=B6lund?= Date: Wed, 18 Nov 2026 21:14:48 +0100 Subject: [PATCH] Compare with the rectangle tube by default The omc nightly of 2026-11-18 has the tube argument of diffSimulationResults and the fixes of the csv-compare tubes at the reference points (OpenModelica/OpenModelica#18128) and at the start and stop time (OpenModelica/OpenModelica#18152). Verify with that nightly, and use the rectangle tube when a library sets no reference_tube. ModelicaTest 4.0.0 uses Modelica 4.0.0, but loadModel takes the newest compatible version, Modelica 4.1.0. The reference files are from MSL 4.0.0. Require the exact version, as the Modelica 4.0.0 entry does. Assisted-by: Claude Opus 5.5 --- .CI/Jenkinsfile | 4 ++-- .CI/testing/Dockerfile | 2 +- README.md | 2 +- configs/conf.json | 1 + shared.py | 7 +++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.CI/Jenkinsfile b/.CI/Jenkinsfile index 50c439fe..8005286d 100644 --- a/.CI/Jenkinsfile +++ b/.CI/Jenkinsfile @@ -40,8 +40,8 @@ pipeline { choice(name: 'pull_request_solver', choices: ['default', 'gbode', 'cvode', 'ida'], description: 'The solver a pull request is simulated with: default is the one each model asks for, the others are the configs/solvers.json entries of that name. With the C target, the baseline is then that solver\'s table, which the solvers job fills; nothing fills one for wasm-jit, so set pull_request_baseline yourself or compare against the default solver.') string(name: 'pull_request_simflags', defaultValue: '', description: 'Simulation flags appended to every model\'s, after those of pull_request_solver, e.g. -gbm=esdirk3 to run gbode with another method.') string(name: 'pull_request_baseline', defaultValue: '', description: 'The branch a pull request is compared against. Left empty, the one pull_request_target is tested by: wasm-jit for wasm-jit, master for C, or for C with a pull_request_solver its own table. Its newest run has to come from pull_request_node, or the report compares the machines as much as the pull request.') - choice(name: 'pull_request_verifier', choices: ['nightly', 'pull request'], description: 'The omc that test.py and testmodel.py run through OMPython, which lists the models and compares the results with the reference files (diffSimulationResults): the nightly of the testing image, as for every other run, or the omc built from the pull request, to test a change of the comparison itself. A reference_tube in the configuration needs an omc that has the tube argument.') - choice(name: 'pull_request_tube', choices: ['default', 'rectangle', 'ellipse', 'ellipse2014'], description: 'The tube diffSimulationResults compares a pull request\'s results with: default is the reference_tube of each library, the others override it. Anything but default needs pull_request_verifier set to pull request until the nightly has the tube argument.') + choice(name: 'pull_request_verifier', choices: ['nightly', 'pull request'], description: 'The omc that test.py and testmodel.py run through OMPython, which lists the models and compares the results with the reference files (diffSimulationResults): the nightly of the testing image, as for every other run, or the omc built from the pull request, to test a change of the comparison itself.') + choice(name: 'pull_request_tube', choices: ['default', 'rectangle', 'ellipse', 'ellipse2014'], description: 'The tube diffSimulationResults compares a pull request\'s results with: default is the reference_tube of each library, the others override it.') string(name: 'pull_request_config', defaultValue: 'configs/conf.json', description: 'What a pull request run tests. A full run takes days, so a smaller configuration file is often the better question to ask.') choice(name: 'pull_request_node', choices: ['ryzen-9950x', 'ryzen-5950x-1', 'ryzen-5950x-2-1', 'r7945-1'], description: 'The machine a pull request runs on. The default is the one that produces the master and wasm-jit runs it is compared against.') booleanParam(name: 'pull_request_comment', defaultValue: false, description: 'Post the summary of a pull request run as a comment on the pull request, replacing the one an earlier run posted. Needs an OpenModelica-Hudson credential; without it the report is still written and published, only not commented.') diff --git a/.CI/testing/Dockerfile b/.CI/testing/Dockerfile index ed012fed..7fb65e19 100644 --- a/.CI/testing/Dockerfile +++ b/.CI/testing/Dockerfile @@ -54,7 +54,7 @@ ENV PATH=/opt/libtest-venv/bin:$PATH # The omc for --ompython_omhome (the tested one is built in the workspace). ARG OMC_VERSION= -ARG OMC_NIGHTLY=2026-11-11 +ARG OMC_NIGHTLY=2026-11-18 RUN export DEBIAN_FRONTEND=noninteractive \ && echo "omc nightly ${OMC_NIGHTLY}" \ && . /etc/os-release \ diff --git a/README.md b/README.md index 48092fa4..08ff1b4f 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ different OpenModelica versions, according to the conditions of the "git-ref": "main", "git-directory": "ReferenceFiles" }, - "reference_tube": "rectangle", // diffSimulationResults(tube=OpenModelica.Scripting.TubeAlgorithm.): rectangle, ellipse or ellipse2014 (when left out); needs an omc that has the tube argument + "reference_tube": "rectangle", // diffSimulationResults(tube=OpenModelica.Scripting.TubeAlgorithm.): rectangle (when left out), ellipse or ellipse2014 "reference_tolerance": 0.002, // rangeDelta of the rectangle and ellipse tubes (csv-compare's --tolerance); when left out, the default of diffSimulationResults, which is csv-compare's; ellipse2014 uses reference_rangeDelta "defaultTolerance": 1e-6, // tolerance for tests if not specified by the model, defaults to 1e-6 "defaultNumberOfIntervals": 2500, // number of intervals for tests if not specified by the model, defaults to 2500 diff --git a/configs/conf.json b/configs/conf.json index 17c45a77..55ade757 100644 --- a/configs/conf.json +++ b/configs/conf.json @@ -70,6 +70,7 @@ { "library":"ModelicaTest", "libraryVersion":"4.0.0", + "libraryVersionExactMatch":true, "referenceFileExtension":"csv", "referenceFileNameDelimiter":"/", "referenceFileNameExtraName":"$ClassName", diff --git a/shared.py b/shared.py index 53f094f9..2666517e 100644 --- a/shared.py +++ b/shared.py @@ -37,15 +37,13 @@ def simCodeTargetFromCommands(target, commands): def diffSimulationResultsOptions(conf): """The named arguments of the diffSimulationResults call that verifies a result.""" opts = [("relTol", conf["reference_reltol"]), ("relTolDiffMinMax", conf["reference_reltolDiffMinMax"])] - tube = conf.get("reference_tube") + tube = conf["reference_tube"] # Without reference_tolerance, the csv-compare tubes get the default of diffSimulationResults, which is csv-compare's. if tube not in ("rectangle", "ellipse"): opts.append(("rangeDelta", conf["reference_rangeDelta"])) elif "reference_tolerance" in conf: opts.append(("rangeDelta", conf["reference_tolerance"])) - # Only passed when set: an omc without the tube argument fails the call. - if tube: - opts.append(("tube", tube)) + opts.append(("tube", tube)) return opts def fixData(data,abortSimulationFlag,alarmFlag,overrideDefaults,defaultCustomCommands,extrasimflags,environmentTranslation,environmentSimulation): @@ -63,6 +61,7 @@ def fixData(data,abortSimulationFlag,alarmFlag,overrideDefaults,defaultCustomCom data["reference_reltol"] = float(data.get("reference_reltol") or 3e-3) data["reference_reltolDiffMinMax"] = float(data.get("reference_reltolDiffMinMax") or 3e-3) data["reference_rangeDelta"] = float(data.get("reference_rangeDelta") or 1e-3) + data["reference_tube"] = data.get("reference_tube") or "rectangle" if data["simCodeTarget"]=="Cpp": defaultCustomCommands2 = defaultCustomCommands[:] defaultCustomCommands2.append('setCommandLineOptions("--simCodeTarget=Cpp")')