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

[muon] fixed compilation warning in DataFormats/MuonReco (ArbitrationType to unsigned int) #23599

Merged
merged 1 commit into from Jun 21, 2018

Conversation

drkovalskyi
Copy link
Contributor

@drkovalskyi drkovalskyi commented Jun 15, 2018

Addressed the issue #23057. The warning raised the old design issue where a mix of basic arbitration types defined in MuonSegmentMatch and arbitration flags designed for end-users (Muon::ArbitrationType) were allowed to be used with the same interface. At the moment the only safe way to address the warning is to change the input type, which effectively doesn't change anything beside removing the warning. Long term we may want to address the issue more directly and forbid mixing arbitration types. This however requires a detailed validation, which is not wise to do so late in the release development cycle.

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @drkovalskyi for master.

It involves the following packages:

DataFormats/MuonReco

@perrotta, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@battibass, @folguera, @abbiendi, @rovere, @calderona, @HuguesBrun, @jhgoh, @trocino, @amagitte, @bachtis this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@fabiocos
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 15, 2018

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/28720/console Started: 2018/06/15 22:21

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-23599/28720/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 31
  • DQMHistoTests: Total histograms compared: 2902004
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2901812
  • DQMHistoTests: Total skipped: 190
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 30 files compared)
  • Checked 128 log files, 14 edm output root files, 31 DQM output files

@perrotta
Copy link
Contributor

If I understood correctly what was proposed by @Dr15Jones in #23057, the main suggestion there was just to remove the comparison check, while maintaining the ArbitrationType in the argument of the calls. I'd second that proposal, provided there is really no possibility to have more than 7 arbitration types.

On the other hand, if such a possibility cannot be excluded by construction, then your solution of using unsigned int in the argument of the calls does make sense. However, if you do so, then the check in http://cmslxr.fnal.gov/source/DataFormats/MuonReco/src/Muon.cc#0112 shouldn't limit to break, but a Log message (LogError?) should be also issued, so that some track remains of the pathological situation encountered. This is more suitable for that purpose than the comment you put in https://github.com/cms-sw/cmssw/pull/23599/files#diff-8ee590dca6a420647276b172702ff1f9R182

@drkovalskyi
Copy link
Contributor Author

This method was designed to use Muon::ArbitrationType and MuonSegmentMatch arbitration types at the same time. I agree it was probably not the best decision, but sorting it out all out now requires significantly more work. Changing the type the old functionality is preserved, i.e. it's a safe change.

@drkovalskyi
Copy link
Contributor Author

However, if you do so, then the check in http://cmslxr.fnal.gov/source/DataFormats/MuonReco/src/Muon.cc#0112 shouldn't limit to break, but a Log message (LogError?) should be also issued, so that some track remains of the pathological situation encountered.

That's not a bug or pathological situation. It's a case of mixing basic arbitration types that are larger than 128 and standard type that everyone knows and uses. No warning is needed and to decide what's enough after the break one needs to review all the code carefully to understand how it all works. I don't remember it and I wouldn't risk breaking it just to silent one warning.

@perrotta
Copy link
Contributor

+1

@cmsbuild
Copy link
Contributor

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, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2)

@slava77
Copy link
Contributor

slava77 commented Jun 19, 2018

This method was designed to use Muon::ArbitrationType and MuonSegmentMatch arbitration types at the same time.

what is the meaning of this? Some historical ideas from 10 years ago? Or, do we actually now find a new use cases for these methods that were not needed before?

The baseline methods took ArbitrationType type as an argument, which means that only the range of values from the ArbitrationType could possibly enter the implementation body of the method. In this case the explicit check for values outside of the range of ArbitrationType is useless (dropping that check would be a natural choice if the methods with ).

In the proposed update the functional range of the method has changed, which means that they can now be called in places they could not be before. This should better be reflected in the PR title and description. Smth in line with "Restore capability to call muon::xyz methods with MuonSegmentMatch".

@drkovalskyi
Copy link
Contributor Author

Do we allow implicit conversion of unsigned int to enum? If not, then indeed the old functionality is disabled and I don't think we need to re-enable it, but the fact remains that we can only use the first 8 bits or we will break the code. So the most important thing is to make sure new enums are not used. I don't see how to do that beside adding a text warning as I did.

@slava77
Copy link
Contributor

slava77 commented Jun 19, 2018 via email

@drkovalskyi
Copy link
Contributor Author

The only way to answer that is to forbid any reasonable action for types>128 and do a validation. I doubt that we want to do it now, but I would schedule it for next release. This is 10+ old code - I don't remember all the details.

@fabiocos
Copy link
Contributor

sorry, but I am missing a final decision here: the limited PR test does not show any change, but this is not necessarily fully excluding the case that Slava was mentioning, and we are not fully sure it does not happen. @slava77 @perrotta do I correctly understand that your suggestion is to integrate and see the validation response?

@drkovalskyi
Copy link
Contributor Author

Slava's case is what we always had. The change silences the warning and may potentially increase number of uses cases by making them explicitly possible, while there were always implicitly possible.

@slava77
Copy link
Contributor

slava77 commented Jun 21, 2018 via email

@fabiocos fabiocos changed the title [muon] fixed compilation warning in DataFormats/MuonReco [muon] fixed compilation warning in DataFormats/MuonReco (ArbitrationType to unsigned int) Jun 21, 2018
@slava77
Copy link
Contributor

slava77 commented Jun 21, 2018 via email

@fabiocos
Copy link
Contributor

+1

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