Skip to content

Add MadtRex tests to CI - #1058

Merged
Qubitol merged 27 commits into
madgraph5:masterfrom
Qubitol:madtrex-ci
Jun 26, 2026
Merged

Add MadtRex tests to CI#1058
Qubitol merged 27 commits into
madgraph5:masterfrom
Qubitol:madtrex-ci

Conversation

@Qubitol

@Qubitol Qubitol commented Oct 21, 2025

Copy link
Copy Markdown
Collaborator

Add a new step in testsuite_oneprocess workflow to check MadtRex according to validation tests running the reweighting on MC samples generated using the process folders obtained during the codegen step in the CI itself.
Notice that the references files have been generated using vanilla MadGraph and not CUDACPP (like in this case) - except for nobm_pp_ttW that has been regenerated with CUDACPP - so we increased the maximum threshold for the results difference to 5%.

Make it 2% of the cross section.
Update repository to 1.01.00, in particular the MadGraph submodule got
updated to v3.6.5.
The process run originally in the ref was different from the one
included in the repository.
Reference samples have been generated using MadtRex on top of vanilla
MadGraph and not on top of CUDACPP, so there is a slightly larger
uncertainty when comparing those ref samples with the reweighted samples
that start from CUDACPP-generated events.
We are not interested to check theat they are digit-by-digit correct,
but that they are almost correct with each other.
In some cases, the imported model during reweighting is still Python 2,
so we need to setup autoconversion at the beginning of the launch card
if the model is not trivial and it is not the Standard Model
@Qubitol
Qubitol marked this pull request as ready for review October 21, 2025 13:13
@Qubitol
Qubitol requested a review from a team as a code owner October 21, 2025 13:13
@Qubitol

Qubitol commented Oct 22, 2025

Copy link
Copy Markdown
Collaborator Author

After an exchange with @zeniheisser, we decided that it may be worth to generate the event samples in advance, so that tests go a bit faster. This would imply:

  • generate and save the LHEF as some tests assets
  • compile MadtRex
  • running the executable with some cmd line args

This can be done in another workflow file separated from testsuite_oneprocess.yml, but still called by testsuite_allprocesses.yml.

@Qubitol
Qubitol marked this pull request as draft October 22, 2025 07:26
@zeniheisser

Copy link
Copy Markdown
Contributor

would be nice to have to avoid something like #1090 :))))

@Qubitol

Qubitol commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

Yes, thanks @zeniheisser for bringing this up, and thanks for fixing MadtRex interface after the latest PRs.

The situation is: given we are moving fast to MadGraph7, and given both the CI and the interface to MadtRex there is still not finalised, I wanted to wait and implement everything only once there.
However, I'm open to finalise this if needed.

@Qubitol
Qubitol requested a review from zeniheisser June 23, 2026 16:39
@Qubitol
Qubitol marked this pull request as ready for review June 23, 2026 16:40
@Qubitol

Qubitol commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

Tests are passing.
There are two main points associate to this PR.

The reweighting procedure needs LHE event files

In order to avoid to regenerate them during each CI (some processes take hours to finish), they have been pre-generated and saved into epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/test/MadtRex_baseline, together with the validation file containing the reweigthing results to be checked within the CI.
This means both files should be regenerated if needed, and the script .github/workflows/generate_madtrex_assets.py does exactly that.

One of the main issues was the model used to generate the process

Given some of them are downloadable online and should be converted automatically to be usable within MadGraph (possible to do this by doing set auto_convert_model T in the main prompt), this should be done in the CI as well.
This gave origin to the step init_madgraph_configuration_and_model in .github/workflows/testsuite_oneprocess.yml where we run MadGraph for two reasons:

  • to write the default configuration files
  • to set model auto-conversion.

In this way, the model can then be reimported from the reweighting command, launched from the bin/madevent.py of each process.
This command failed multiple times, and I understood that the main issue seemed to be the bytecode compiled by Python and stored inside the <mg5amcnlo_path>/models/<model>/__pycache__.
If that folder is removed, then no more errors are present, the model is reimported, and then the reweight procedure doesn't have any issues into using it.

@Qubitol
Qubitol merged commit cfe817b into madgraph5:master Jun 26, 2026
360 of 361 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants