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 warning in RZLine #40498
Fix warning in RZLine #40498
Conversation
please test |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-40498/33688
|
A new Pull Request was created by @Dr15Jones (Chris Jones) for master. It involves the following packages:
@mandrenguyen, @clacaputo can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
Resolves #39242 |
-1 Failed Tests: ClangBuild Clang BuildI found compilation warning while trying to compile with clang. Command used:
See details on the summary page. |
type tracking |
thanks @Dr15Jones for the fix here, can you please take care of the clang warnings https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-20c51f/29955/clang-new-warnings.log |
The LTO build was warning about a possible uninitialized value usage. From inspection, that is not the case but the compiler was unable to reason about the placement new usage. - Changed to use VLA directly - Added unit test
b87a0d7
to
429d96a
Compare
please test |
Pull request #40498 was updated. @mandrenguyen, @clacaputo can you please check and sign again. |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-20c51f/29976/summary.html Comparison SummarySummary:
|
@cms-sw/reconstruction-l2 Could you please review and sign? |
+reconstruction |
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. @perrotta, @dpiparo, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
@Dr15Jones , to complete the fix, and with the same logic, L41 of RZLine.h should be replaced by float simpleCot2 = sqr((z[nSafe - 1] - z[0]) / (r[nSafe - 1] - r[0])); (even though a division by 0 in case of |
@perrotta this PR is just meant to fix the new clang warning. I'd prefer any further changes be done by the maintainers of the code. |
Ok. I think that what I pointed out was strictly linked to your fix, i.e. the same protection against n=0 that you add here is also needed a few lines below. However, I understand that such an additional fix can also get applied later on: let merge this PR and make clang happy, then |
+1 |
Hello @perrotta @Dr15Jones , Thanks! |
Thank you @aandvalenzuela It is indeed the new test introduced by this PR. It fails in the IBs for aarch64, but not for the other architectures. Looking at the log it looks to me that it can depend on the precision of the machine: I'd let @Dr15Jones comment in a more informative way, since he designed that test. In any case, I don't think #40592 can fix it: that PR deals with some pathological case in which either 0- or 1-dimension arrays are fed to the routine, which is not what is tested by that unit test. I am running the tests for el8_aarch64_gcc1 in that PR nonetheless, just to see what happens. |
Hello @perrotta, |
So all these CPUs/compilers should be using the IEEE standard for the computations so it is worrisome that on x86 we get a value of 0.125 while on ARM/PPC we get 0.1. Those are VERY large differences. How do I log onto our available ARM and/or PPC machines? |
after logging in to lxplus, you can run |
for arm, you can also use |
So I 'understand' the 0.1 different from 0.125 for the different CPUs for the one point linear fit. The way the code is written, the intercept calculation is basically doing a I'm thinking about modifying the linear fit code to add a case for 1 point to make it stable. |
See #40606 for a fix to the CPU architecture differences. |
PR description:
The LTO build was warning about a possible uninitialized value usage. From inspection, that is not the case but the compiler was unable to reason about the placement new usage.
PR validation:
Code compiles and new unit test passes.