Skip to content

MSL gap fixes, external objects freed, VSS and recompilation, release workflow (0.5.5) - #86

Merged
JKRT merged 37 commits into
masterfrom
msl-gaps
Oct 14, 2026
Merged

JKRT merged 37 commits into
masterfrom
msl-gaps

Conversation

@JKRT

@JKRT JKRT commented Oct 14, 2026

Copy link
Copy Markdown
Member

Fixes from an MSL coverage stretch (OMLibraryTesting, the failing models rerun), external objects freed with their build, VSS and recompilation, and a release workflow.

  • Lowering: function record locals and arrays of records, tuple equations (records, array outputs, free parameters at the initialization), semiLinear chains, terminal() in vector whens, nested initial ifs, late initial algorithms, parameter starts, derivatives of Inline functions, partial applications with records, 3-D tables, array-call elements, noEvent ifelse, per-relation hysteresis, x = 1/y oriented, coupled free parameters, enumeration inputs.
  • Simulation: asserts at a boundary at the start, the step-size reset after the last tstop, a Modelica function's error in the right-hand side rejects the step, requested parameters kept.
  • External objects (tables): a table of one name in two models no longer reads the first model's (since 0.5.4); freed by their destructors with their build (a new translate, a failed build, a module evaluated again, clearCaches!, forgetModel).
  • VSS: tables (any Modelica function) in structural modes; a structural module evaluated again after a translate; overwriteCache without a wasted build. Recompiled models with functions and tables (a module of their own in the model's), with libraries (the frontend's program, translate's SimCode passes: mtkSimCode), start values by full name (a MultiBody model's recompiled system was unbalanced).
  • Release workflow: a push to master that bumps the version in Project.toml tags and releases it and starts the registry's auto-update (with a REGISTRY_DISPATCH_TOKEN secret; else the daily run).

Checked locally: tests 454/454; OM.jl 1539 pass, 6 broken; MSL validate 3.2.3 347/425, 4.1.0 366/534 (CI 314/343).

Version 0.5.5; compat OMFrontend 1.7.3 (OpenModelica/OMFrontend.jl#104, same branch).

🤖 Generated with Claude Code

JKRT added 30 commits October 13, 2026 20:12
A protected record set by modifiers (MSL R134a getPhase_ph) declared its
fields unset; field defaults keep their scope prefix (b = 2 * a reads w.a).

Assisted-by: Claude Opus 5.5
…eters

A parameter bound to not Qini (MSL RSFlipFlop) was "not a constant".

Assisted-by: Claude Opus 5.5
At zero flow they hold for any intermediate slope; MSL Media's test models
(ShortPipe to FixedAmbient) went Unstable at the first step.

Assisted-by: Claude Opus 5.5
…cord literal arguments by field

MSL Spice3 Graetz: (D1.cc, D1.m_dCap) = diodeNoBypassCode(...) left D1_cc
unresolved and the tuple residual unlowered; a folded record parameter went
to the function as a NamedTuple.

Assisted-by: Claude Opus 5.5
…as elimination

-y = semiLinear(x, a, b) is y = semiLinear(-x, b, a): a massless FluidHeatFlow
pump between ambients forms such a chain.

Assisted-by: Claude Opus 5.5
Fields as arrays from the binding or zero-filled; element reads, writes and
field access through the body's record map (MSL ReferenceAir Ice09 Gibbs).

Assisted-by: Claude Opus 5.5
MSL 4 ContinuousSignalExtrema read an undefined terminal.

Assisted-by: Claude Opus 5.5
MSL 4 SoftStarter: FieldError (INLINE_IF_EQUATION has no field lhs).

Assisted-by: Claude Opus 5.5
…roblem

MSL PumpingSystem (TriggeredTrapezoid) read initial; MSL 4 DCPowerSupply
read vLim, set by its initial algorithm.

Assisted-by: Claude Opus 5.5
…m parameter expressions

MSL 4 lightning examples (start reading another parameter); RobotR3's
BearingFriction table from tau_pos = [0, Rv0 / unitTorque; ...].

Assisted-by: Claude Opus 5.5
IF97 rho_ph := rho_props_ph(p, h, waterBaseProp_ph(...)): MeasuringTemperature's
index reduction had no derivative of rho_ph (omc inlines it first).

Assisted-by: Claude Opus 5.5
MSL 4 RobotR3: BoundsError in first_tstop at the event that ends its path.

Assisted-by: Claude Opus 5.5
The bound value comes boxed; unbox it and splat its field tuple (MSL 4 Inverse_sh_T).

Assisted-by: Claude Opus 5.5
MSL Digital MUX2x1Table[4, 4, 4] stayed a Vector{Matrix}: BoundsError at [1, 3, 1].

Assisted-by: Claude Opus 5.5
With symbolic arguments an array whose size follows the arguments was one opaque term
(MSL PlanarLoops_analytic: normalizeWithAssert(n)[2], a BoundsError).

Assisted-by: Claude Opus 5.5
… branch

The arithmetic lowering turned the other branch's NaN into the result (MSL ContinuousMean:
the Noise examples Unstable at the first step). A Boolean held as a Real is true above 1/2.

Assisted-by: Claude Opus 5.5
… own operands

One scale for all made it relative to the largest operand: MSL Spice3 V_pulse (PW = 1e60)
kept time < TD true after TD, the inverters' input stayed at 0 V.

Assisted-by: Claude Opus 5.5
…xplicit fold

Folded as x := 1/y, x's other equation determined y nonlinearly and the initialization's
Newton diverged (MSL 4 FluxTubes QuadraticCoreAirgap, both variants; now as omc).

Assisted-by: Claude Opus 5.5
…dual initial equations give no variable a value

MSL 4 SMPM_ResistiveBraking: two residuals for idq_sr were read as two values of a variable
named 0.0 (refused), and one equation at a time the free parameters kept their start values.

Assisted-by: Claude Opus 5.5
…, as before

The parameter binding's call is then evaluated once for all its elements (a regression of
f29fe9a: Borefields' impure g-function was called per element).

Assisted-by: Claude Opus 5.5
…cided at the next check

MSL TanksWithEmptyingPipe1/TankWithEmptyingPipe2: level_start = height, the level from the
mass 2 + 4e-16 failed level <= height at t = 0, or not, by run.

Assisted-by: Claude Opus 5.5
…inations

A validation's reference signal folded to a parameter (MSL ShowTransferFunction's const.y)
could not be read from the solution.

Assisted-by: Claude Opus 5.5
From the integrator they arrived as Float64 (MSL Digital RAM's Logic tables: invalid index
1.0; now as the reference and omc).

Assisted-by: Claude Opus 5.5
…one-sided partials at a domain boundary

As OpenModelica's solvers: MSL MeasuringTemperature's IF97 region error at a relation
crossing's re-evaluation of the step's start no longer ends the run (now as the reference).
A persistent error is thrown when the solve fails. MTK path; the array path is unchanged.

Assisted-by: Claude Opus 5.5
DirectRHSGeneration.jl is included before asserts.jl: the package did not load (5b467a2).

Assisted-by: Claude Opus 5.5
Positional options are not Modelica (omc: no matching function); OMFrontend 1.7.x refuses them.

Assisted-by: Claude Opus 5.5
A RuntimeGeneratedFunction's id is the SHA1 of its printed body and its cache is global:
two builds differing only in the object got the first build's function and table.

Assisted-by: Claude Opus 5.5
Assisted-by: Claude Opus 5.5
… at the initialization

MSL Blocks.Continuous.Filter's poles were 0 and its states did not move (SMEE_Rectifier, ThreePhaseTwoLevel_PWM).

Assisted-by: Claude Opus 5.5
JKRT added 7 commits October 14, 2026 10:45
Each build's tables stayed allocated for the session. Objects are told apart by a serial
number, not their address, which a freed table passes on.

Assisted-by: Claude Opus 5.5
A VSS model with a table in a mode did not simulate: the modes' SimCode had no
functions (unqualified calls), and the module assigned only the top level's
data structures and parameters. The modes now get the model's functions, the
module assigns their data structures (after the parameters they read), owned
by the model's build. simulateIMTK evaluates a structural module again after a
translate (it kept the first one); a module evaluated again frees the replaced
module's external objects (forgetBuild, or the objects in _buildAndCache).

Assisted-by: Claude Opus 5.5
A model recompiled during its simulation got no functions (the frontend's
cache was dropped) and was evaluated in the Runtime module, without the
parameters and data structures its code reads at module level: an
UndefVarError at the first Modelica function or table. The recompiled SimCode
now gets the model's functions (record call sites flattened), and its code is
a module Recompiled in the model's module with its functions, parameters and
tables, owned by the model's build.

Assisted-by: Claude Opus 5.5
_buildAndCache built the active mode's problem (a full build) and failed to
put it into BUILT (a caught MethodError); the module's simulate built it
again. A module without simulateFromBuild is now only evaluated.

Assisted-by: Claude Opus 5.5
…anslate's passes

The recompiled program was the modified class alone (no MSL), and the
recompiled SimCode went through four of the SimCode passes (a MultiBody
model's redundant equation stayed). Now the modified class with the classes the
model was instantiated with (OMFrontend.recompilationProgram, compat OMFrontend
1.7.3), and mtkSimCode: the MTK path's SimCode pipeline, out of translate. The
recompiled problem's init and reinit! run in the latest world (its module's
closures: an MSL table's time-event affect).

Assisted-by: Claude Opus 5.5
updateInitialConditions! matched every variable by its name without the
first `_` segment (body_frame_a_f took revolute_frame_a_f's value), fixed it
and replaced its attributes: a MultiBody model's recompiled system was
unbalanced. Now by full name, start only; by the name without the component
only when no full name matches and one old variable has it (a dynamic
transition: the ball's y from the pendulum's), fixed as before.

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.

1 participant