Skip to content

Add pixi-build config, CI and fix references#77

Merged
chrisburr merged 17 commits into
lhcb:masterfrom
chrisburr:pixi-build
May 19, 2026
Merged

Add pixi-build config, CI and fix references#77
chrisburr merged 17 commits into
lhcb:masterfrom
chrisburr:pixi-build

Conversation

@chrisburr
Copy link
Copy Markdown
Member

No description provided.

chrisburr and others added 17 commits April 27, 2026 14:21
CMake 4.x removed support for cmake_minimum_required values below 3.5.
Bumping the minimum from 2.6 to 3.5 keeps the project buildable with
modern CMake without changing any CMake policy behaviour.
Add a pixi workspace that provides ROOT, EvtGen and the compiler
toolchain in a self-contained environment, so contributors can build
and validate RapidSim on Linux and macOS (incl. Apple Silicon) with a
single 'pixi run test' — no LCG / cvmfs / Docker required.

The same pixi.toml doubles as a pixi-build conda-package definition
('pixi build' / 'pkg' environment), aligning the in-tree build with
the conda-forge feedstock and paving the way to simplify the recipe.

CI moves from CERN GitLab to GitHub Actions and runs the same
validation suite (eight decay modes from the former GitLab pipeline)
under pixi on ubuntu-latest and macos-14, plus a separate job
exercising 'pixi build' for the conda package.

The README setup section is replaced with pixi-only instructions and
the EvtGen subsection is trimmed (pixi provides EvtGen with all
externals, no manual setupEvtGen.sh step needed).

Removed the GitLab-specific scaffolding (.gitlab-ci.yml, Dockerfile,
krb5.conf, run.sh).
Temporary so the CI runs on the fork while the branch is in flight;
will be reverted before merging.
… gRandom->TRandom::GetSeed() / gRandom->TRandom::SetSeed()
Tighten compareHistograms.C so it returns 1 (and the pixi task fails)
when any histogram has p < 0.001, in addition to the existing mean-p
< 0.1 check. Continue iterating through every histogram before
returning so the full report is generated.

Aggregate every per-histogram comparison into a single multi-page PDF
per mode (plots/<mode>_summary.pdf) so it can be flipped through
visually instead of opening N individual files. The existing
per-histogram PDFs are kept for backwards compatibility.

Print a summary block at the end of each run with the total
comparisons, warning/fail counts, mean p-value, the list of failing
histograms with their p-values, and a clear PASS/FAIL line — so the
CI log alone is enough to triage without downloading artifacts.
actions/upload-artifact@v4 skips paths beginning with '.' unless
include-hidden-files is set. Our .build/ directory was being silently
omitted, leaving the validation artifact empty.
Previously the 'test' task used pixi's depends-on chain over each
per-mode task, which aborts on the first failure. With the strict gate
that means a stale reference for B2Kee hides every other mode's
output, and the artifact only contains B2Kee_summary.pdf.

Switch the task to a bash loop that invokes each mode in sequence and
continues past individual failures, accumulating an exit status. Now
the artifact contains a summary PDF for every mode that runs
compareHistograms.C, so a reviewer can see the full picture from a
single CI run.
Each summary page now carries a small legend mapping the line colours:
black = reference (validation/rootfiles/), red = this build's output.

Move <mode>_summary.pdf out of .build/plots/ to .build/, so it lands
at the top of the CI artifact next to the *_hists.root files instead
of being buried alongside the ~100 per-histogram PDFs. The artifact
upload glob is extended to pick it up.
Replace the seven mode reference files in validation/rootfiles/ with
freshly generated outputs from the current build.

The previous references dated from March 2019 (commit 9f498e9). In
September 2020 the LHCbGenericIP smearing constants and particles.dat
distances were changed from micrometers to millimeters (b5c08ba) but
the references were never refreshed, so all IP/MINIP/SIGMAIP/FD
histograms diverged from the smear configuration by a factor of
~1000. With the new strict per-histogram gate every IP-family
histogram was failing.

The replacements were taken from the validation-ubuntu-latest
artifact of CI run 25019391601, which generated them with the same
ROOT/EvtGen versions pixi pins. Only the seven modes covered by the
current 'pixi run test' suite are replaced; D02Kpi-redecay, Ds2KKpi,
Bs2DKpi_DP and B2Kee_tree references are left untouched.
These two modes were running with 10k events, which left them
sensitive to cross-runner CPU/FMA drift in the validation Chi2 test
(handful of histograms below p=0.001). Bumping to 100k makes the
distributions smooth enough that the drift is statistically invisible
under the strict per-histogram gate.

References will be regenerated in a follow-up commit from the
ubuntu-latest CI artifact.
Companion to the previous commit's event-count bump. References taken
from the validation-ubuntu-latest artifact of CI run 25039000675.
RapidSim.exe writes its histogram output to <decay>_hists.root, so
when run-B2Kee-tree (1000 events with save-tree) ran AFTER run-B2Kee
(100000 events) it overwrote B2Kee_hists.root with a 342-entry file
right before the artifact upload. Every B2Kee reference committed so
far is the 1k-event version, not 100k. Reordering the test loop so
run-B2Kee-tree runs first lets the 100k run overwrite back, leaving a
correct 33494-entry hist file in the artifact. The tree task's
B2Kee_tree.root output is preserved either way.

Also dual-stats-box on each summary page so this kind of mismatch is
visible at a glance: each histogram now carries a black stats box
(reference) and a red one (this build) showing entries/mean/RMS.
Previous B2Kee reference had only 342 entries because run-B2Kee-tree
was clobbering the 100k output before the artifact was uploaded. The
preceding commit reordered the test loop so the 100k run wins.
Reference taken from validation-ubuntu-latest of CI run 25040229179.
… histograms

ROOT's Chi2Test 'UU' returns p=0 when both histograms have all their
entries in a single bin, even when the histograms are bit-identical.
This affects truth-level vertex / FD / SIGMAIP histograms for
intermediate particles, where the value is always exactly zero (or
the PDG mass) and 100k entries land in one bin.

When fewer than two bins are non-empty, fall back to a direct
bin-content comparison: identical => p=1, otherwise p=0. The
non-degenerate path is unchanged.
Histograms with all entries concentrated in 1-2 bins are not really
distributions and the Chi2Test isn't meaningful for them. Single-bin
cases (truth-level vertex coordinates always at 0) returned p=0 even
for bit-identical histograms; two-bin cases (truth-level mass peaks
pinned at the PDG mass) flag float-precision noise — the only
'difference' is which side of the bin boundary a 5.279310 GeV float
lands on, which differs between Linux and Mac CPUs.

Skip these histograms entirely with an INFO log and add a 'Skipped
(narrow)' line to the summary block. Distribution-shaped histograms
remain under the strict p<0.001 gate.
Reverts the temporary branch entry added so the workflow ran on the
fork while iterating. The workflow now triggers on master pushes and
pull requests only, as originally designed.
@chrisburr chrisburr marked this pull request as ready for review May 19, 2026 03:22
@chrisburr chrisburr merged commit 320824c into lhcb:master May 19, 2026
This was referenced May 19, 2026
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.

1 participant