Skip to content

Compare eight more demo cases with stored references in the full test suites - #27

Merged
dav-og merged 2 commits into
devfrom
test/demo-coverage
Dec 3, 2026
Merged

dav-og merged 2 commits into
devfrom
test/demo-coverage

Conversation

@dav-og

@dav-og dav-og commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Summary

run_tests.py --all compares the demo cases of the release package's check with stored references. The demo cases with directional spreading, two-peaked seas, the five-body 5SA, the Wigley hull and the trimaran had no reference, so a change in their results went unnoticed.

This adds run_tests.py --extended: eight more demo cases, 89 body motions, compared with small references in the source tree. CI runs it with the full suites on Linux, macOS and Windows.

Cases

Case What it adds to --all
5sa/spreading, 5sa/bimodal Five hinged bodies with mooring in short-crested and two-peaked seas
wigley/spreading, wigley/damping A free-floating hull in six degrees of freedom
trimaran/rigid Three hulls joined by arms
rm3/regular_waves, rm3/regular_waves_cc RM3 in regular waves, with the radiation convolution and with constant coefficients
oswec/native_pto OSWEC with the built-in power take-off

f3of/irregular_waves is not included: it writes its results outside outputs/, which the runner requires.

References

A full results file of a 5SA case is 265 MB, so the references are reduced:

  • only the time vector and the position and orientation of each body are kept, under the same paths as in a results file;
  • every Nth sample of the run is kept, at about 0.1 s, and N is recorded in the root attribute reference_sample_stride;
  • the values are the run's own samples in double precision; nothing is interpolated or rounded.

The eight references take 4.4 MB together, against about 600 MB for the results files they come from.

The comparison takes every Nth sample of the new run, requires its times to equal the reference's, and applies the same limit as --all (RMS relative error 1e-4). A reference without the attribute is compared sample by sample as before, so the existing cases are unaffected.

Decimation does not weaken the comparison for these signals. The RMS relative error between two builds, on every sample and on every tenth:

Case Every sample Every tenth sample
5sa/spreading 3.742e-10 3.743e-10
rm3/regular_waves 8.84e-6 8.81e-6

Two choices in the signals compared (extended/motion_signals.py):

  • a translation is compared as displacement from its first sample, so that the mean position of a body (up to 160 m along the 5SA) does not enter the relative error;
  • degrees of freedom that stay near zero, such as sway, roll and yaw of the RM3, are left out, because they hold rounding noise.

The references were written by a build of v1.2.0 on Windows. dev has the same sources under libs, adapters and apps.

Known difference on macOS

In the first CI run of this pull request the two 5SA cases failed on macOS (arm64): the surge displacement of the moored bodies differs from the references by 0.6 % (spreading) and 1 % (bimodal) over the 600 s run, and the other motions by up to 8e-4. Linux and Windows agree with the references to 2e-10, and the six cases without mooring agree on macOS to 2e-7. This pull request changes no solver code, so the difference is in the current code; its cause is not yet known and is being followed up separately.

The second commit lists the two cases for macOS in KNOWN_PLATFORM_DIFFERENCES. On macOS they are still run, their signals and sample times must match the reference, and each error is printed as INFO, but the errors do not decide the result; the summary line names them as run but not judged. Linux and Windows judge them as before. The limit and the references are unchanged.

Largest error per case in that run (limit 1e-4):

Case Windows Linux macOS
5sa/spreading 1.1e-10 2.1e-10 5.7e-3
5sa/bimodal 2.3e-12 2.1e-11 9.9e-3
wigley/spreading 3.6e-11 3.5e-10 2.6e-9
wigley/damping 6.1e-12 1.6e-10 1.4e-9
trimaran/rigid 5.2e-13 6.0e-13 4.1e-12
rm3/regular_waves 5.1e-8 8.8e-8 8.3e-8
rm3/regular_waves_cc 2.6e-8 4.7e-8 4.0e-8
oswec/native_pto 1.8e-7 1.9e-7 2.0e-7

The extended step took 518 s on Windows, 565 s on Linux and 464 s on macOS.

Packaging

The references, the list of cases and their documentation are under tests/regression/run_seastack/extended, which is not installed. The release package gains no files, and its RUN-TESTS check runs the same cases as before. In a package, --extended reports that the references are not available.

Validation

Windows:

  • the v1.2.0 build with two threads against the references: 89 of 89 comparisons pass, largest error 1.8e-7;
  • changing one heave signal of a reference by 0.1 % fails the case; a wrong reference_sample_stride fails the case;
  • --all through the modified runner: 15 of 15 cases pass;
  • test_sampled_history.py has a new test for the sample selection.

Linux and macOS are covered by CI: this pull request carries the full-tests label, so the new step runs on all three platforms (results above).

… suites.

run_tests.py --all covers the cases of the release package's check. The
demo cases with directional spreading, two-peaked seas, the five-body 5SA,
the Wigley hull and the trimaran had no stored reference, so a change in
their results went unnoticed.

run_tests.py --extended runs 5sa/spreading, 5sa/bimodal, wigley/spreading,
wigley/damping, trimaran/rigid, rm3/regular_waves, rm3/regular_waves_cc and
oswec/native_pto and compares 89 body motions with references under
tests/regression/run_seastack/extended, with the same limit on the RMS
relative error as --all (1e-4). --case <model>/<case> runs one of them.
Continuous integration runs --extended with the full suites on Linux, macOS
and Windows.

A reference holds only the time vector and the position and orientation of
each body, at every Nth sample of the run (about 0.1 s), and records N in
the attribute reference_sample_stride. The eight references take 4.4 MB;
the results files they come from take about 600 MB. The comparison takes
every Nth sample of the new run and requires its times to equal the
reference's; nothing is interpolated. On 5sa/spreading and
rm3/regular_waves, the RMS relative error between two builds is the same
to two digits on every sample and on every tenth. A reference without the
attribute is compared sample by sample as before. Translations of the new
cases are compared as displacement from the first sample, and degrees of
freedom that stay near zero are left out.

The references were written by a build of v1.2.0 on Windows; dev has the
same sources under libs, adapters and apps. Against them, the same build
with two threads differs by 1.8e-7 at most.

The references and the list of cases are in the source tree only. The
release package gains no files, and its RUN-TESTS check runs the same cases
as before. f3of/irregular_waves
is not included: it writes its results outside outputs/, which the runner
requires.
@dav-og dav-og added the full-tests Run the full test suites on all platforms in CI label Dec 3, 2026
On macOS (arm64) the results of 5sa/spreading and 5sa/bimodal differ from
the references by more than the limit of 1e-4: the surge displacement of the
moored bodies by 0.6 % and 1 % over the 600 s run, and the other motions by
up to 8e-4. Linux and Windows agree with the references to 2e-10, and the
six extended cases without mooring agree on macOS to 2e-7. The solver code
is that of v1.2.0; the cause is not yet known.

motion_signals.py now lists such cases per platform in
KNOWN_PLATFORM_DIFFERENCES. On that platform a listed case is still run,
its signals and sample times must match the reference, and each error is
printed as INFO, but the errors do not decide the result. The summary line
names the cases that were run but not judged, and they are not counted as
passed. The limit and the references are unchanged, and the two cases are
judged on Linux and Windows as before.
@dav-og
dav-og merged commit 41f38ec into dev Dec 3, 2026
8 checks passed
@dav-og
dav-og deleted the test/demo-coverage branch December 4, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-tests Run the full test suites on all platforms in CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant