Skip to content

Harden simulation and reference comparison validation#29

Merged
AnHeuermann merged 1 commit intomainfrom
harden-ref-comp
Mar 18, 2026
Merged

Harden simulation and reference comparison validation#29
AnHeuermann merged 1 commit intomainfrom
harden-ref-comp

Conversation

@AnHeuermann
Copy link
Member

Issue

Some models seem to pass simulation but aren't producing any results, e.g. Modelica.Blocks.Examples.BusUsage:

grafik

The issue is that the simulation result has no time points at all. Simulation and verification stages should fail in this case.

Changes

  • Fail run_simulate when sol.t is empty or the system has no states or observed variables, preventing empty CSVs and downstream panics
  • Include observed variables in the simulation CSV output so models without state variables (e.g. BusUsage) still produce usable results
  • Fail compare_with_reference (instead of skip) when reference signals are absent from the simulation; write NaN sim/relerr columns for signals with no simulation counterpart
  • Validate upfront that all comparisonSignals.txt entries exist in the reference CSV, and error if the simulation time interval does not cover the reference interval
  • Extend the per-model status line to show a CMP OK/FAIL phase and signal counts including skipped signals

- Fail run_simulate when sol.t is empty or the system has no states
  or observed variables, preventing empty CSVs and downstream panics
- Include observed variables in the simulation CSV output so models
  without state variables (e.g. BusUsage) still produce usable results
- Fail compare_with_reference (instead of skip) when reference signals
  are absent from the simulation; write NaN sim/relerr columns for
  signals with no simulation counterpart
- Validate upfront that all comparisonSignals.txt entries exist in the
  reference CSV, and error if the simulation time interval does not
  cover the reference interval
- Extend the per-model status line to show a CMP OK/FAIL phase and
  signal counts including skipped signals

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AnHeuermann AnHeuermann self-assigned this Mar 18, 2026
@AnHeuermann AnHeuermann merged commit 29aca16 into main Mar 18, 2026
4 checks passed
@AnHeuermann AnHeuermann deleted the harden-ref-comp branch March 18, 2026 13:03
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