[SERVER-19677] Intel library self-check in unit tests Created: 09/Jul/15  Updated: 24/Apr/17  Resolved: 22/Mar/17

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 3.4.5, 3.5.5

Type: Task Priority: Critical - P2
Reporter: David Hatch Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: decimal-data-type
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-19622 Vendorize Intel DFP math library for ... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v3.4
Sprint: Platforms 2017-03-27
Participants:

 Description   

We would like the intel library to be tested, since it is prone to mis-compilation which could cause decimal arithmetic in mongo to be incorrect. There is an extensive test suite that comes with the library, and runs quite quickly (a few seconds). The intel built in test compiles to a standalone executable. It's not clear how to best integrate into our test suite. We could execute it from a CppUnitTest, or have a separate scons target that is a standalone task on evergreen.

The self tests are located at: src/third_party/IntelRDFPMathLib20U1/TESTS/readtest.c and use readtest.in as the input. They should be built using the same flags as the library, libm must be included on some platforms as well for proper functionality.

Ideally these would be integrated into the unittest task, however they currently have minor failures on some systems that must be resolved by changing compilation or skipped:

  • win64: bid32_sin fails on a edge case. Not an issue as we do not need this function.
  • win32: some inaccuracies with bid128_pow when returning inexact results. There are tests which check that the error is expected for this function, these are failing. We are not sure if the issue is related to mis-compilation, or is a problem with the platform's pow implementation (used underneath bid128_pow).

Besides these systems, the self-tests have been confirmed to pass on all other evergreen targets.



 Comments   
Comment by Githook User [ 24/Apr/17 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-19677 Add support for running the intel decimal library test

(cherry picked from commit b38e0199d04a6b4516566be71c819e612801c365)

Note that we are only cherry-picking back the error detected in the
Intel library, not the framework for executing the tests. Running the
library tests on master should be sufficient to ensure coverage.
Branch: v3.4
https://github.com/mongodb/mongo/commit/43282b5fdfae01a3fae496437b88ac9544cb6fba

Comment by Githook User [ 22/Mar/17 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-19677 Add support for running the intel decimal library test
Branch: master
https://github.com/mongodb/mongo/commit/b38e0199d04a6b4516566be71c819e612801c365

Comment by Andrew Morrow (Inactive) [ 14/Mar/17 ]

I think an easier way to go about this might be to just build the test as a regular program, "install it", and then register a python script as the unit test, which python script would simply invoke the test runner with its stdin set to the test file. We have all of the pieces to do that, basically.

However, I tried running this test yesterday, and it doesn't work. In fact, ASAN shows memory corruption inside the decimal library, with at least one long write. So, I actually think that it is critical that we get this test passing and integrated in our CI loop.

Generated at Thu Feb 08 03:51:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.