FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
0401 — RbCable end forces turn NaN on MSVC Release (RBCable_EndForcesCarryTheWeight); test skipped on Windows
ID 0401
Class BUG
Severity 3
Status ready

Models: RbCable/Cable

Found: 2026-10-19, tag pipeline of v3.0.10 (pipeline 1864178, the Windows Release jobs without visualisation); owner ruling the same day: file a bug and skip the test on MSVC

Evidence

tests/RbCable_Test.cpp:158-178 (SimObject.RBCable_EndForcesCarryTheWeight, the MARE-0010 test) runs RBCable_Damped for 30 s and checks the end forces forceA, forceB at the last sample. In the v3.0.10 tag pipeline it is the only test that fails in the two Windows Release jobs without visualisation (3715169 msvc_192, 3715170 msvc_194). From job 3715169:

RbCable_Test.cpp(173): error: The difference between last("forceA_2") + last("forceB_2") and 4 * 9.81 is nan, which exceeds 1e-2
last("forceA_2") + last("forceB_2") evaluates to nan,
RbCable_Test.cpp(174): error : The difference between last("forceA_1") + last("forceB_1") and 0.0 is nan, which exceeds 1e-2
RbCable_Test.cpp(177): error : Expected: (last("forceA_2")) > (0.0), actual: -nan vs 0
RbCable_Test.cpp(178): error : Expected: (last("forceB_2")) > (0.0), actual: nan vs 0
[ FAILED ] SimObject.RBCable_EndForcesCarryTheWeight (16008 ms)

Lines 175 and 176 (forceA_0, forceB_0 equal to 0.0) pass. The run itself ends normally ("FhSim ended successfully", 16 s of wall time, 15 s CPU); the log has only the two usual warnings (‘Unknown <Integrator> attribute 'LogStates’and'UseRSSNorm') and no integrator message. So the NaN does not stop the solver and is only seen in the output. The same test passes on Linux Release. In Debug builds the test is skipped (SKIP_SLOW_TEST_IN_DEBUG`), so MSVC Debug is unknown. The test never ran on Windows CI before 3.0.10 (earlier Windows jobs failed to compile or on other tests).

The feature seabed-contact changed RbCable shortly before: MARE-0395 (the axial Baumgarte rate axialBaumgarteRate) and MARE-0398 (the joints start up to 7 mm apart, so the rate gives a 1e4 N kick at t = 0). Which one is involved is not known.

Effect

A Windows Release user of RbCable (CableRM) may get NaN in ForceA, ForceB (and probably in the states). Linux results are unchanged. Release 3.0.10 is published without the Windows Release binaries that run the tests. From 3.0.11 the test is skipped when _MSC_VER is defined (SKIP_ON_MSVC_MARE0401 in tests/TestUtils.h), so no other test checks the end forces on MSVC.

Possible fix

Find the first NaN before choosing a fix: run RBCable_Damped on a Windows Release build, log the states and the time of the first non-finite value (which element, which quantity). Suspects, none measured:

  1. The t = 0 joint-gap kick of MARE-0398 together with the axial Baumgarte rate: a 1e4 N impulse could blow up a step differently on MSVC. If so, closing the joints at t = 0 (MARE-0398) may remove it.
  2. An MSVC math difference: acos, asin or sqrt of a value just outside its domain (for example 1.0000000000000002) from rounding gives NaN.
  3. FMA contraction under /arch:AVX2, which changes the rounding of a quantity that is exactly 0 or 1 on Linux. Compare with /fp:precise and contraction off (see MARE-0400).

A guard (clamp the argument to the domain) is only right once the first NaN is found there.

Test that would prove it

SimObject.RBCable_EndForcesCarryTheWeight passes in the two Windows Release jobs of the ME tag pipeline with SKIP_ON_MSVC_MARE0401() removed, and still passes on Linux.

Risk

Low for Linux (unchanged). Until it is fixed, the RbCable end forces are unchecked on MSVC and may be NaN there. Related: MARE-0398 (initial gaps), MARE-0400 (other results that differ on MSVC).