Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing test on ARM by rounding small values to 0 #29052

Merged
merged 2 commits into from Mar 2, 2020

Conversation

cvuosalo
Copy link
Contributor

Certain units tests are failing on the ARM architecture because tiny floating-point values near 0 are slightly different than on the standard CPU, as described in issue #29036.

To fix this problem, the printed values used for comparison will be rounded to 0 if they are less than 1e-7. The internal values will not be changed, only the printed values used to compare the test results and the baseline reference file, which is being updated.

This change means the DT Geometry unit test will be less sensitive to small differences in norm vector values near zero, which could possibly mean it might miss a real problem, but the current test is too sensitive in failing because of 1e-16 fluctuations. I think the version of the test in this PR is sufficiently sensitive to catch real errors while avoiding false positives.

This PR adds a new utility file Rounding.h. I looked to see if a function to round values near 0 already exists, but I couldn't find one, so I added this new file. If there is already such a rounding function, or if I put the new file in the wrong place, this PR can be revised.

PR validation:

The unit test should now be platform-independent. I hope this PR can be tested against the ARM IB because I have not be able to test the code change on an ARM machine.

No backport is needed.

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-29052/13922

  • This PR adds an extra 76KB to repository

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-29052/13923

  • This PR adds an extra 76KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @cvuosalo (Carl Vuosalo) for master.

It involves the following packages:

DataFormats/Math
Geometry/DTGeometryBuilder

@perrotta, @civanch, @Dr15Jones, @makortel, @cvuosalo, @ianna, @mdhildreth, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@makortel, @felicepantaleo, @rovere this is something you requested to watch as well.
@davidlange6, @silviodonato, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@cvuosalo
Copy link
Contributor Author

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 26, 2020

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/4908/console Started: 2020/02/27 00:01

@cmsbuild
Copy link
Contributor

+1
Tested at: 1d471a1
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b46a4f/4908/summary.html
CMSSW: CMSSW_11_1_X_2020-02-26-1100
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

Comparison job queued.

@ianna
Copy link
Contributor

ianna commented Feb 27, 2020

please test for slc7_aarch64_gcc820

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 27, 2020

The tests are being triggered in jenkins.
Test Parameters:

@cmsbuild
Copy link
Contributor

+1
Tested at: 1d471a1
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b46a4f/4913/summary.html
CMSSW: CMSSW_11_1_X_2020-02-26-2300
SCRAM_ARCH: slc7_aarch64_gcc820

@cmsbuild
Copy link
Contributor

Comparison job queued.

@ianna
Copy link
Contributor

ianna commented Feb 27, 2020

+1

@cvuosalo
Copy link
Contributor Author

@ianna It looks like you changed your mind about generating the reference file on-the-fly. Could you please delete your comment about it, or add a comment saying so? I wouldn't want any reviewers to be confused.

@ianna
Copy link
Contributor

ianna commented Feb 27, 2020

@cvuosalo - IMHO, the reference file should be generated on the fly, but ultimately, it's your decision how high this is on the priority list.

@cvuosalo
Copy link
Contributor Author

type bugfix

@cvuosalo
Copy link
Contributor Author

@ianna I will leave the PR as it is for now. I think on-the-fly generation of the reference file is lower priority than other issues I need to work on.

@perrotta
Copy link
Contributor

perrotta commented Mar 2, 2020

+1

  • A new function is added ti DataFormats/Math to round up to zero small values (default below 10-7)
  • That function is used in some DT Geometry unit tests, whose reference file I'd let the Geometry conveners to decide whether has to be generated on the fly, or not
  • Jenkins tests pass

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 2, 2020

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @davidlange6, @silviodonato, @fabiocos (and backports should be raised in the release meeting by the corresponding L2)

@silviodonato
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 61014d4 into cms-sw:master Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants