# Muon collider: graph segmentation backend benchmark (2026-11-18)

Every `get_tracks` backend of acorn
(`acorn/stages/track_building/segmentation.py`, merge request
https://gitlab.cern.ch/gnn4itkteam/acorn/-/merge_requests/249), run on the same scored graphs.

- Input: 993 valset events (1 muon + ~120k BIB hits each), graphs from the v3 embedding,
  scored by the v3 GNN (`gnn_cosine_long` epoch 154, the model in `../trained_gnn/v3/`).
- Physics: acorn matching (50% hits, tracks >= 5 hits), ATLAS and two-way; BIB "particle 0" dropped.
  "filt" = keep tracks with >= 7 hits and mean internal edge score (edges > 0.01) >= 0.5.
- Compute: `get_tracks` wall time per event, 1 thread, Perlmutter CPU node (64 events in parallel),
  loading and matching excluded.

Files:

- `graph_segment/` - the same benchmark with the C++ graph_segment backends (~10 ms/event)
- `table.txt` - summary table (eff, fake, dup, two-way eff, tracks/event, time mean/median/p99/max)
- `per_event.csv` - one row per event x backend x filter: time and the matching counts
  (`*_n_particles`, `*_n_reco_particles`, `*_n_reco_matches`, `*_n_tracks`, `*_n_matched_tracks`;
  eff = reco_particles / particles, fake = 1 - matched_tracks / tracks,
  dup = (reco_matches - reco_particles) / reco_particles; sum over events first)
- `raw.pkl` - the same counts as written by the script
- `muon_collider_segmentation_benchmark.py`, `run.sh` - how it was produced
  (`--report <dir>` reprints the table from raw.pkl)

Summary (see `table.txt`):

| backend | eff | fake | dup | eff 2-way | eff / fake (filt) | time / event |
|---|---|---|---|---|---|---|
| cc (0.01) | 0.000 | 1.000 | - | 0.000 | 0.000 / - | 1.16 s |
| cc (0.9) | 0.189 | 0.041 | 0.000 | 0.178 | 0.183 / 0.005 | 1.11 s |
| cc_walk (0.01/0.3/0.8) | 0.989 | 0.306 | 0.017 | 0.983 | 0.985 / 0.027 | 1.15 s |
| cc_score_guided_walk (mode 2) | 0.992 | 0.303 | 0.011 | 0.986 | 0.989 / 0.022 | 1.18 s |
| cc_bestpred_walk (0.01/0.3/0.8) | 0.993 | 0.303 | 0.012 | 0.988 | 0.990 / 0.019 | 0.022 s |
| cc_junction_removal (0.7/3/0.5) | 0.991 | 0.034 | 0.138 | 0.928 | 0.979 / 0.003 | 0.021 s |

The recommended backend is cc_bestpred_walk with the filter.
