Skip to content

Numeric instability in some tests #11287

@jmarrec

Description

@jmarrec

Issue overview

@mitchute reported a weird test error after making a completely unrelated IDD change in UnitarySystemModel_MultiSpeedDXCoolCoil_Only_NoFan. Turns out I can actually reproduce this in develop, even in Release mode, provided I run the test enough times (I'm on Ubuntu 24.04, gcc 13)

./Products/energyplus_tests --gtest_repeat=50 --gtest_filter=*UnitarySystemModel_MultiSpeedDXCoolCoil_Only_NoFan*

I'll get some failures if I do that (ratio about 1 in 20).

Repeating all tests (iteration 21) . . .

Note: Google Test filter = *UnitarySystemModel_MultiSpeedDXCoolCoil_Only_NoFan*
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from ZoneUnitarySysTest
[ RUN      ] ZoneUnitarySysTest.UnitarySystemModel_MultiSpeedDXCoolCoil_Only_NoFan
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/UnitarySystem.unit.cc:1715: Failure
The difference between thisSys->m_CoolingCycRatio and 0.36056 is 0.0191571141065352, which exceeds 0.001, where
thisSys->m_CoolingCycRatio evaluates to 0.37971711410653519,
0.36056 evaluates to 0.36055999999999999, and
0.001 evaluates to 0.001.
[  FAILED  ] ZoneUnitarySysTest.UnitarySystemModel_MultiSpeedDXCoolCoil_Only_NoFan (90 ms)
[----------] 1 test from ZoneUnitarySysTest (90 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (90 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] ZoneUnitarySysTest.UnitarySystemModel_MultiSpeedDXCoolCoil_Only_NoFan

 1 FAILED TEST

This happens in a function that calls SolveRoot, so I guess there's a numeric instability there. My initial guess was that in some edge case an extra iteration would be required (I have investigated such a problem before) but that's not even what is seemingly happening here.

Anyways, should:

  • Investigate why this specific test fails and see if we can mitigate that
  • Investigate whether other tests are unstable as well

Operating System (Multiple choices)

Any

Operating System Version

N/A

Version of EnergyPlus

25.1.0-IOFreeze

Unmethours link or helpdesk ticket number

N/A

Defect file

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    DefectIncludes code to repair a defect in EnergyPlusDeveloper IssueRelated to cmake, packaging, installers, or developer tooling (CI, etc)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions