Repository navigation
Merge pyAmpliCol into MadGraph7 - #301
theoheimel wants to merge 1113 commits into
Conversation
Project source-only process seeds and emit a compact single-member artifact through the existing generation flow. Reuse the established Runtime APIs with lazy public physics, process-global coupling policy, a one-time prepared grammar, compact retained selector-family state, and complete clear semantics. Add exact LC work-census tooling plus focused generation, loading, selector, lifecycle, cache, and correctness coverage.
Batch source-only seeds once per model and authenticate crossed execution state. Load compact process PACBINs through closed capability and path checks. Retain, vectorize, and clear warmed selector state. Make the real LC gate fail closed on materialized lanes, fields, sidecars, and container members.
Add feature-only execution diagnostics and seed-domain reconstruction, bind legacy-null massive sources through prepared mass slots, and strengthen the dual-authority n=4 gate.
- 'install pyamplicol' runs pyamplicol/install.py like 'install madspace', with help and completion (also adds the missing madspace options there) - bootstrap: ensure_pyamplicol, check_pyamplicol_source_hash and check_pyamplicol_license for the [amplicol] backend - madspace/install.py only counts madspace wheels in input/.release
- pyamplicol.yml ports pyamplicol's tests and release-artifact workflows; a changes job skips the heavy jobs when nothing pyamplicol depends on changed - an installer job builds through pyamplicol/install.py and checks that Symbolica accepts the library key from the MadGraph root - actions: pyamplicol_prepared_models (fetch, validate, else regenerate), build_pyamplicol and install_pyamplicol - release.yml builds the pyamplicol sdist and wheels, publishes them through the shared pypi environment, records the wheels in input/.release and attaches the prepared-model archive to the release - unittest.yml runs the installer unit tests
The pages stay in pyamplicol/docs (its tests and sdist use them) and are copied into the Sphinx tree at build time; MyST renders the Markdown, and toctrees in the parent pages replace the Jekyll hierarchy. The installation page describes the MadGraph7 installer.
The pyamplicol/.github workflows no longer run inside MadGraph7. The tests and release-artifact workflows were ported to pyamplicol.yml; the architecture-transfer check becomes pyamplicol-eager-portability.yml. The prepared-model regeneration is the pyamplicol_prepared_models action and the publisher is part of release.yml, so candidate.yml, release-prepared-models.yml and publish-pypi.yml are dropped, together with the test that pinned their contents. The remaining workflow tests read the MadGraph7 workflows.
- README mentions install pyamplicol and pyamplicol's own license - a pre-commit ruff hook with the lint scope of pyamplicol's CI - CI warns 90 days before the Symbolica library key expires - the packaging and release pages describe the release archive and the MadGraph7 release process
Wheels built from the sdist record the source hash with it.
As for madspace, release.yml relies on main's run for the tests.
The release backend tags Linux wheels manylinux_2_28, which maturin only accepts when building in a manylinux container; on a newer host (the CI runner, most user machines) the local build failed its compliance check. Local installs now pass pyamplicol.host-wheel=true, as upstream's dependencies/install_dependencies.py does.
oliviermattelaer
left a comment
There was a problem hiding this comment.
Hi,
This is literally amazing.
One nit picking details, is that this PR likely include a lot of files that we do not want to be part of the release ...
- Do we need to have a second models directory with plenty of model not shipped in MG.
- Do we need to have a full process list (like the all examples directory)
- Do we want to keep all the .md that help the AI to generate this?
- Do we want to keep all the latex file (of the paper?)?
Hi, yes it's exciting! I agree with Theo that a monorepo for MG7 will make development far easier, especially for agentic coding. On the other hand, I think it's great to still have pyAmpliCol be usable standalone outside of MadGraph (that was one of my important design goal). It can be very useful to other generators, and parton showers for MEC, etc... I think part of my motivation there is that with MadLoop I felt like it was a mistake that it was so tightly integrated within MadGraph, so that no one understood they could easily use it standalone as well, and thus OpenLoops became the default. I would like to avoid repeating that scenario here and really keeping pyAmpliCol as independent "tree-level ME provider" to MadGraph, which is now made simple thanks to the much more advanced APIs we can build nowadays thanks to agents. So for example, it is important that So some of the files you mentioned are precisely there for that standalone-requirement reason (i.e. example files, some model files). Some other files (like left-over markdowns, old benchmark PDFS) are indeed stale and I agree that they should be removed. So moving forward and as far as MadGraph7 release go, I think the way to go about it is to have the release CI workflow trim down pyAmpliCol to what's needed by MG7 alone, and remove the rest (e.g. examples and models); but keep these files in the repo so that the release CI workflow for pyAmpliCol itself can ship them properly as intended when releasting the pyAmpliCol pypi wheels. |
_intern scanned the whole table with list.index, so building a provider was quadratic in the number of colour flows. At leading colour with ten gluons ((n-1)! = 362880 orderings) generation stalled for hours in _build_provider. Each table now carries a dict from its frozen entries to positions; the exported tables are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_identical_orbit keyed every re-anchoring of a colour trace by legs, colour edges and the sorted, permuted helicity domain, then kept the minimum. The helicity domain dominates the cost and only decides between rotations tied on legs and colour edges, so it is now built for those alone. The returned key and order are unchanged; for ten gluons with all 1024 helicities this is 7 ms -> 0.9 ms per colour component. The new test checks the result against the full-key minimum, including colourless beams, where every rotation ties and the helicity domain decides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The agent policy file was carried over from the standalone repository. Nothing in the tree, the sdist include list or the docs toctree refers to it, so removing it changes neither the build nor the tests.
pyamplicol keeps its tests, developer scripts, FFT profiling driver, UMAMI example and nix files in the repository for its own PyPI releases, but the MadGraph7 installer does not need them. Mark them export-ignore so git archive (bin/create_release.py) leaves them out. The legacy-oracle modules under tools/developer stay, because the wheel build bundles them into pyamplicol._performance_report. The source hash only covers src/, rust/ and the root build files, so it does not change. This drops 426 of 1361 files (about 12.7 MB) from pyamplicol/ in the archive. A cold install.py --source from the trimmed archive builds, fetches the v0.2.1 prepared models, accepts the Symbolica library key, and matches the source hash.
Lock files, test fixtures, the self-test artifact, the JSON exports of the bundled UFO models and the blank profiling-campaign result caches are generated. GitHub now collapses them in PR diffs. Only diff display changes: the release archive and builds are not affected. release-lock.toml and contributor-lock.toml stay expanded, because their ABI and dependency pins are edited by hand.
pyamplicol UMAMI metadata: fix quadratic cost and redundant sorts
Remove the packaged profiling campaign (`pyamplicol profiling-campaign`), the performance-report and FFT-profiling drivers, the developer gates and benchmarks that only fed them, the UMAMI/MadSpace demo, the nix flake, and their tests and docs. Published reports stay linked from upstream.
pyamplicol: drop profiling-campaign and report tooling
Brings pyAmpliCol, the generator behind the
[amplicol]matrix-element backend, into MadGraph7 aspyamplicol/, the same way madspace was merged. It keeps its history and gets CI, documentation, a local installer and PyPI releases in lockstep with MadGraph7.This PR covers the infrastructure only. The
[amplicol]backend (feat-madspace-amplicol) can be rebased onto it afterwards and use the new bootstrap helpers.!!! Important information on releases, please read !!!
The amplicol version is now coupled to the MG7 version and a MG7 release triggers a PyAmplicol release
MadGraphTeam/MadGraph7, workflowrelease.yml, environmentpypiHistory import
main(up to9404776f) is merged with every commit kept: 1085 commits, after git filter-repo pruned the 4 that became empty.*.pyamplicol-model, 74 commits of 7–18 MB) were removed;pyamplicol/..github/scripts/import_pyamplicol.sh. The filter is deterministic, so later upstream commits can be imported by running it again and mergingpyamplicol-import; commits that were already imported keep their SHAs.pyamplicolremote has its push URL disabled.Prepared models
pyamplicol-prepared-models.tar.gz(about 2.4 MB). It holds the metadata plus each distinct bundle once; the x86_64 and aarch64 packs are identical.pyamplicol/tools/release/prepared_models_archive.pyhas four commands:fetchdownloads the archive from the matching release, or else the latest one;unpackwrites the files from a local archive;packcreates the archive;regeneratebuilds a bootstrap wheel and produces the packs on the current host.Build changes for the monorepo
pyamplicol/is treated as a Git subdirectory for the file inventory, the clean-revision check (onlypyamplicol/counts) and the release store.umami.h, see the follow-ups).RUSTUP_HOMEpasses through to the build, and the build finds maturin when it is installed withpip install --target.VERSION, currently 0.2.1.tools/release/sync_version.pywrites it into Cargo and the release lock, andbin/create_release.py --check-onlyfails when they are out of sync.pyamplicol/source_hash.pycomputes it; wheel builds record it aspyamplicol._source_hash.Installation
pyamplicol/install.pyworks likemadspace/install.py:--bininstalls the PyPI wheel of this MadGraph version and is offered in release tarballs.--sourcebuilds intopyamplicol/installand leaves the active environment alone.-y,-j N,--system,--clean,--build-models.pyamplicol/build/rust;~/.cargoand~/.rustupare left alone.install pyamplicolcommand with help and tab completion. The madspace help and completion also gain the-j,--system,--cleanand--docsoptions they were missing.mg7/bootstrap.py, for the backend to use:ensure_pyamplicolputs the install first onsys.path, ahead of the MadGraph root, wherepyamplicol/is the source directory.check_pyamplicol_source_hash.check_pyamplicol_license.madspace/install.pynow ignores the pyamplicol wheels listed ininput/.release.Symbolica library key
pyamplicol/__init__.pyregisters an OEM key that is scoped to the package namepyamplicol. The checks run withoutSYMBOLICA_LICENSEand confirm that the imported package is the installed one:install.py --bin.CI also warns 90 days before the key expires, which is on 2028-01-01.
CI
pyamplicol.ymlports the upstreamtests.ymlandrelease-artifacts.yml; every job runs insidepyamplicol/.changesjob skips the heavy jobs when nothing pyamplicol depends on has changed. It is a job rather than apaths:filter, so every commit still has a green run for the release gate.install.pyand checks the library key.pyamplicol-eager-portability.ymlports the check that packs produced on one architecture work on the others.pyamplicol_prepared_models: fetch and validate, or else regenerate;build_pyamplicol/install_pyamplicol: like the madspace pair.release.yml:publish_pypi_pyamplicol, which reuses thepypienvironment;input/.release;pyamplicol.ymlto the green-CI gate.unittest.ymlruns the newtest_pyamplicol_install.pyamplicol/.githubwould never run in this repository, so they are removed, along with the test that pinned their contents. The remaining workflow tests now read the MadGraph7 workflows.Documentation
pyamplicol/docs, because pyamplicol's tests and sdist use them, and are copied into the Sphinx tree at build time.myst-parser==5.0.0). Toctrees in the parent pages replace the Jekyll hierarchy.Verification
python pyamplicol/install.py --source -y -j 8builds intopyamplicol/install. An incremental rebuild takes about 50 s. The licence check passes, and the installed source hash matches.--build-modelsregenerates the packs locally (bootstrap wheel, produce, build) in 1 min 45 s, and they pass the backend validation.git archivesnapshot, the way a release tarball builds it, also works: a cold build took 7 min 48 s, the packs were fetched from v0.2.1, the licence check passed, and the installed source hash matches.ensure_pyamplicol,check_pyamplicol_licenseandcheck_pyamplicol_source_hashpass from the MadGraph root.source_hash.py.test_build_backend, packaging, dependency gate, release and examples tests: 399 passed, 9 skipped (justis not installed);ruff checkis clean on the CI lint scope.test_pyamplicol_install(14),test_madspace_install(28) andtest_mg7_launch(91) pass.make -C docs htmlsucceeds.release-runtime), the macOS and manylinux wheel builds, and the release workflow itself. They run in CI: the first on this PR, the wheel builds viaworkflow_dispatchwithfull_matrix.Follow-ups
pyamplicol/src/pyamplicol/assets/api_templates/umami/umami.hwith a symlink tomadspace/include/madspace/umami.h, as for madmatrix. It cannot be done yet: pyamplicol uses UMAMI 1.2, but this branch's madspace header is 1.0, and 1.2 only exists onfeat-madspace-amplicol. The build backend already copies the symlink by content.feat-madspace-amplicolonto this branch and callensure_pyamplicoland the checks.[amplicol]gridpacks need the pyamplicol runtime.