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

revert #46026 (L1-uGT emulator) #47088

Merged
merged 1 commit into from
Jan 15, 2025
Merged

Conversation

missirol
Copy link
Contributor

PR description:

This PR updates the L1-uGT emulator by reverting #46026. Checks described in #46026 and #47030 show that #46026 introduced disagreements between the unpacked and emulated L1-uGT decisions for seeds using muons reconstructed in separate bunch crossings (specifically, the seed L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142).

PR validation:

See #47030 (comment) and #46026 (comment).

If this PR is a backport, please specify the original PR and why you need to backport that PR. If this PR will be backported, please specify to which release cycle the backport is meant for:

CMSSW_14_2_X

Bugfix to the L1-uGT emulator, to be backported to 14_2_X (earlier cycles are not affected by the bug in question).

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 12, 2025

cms-bot internal usage

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47088/43267

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • L1Trigger/L1TGlobal (l1)

@aloeliger, @cmsbuild, @epalencia can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @mmusich this is something you requested to watch as well.
@antoniovilela, @mandrenguyen, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@missirol
Copy link
Contributor Author

@cms-sw/l1-l2 @elfontan @nabrandman

Regarding the firmware-emulator mismatches for the seed L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (see, for example, CMSLITDPG-1221 (comment)), my understanding is as follows, and please correct me if I'm wrong.

  • The mismatches are seen when using as input data the "test vectors" produced according to the recipe in Fixes mismatches between emulator and fw on CDC dimuon seed #46026 (comment).
  • The information encoded in the test vectors corresponds to (a) the L1T objects, and (b) the emulated decisions. The firmware decisions are produced during the test based on the L1T objects in the test vectors, and they are compared to the emulated decisions encoded in the test vectors.
  • The test vectors typically contain the L1T info of 3564 events from a given input file (e.g. MC or HLTPhysics data)
    nevents = 3564 #number of events
  • For every event, the test vectors contain only information from BX=0, because minBxVec==maxBxVec==0
    minBxVec = cms.int32(0),
    maxBxVec = cms.int32(0),

    // Dump Test Vectors for this bx
    if (m_dumpTestVectors) {
    for (int i = m_minBxVectors; i <= m_maxBxVectors; i++) {
    // if( (i>=egammas->getFirstBX() && i<=egammas->getLastBX())&&
    // (i>=muons->getFirstBX() && i<=muons->getLastBX()) &&
    // (i>=taus->getFirstBX() && i<=taus->getLastBX()) &&
    // (i>=jets->getFirstBX() && i<=jets->getLastBX()) &&
    // (i>=etsums->getFirstBX() && i<=etsums->getLastBX()) &&
    // (i>=uGtAlg->getFirstBX() && i<=uGtAlg->getLastBX()) &&
    // (i>=uGtAlg->getFirstBX() && i<=uGtAlg->getLastBX()) ) {
    dumpTestVectors(i, m_testVectorFile, muons, muonShowers, egammas, taus, jets, etsums, uGtAlg, uGtExt);
    // } else {
    // edm::LogWarning("GtRecordDump") << "WARNING: Not enough information to dump test vectors for this bx=" << i << endl;
    // }
    }
    }

If so, it seems impossible to produce the correct firmware decision for L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 based on these test vectors, because that seed requires a muon with certain properties in BX=-1, and the test vectors do not contain any information about that BX for any given event. The firmware decisions should always be L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 == false, in principle. Yet, the tests typically show that there are more events passing L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 in the firmware decisions, compared to the emulated decisions.

Is it possible that, in such test, the entries in the test vectors are interpreted as consecutive BXs (which is not what they are), and the firmware decisions are computed considering, for a given event, the muons of the previous event as the muons of BX=-1 of the current event ? I think that would be consistent with (a) the CDC seed accepting events in firmware, (b) the firmware and emulated decisions being different for that seed.

@missirol
Copy link
Contributor Author

Is it possible that, in such test, the entries in the test vectors are interpreted as consecutive BXs (which is not what they are), and the firmware decisions are computed considering, for a given event, the muons of the previous event as the muons of BX=-1 of the current event ? I think that would be consistent with (a) the CDC seed accepting events in firmware, (b) the firmware and emulated decisions being different for that seed.

Indeed, it seems that the changes in #46026 mimic this type of (wrong) behaviour, as the muons used for BX=-1 are taken from muonVec_bxm1

m_uGtBrd->receiveMuonObjectData(iEvent, m_muInputToken, receiveMu, m_nrL1Mu, &muonVec_bxm2, &muonVec_bxm1);

} else if (i == -1) {
for (std::vector<l1t::Muon>::const_iterator mu = muonVec_bxm1->begin(); mu != muonVec_bxm1->end(); ++mu) {
if (nObj < nrL1Mu) {
(*m_candL1Mu).push_back(i, &(*mu));
} else {
edm::LogWarning("L1TGlobal")
<< " Too many Muons (" << nObj << ") for uGT Configuration maxMu =" << nrL1Mu;
}
LogDebug("L1TGlobal") << "Muon Pt " << mu->hwPt() << " EtaAtVtx " << mu->hwEtaAtVtx() << " PhiAtVtx "
<< mu->hwPhiAtVtx() << " Qual " << mu->hwQual() << " Iso " << mu->hwIso();
nObj++;
}
} else {

and the content of muonVec_bxm1 is a copy of the muons of BX=0 seen in the previous call to L1TGlobalProducer::produce (presumably, the previous event in that CMSSW stream.. ?)
muonVec_bxm1.clear();
for (std::vector<const l1t::Muon*>::const_iterator iMu = (*(m_uGtBrd->getCandL1Mu())).begin(0);
iMu != (*(m_uGtBrd->getCandL1Mu())).end(0);
++iMu) {
muonVec_bxm1.push_back(**iMu);
}

This would explain why #46026 could reproduce the results of the firmware based on the test vectors, but in that case it is the wrong solution (if #47088 (comment) is accurate, the problem is the interpretation of the content of the test vectors, not the implementation of the emulator).

@missirol
Copy link
Contributor Author

@cms-sw/l1-l2

Any feedback ? This is a bugfix, and it targets 15_0_X (which closes around Feb-4).

@mmusich
Copy link
Contributor

mmusich commented Jan 14, 2025

type bug-fix

@mmusich
Copy link
Contributor

mmusich commented Jan 14, 2025

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

+1

Size: This PR adds an extra 16KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-55d1e7/43751/summary.html
COMMIT: 03091e0
CMSSW: CMSSW_15_0_X_2025-01-13-2300/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/47088/43751/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 2 lines to the logs
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3819085
  • DQMHistoTests: Total failures: 67
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3818998
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 214 log files, 184 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

@missirol
Copy link
Contributor Author

Just for the record: as expected, the tests in this PR (#47088 (comment)) show the features described in #47030 (comment) (back when this PR was part of #47030). Leaving an image below just for reference (blue points are the baseline, black line is post-PR).

revert46026

@aloeliger
Copy link
Contributor

Okay, at this point I haven't heard anything definitive back from the GT team about this. Because this seems to definitively fix an emulation bug, I am going to approve this, and then work out the issue with the GT team at a later time to allow #47030 to proceed.

@aloeliger
Copy link
Contributor

+l1

@missirol
Copy link
Contributor Author

The latest push is simply a rebase (was necessary after #47070 was merged).

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Pull request #47088 was updated. @aloeliger, @cmsbuild, @epalencia can you please check and sign again.

@aloeliger
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Size: This PR adds an extra 40KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-55d1e7/43763/summary.html
COMMIT: 0c0e588
CMSSW: CMSSW_15_0_X_2025-01-14-1100/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/47088/43763/install.sh to create a dev area with all the needed externals and cmssw changes.

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:

You can see more details here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-55d1e7/43763/git-recent-commits.json
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-55d1e7/43763/git-merge-result

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 11 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3819085
  • DQMHistoTests: Total failures: 45
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3819020
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 214 log files, 184 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

@missirol
Copy link
Contributor Author

#47088 (comment) also applies to the latest tests (since it's only a rebase). I double-checked that the PR is as intended post-rebase (verbatim revert).

@aloeliger , your signature was reset due to the rebase. Could you please resign ? Thanks !

@aloeliger
Copy link
Contributor

+l1

@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. @rappoccio, @sextonkennedy, @antoniovilela, @mandrenguyen (and backports should be raised in the release meeting by the corresponding L2)

@mandrenguyen
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit d968191 into cms-sw:master Jan 15, 2025
11 checks passed
@missirol missirol deleted the devel_revert46026 branch January 15, 2025 19:22
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.

5 participants