# Issue 29: Aurora production of img-clus-match-pr (port of issue 27)

> **File names renamed 2026-09-30 (issue 33 cleanup).** `wcls-img-clus-matching-xin-lib.jsonnet` is now `wcls-img-clus-matching-pr-lib.jsonnet`; the 1-step jobs `wcls-img-clus-matching-xin{,-hits}.jsonnet` are now `obsolete/wcls-img-clus-matching-pr-{flash,hits}.jsonnet` (the upstream name `wcls-img-clus-matching-xin.jsonnet` stays as a one-line shim); the fcls `wcls-img-clus-matching-xin{,-data,-hits,-data-hits}.fcl` are now `wcls-img-clus-matching-pr-{flash,flash-data,hits,data-hits}.fcl`. Production is the 2-step chain `wcls-img-clus-matching.jsonnet` + `wct-pr.jsonnet`. The names below are as they were when this work ran.


Tracking: https://github.com/HaiwangYu/wire-cell-toolkit-ai-helper/issues/29
Plan: `docs/aurora-img-clus-match-pr-production-plan.md` (v2, 2026-09-16).

## scripts/
- `probe-aurora.pbs` -- phase A1 probe (node facts, `/tmp`, cgroup, userns/fuse, proxy, apptainer
  modes, Recipe A' via twester's Flare UPS tree incl. an `eventdump.fcl` of a Gen2 reco1 file with
  the product check, Recipe B via cvmfsexec + fnal-dev-sl7, and a one-time `apptainer pull` of the
  dev image into `$Y/images/`). Submit from a UAN: `cd $Y/aurora-build-logs && qsub $S/probe-aurora.pbs`
  (`-A neutrinoGPU::debug2 -q debug -l filesystems=flare:home`, 30 min). Everything it needs is on Flare.

## log
- 2026-09-16 (a): plan v1 written from ALCF docs + sbank + colleagues' Aurora tooling (nothing run on Aurora yet); issue opened.
- 2026-09-16 (b): **plan v2 = review of v1 from `aurora-uan-0010`** (section 0 of the plan lists the corrections).
  Measured: no cgroup limits and direct internet on the UAN, but `user.max_user_namespaces=0` and a
  non-setuid apptainer 1.2.5 -> no containers/cvmfsexec on login nodes; Eagle not mounted; project quota
  3.045/3.2 PB (95 %), 223 M files; unrestricted suballocation **17257 = 28,262 node-hours** (+ `debug2` 472);
  queues via `qstat -Qf` (`debug-scaling` takes 1-256 nodes, `capacity` 1-16 nodes/7 d); twester's Flare UPS
  tree has **sbndcode v10_14_02_03 / larsoft v10_14_02_02** and is launched with plain `apptainer -B /lus/flare
  slf7.sif` (no overlays) -> Recipe A' is the primary recipe; spdlog v1_14_1 + fmt v11_0_2 are on scisoft,
  patchelf and scn are not. **Gen2 reco1 (Q4)**: MC `prodgenie_corsika_proton_rockbox0p1_sbnd`, sbndcode
  v10_14_02_03, 3 productions x ~250k files, 13.24 events/file, 28.4 MB/event (~3.3 M events and ~94 TB
  each); reco1 keeps `simtpc2d:dnnsp` wires (drops gauss/wiener) -> MC fcl. 1M events = prod1
  `reco1/000000-000075`.
  Done on Flare (`$Y=/lus/flare/projects/neutrinoGPU/yuhw`): cloned WCT `polaris-build-fixes` `9195180d`,
  larwirecell `dev-v10_14_02_02` `a02a1a4`, wcp-porting-validation `main`, wire-cell-data `master`
  (still lacks `XGB_nue_seed2_0923.xml`), this repo, cvmfsexec v4.53 (`makedist -m rhel8-x86_64 osg`);
  `$Y/aurora-build-logs`; `gh` 2.101 in `~/bin` (unauthenticated). `probe-aurora.pbs` revised, not yet submitted.
- 2026-09-16 (c): **probe runs 1-2 (jobs 8832255, 8832311, `debug`, node exclusive to us)**: Xeon Max 9470C, 208 threads (affinity 1-51,53-103,105-155,157-207), 1.1 TB, `/tmp` = 504 GB RAM tmpfs (no NVMe, no `/local/scratch`), no cgroup limits, `max_user_namespaces` 4.1 M, `unshare -U -r` ok, `/dev/fuse` present; proxy reaches GitHub, the CVMFS stratum-1, scisoft and DockerHub. `module load apptainer` (1.2.5) works in batch **only if not piped** (a `| tail` runs the module function in a subshell -> "apptainer: command not found", run 1). `slf7.sif` runs in all three modes (no flag, `--fakeroot`, `--userns`). **Recipe A' bare tree**: `source .../scisoft/larsoft/setup; setup sbndcode v10_14_02_03 -q e26:prof` -> `lar` = art 3.14.04 in 5 s, `eventdump.fcl` on a Gen2 reco1 file rc=0 in 32 s (`simtpc2d` badmasks/wienersummary, `ionandscint:priorSCE` SEDs, MCTruth/MCParticle seen; wires/OpFlash cut off by `head -40`, recheck in the smoke). `slf7.sif` has no `bzlib.h` (40 -devel rpms) -> builds use `$Y/images/fnal-dev-sl7.sif` (pulled from DockerHub through the proxy in 42 s, 548 MB). **Recipe B**: cvmfsexec mounts sbnd/larsoft/fermilab/singularity/uboone through the proxy (`sbn.opensciencegrid.org` was not mounted so `setup_sbnd.sh` failed -- irrelevant now); cache 376 MB. **scn v01_00_00 copied** from uboone CVMFS to `$Y/products/scn` (5.2 GB, 9 min). `$Y/products` overlay now: spdlog v1_14_1, fmt v11_0_2, srproxy v00.44 (py3915; missing from the tree and required by the sbndcode chain on the UAN), scn, `.upsfiles`; `$Y/tools/bin/patchelf` 0.14.5 static.
  **Build runs 1-3 failed before configure**: run 1 the overlay lacked `.upsfiles` (ups rejected PRODUCTS, system gcc 4.8); runs 2-3 gcc 12.1 + spdlog/fmt from the overlay are active but root/python are not (system python 3.6 -> `wscript` f-string `SyntaxError`), although the same `setup-aurora-opt.sh` sequence completes on the UAN (135 products, python 3.9). Run 4 (8832360) prints the setup stderr inside the container to find out why.
- 2026-09-16 (d): **build run 4** found the remaining setup fault by printing the container's setup stderr: `unsetup wirecell` (no `-j`) also unsetups root/python/boost -> `unsetup -j` (reproduced and fixed on the UAN in an `env -i` shell); then `wscript` needed `git describe --tags` (fork clone has no tags -> `git fetch upstream --tags`). **Build run 5 (8832376, debug-scaling, 6.6 min): WCT `polaris-build-fixes` 9195180d installed to `$Y/opt`, all §1 gates pass** -- configure 2m15 (spdlog v1_14_1 + fmt v11_0_2 lib64 from the overlay), `wcb install -j96` 3m26, `nlibs=19` incl. Mcs, `single_threaded_syms=0`, `fmt_needed=0`, RUNPATH spdlog/v1_14_1, `rpath_stripped=20`, `ldd_not_found=0`, `miniz.h` copied. larwirecell stage failed: `mrb newDev` needs `MRB_PROJECT=larsoft` (set by `setup_sbnd.sh` at FNAL, not by the bare tree setup) -> exported in `setup-aurora-opt.sh`; rerun as `qsub -v STAGES=lwc` (8832409).
- 2026-09-16 (e): **larwirecell built (8832409, 4.1 min)**: MRB area `$Y/larsoft-wct/v10_14_02` (`mrb newDev -v v10_14_02_02 -q e26:prof`, `srcs/larwirecell` = local clone of `dev-v10_14_02_02` a02a1a4); `mrbSetEnv` prints the sbnobj version-conflict error as on Polaris (fallback path), cmake configure 125 s, `mrb b -j96` rc=0; `WireCell_INCLUDE_DIR` = `$Y/opt/include`, `spdlog_DIR` = overlay v1_14_1, found WireCell "polaris-build-fixes-0.35.0-1623-g9195180"; **11 libs + 20 fcl deployed** to `$Y/opt/larwirecell/v10_01_28/slf7.x86_64.e26.prof/`, `tree_wirecell_refs=0`. Phase A2 done. Smoke (8832456, `smoke.pbs`, Gen2 MC reco1 file, MC fcl, 8 events, resync on) submitted; the 19-event data set, the FNAL/Polaris reference runs and `XGB_nue_seed2_0923.xml` are still not on Flare.
- 2026-09-16 (f): **smoke run 1 (8832456, Gen2 MC reco1, MC fcl)**: operating-point resync **GATE PASSED, 0 differences** (253 before regeneration = the usual header/knob regeneration; `pr-operating-point.jsonnet` unchanged in git); eventdump confirms the reco1 carries `simtpc2d` **dnnsp + gauss** wires, wienersummary, badmasks, badchannels, `opflashtpc0/1`, `ionandscint:priorSCE` SEDs, MCTruth/MCParticle -> the MC fcl applies unchanged. `lar` exited 9 at module construction: `clus.jsonnet` hard-codes `sce_map_file: /cvmfs/sbnd.opensciencegrid.org/products/sbnd/sbnd_data/v01_42_00/SCEoffsets/SCEoffsets_SBND_E500_dualmap_CV_voxelTH3.root` (the only `/cvmfs` path in the compiled config; the file is in the Flare tree). Fix without touching the config: `in-aurora-sl7.sh` binds the Flare UPS tree at `/cvmfs/sbnd.opensciencegrid.org/products/sbnd` (apptainer underlay enabled). Rerun 8832493 (`DO_RESYNC=0`).
- 2026-09-16 (g): **smoke run 2 (8832493): the 1-step chain runs on Aurora.** Event 0 cold rc=0, 204 s, RSS 1.80 GB, audit ok, DL vertex 0 failures (first torch import 50 s, warm 11 ms), 8 trees, T_tagger/T_kine 1 entry; **8 events in parallel (taskset 2 cores each, cores 1-16): 8/8 rc=0, audit ok, DL vertex on, 20-79 s/event, RSS 1.45-1.88 GB**, 4 of 8 with 4 trees (no candidate); batch wall 80 s; outputs 3.2 MB/event (mabc.zip 1.7, trash 0.6, nugraph.h5 0.34, tracking-pr.root 0.28). Run dir `$Y/production-prep/gen2mc-smoke-20260916-1938`. Phase A3(b)-MC done; A3(a) 19-event data validation waits for the Globus transfer. ~0.6 node-hours charged to `debug2` so far.
- 2026-09-17: reference data arrived on Flare by Globus (`alcf#dtn_eagle` -> `alcf#dtn_flare`): the 19-event `nc-sideband_filtered_frameshift.root`, `production-prep/r3-ncpi0-lynn-2026-09-15` (FNAL), `production-prep/ncsb-data-nuebdt-20260916-0446` (Polaris), and the whole Eagle `wire-cell-data` (with `XGB_nue_seed2_0923.xml`; the transfer nested it as `wire-cell-data/wire-cell-data` and replaced the GitHub clone -> moved up one level; it is the Polaris-validated tree at 74ff57a + the XGB file). **19-event data run (8834283, `smoke.pbs` `FCL=wcls-img-clus-matching-xin-data.fcl NEVT=18 DO_RESYNC=0 TAG=ncsb-data`, run dir `production-prep/ncsb-data-20260917-1313`): 19/19 rc=0, audit ok, DL vertex 0 failures, 8 trees each, T_tagger/T_kine 1 entry, nue weights found (0 "weight file not found")**; event 0 cold 311 s (RSS 1.99 GB), events 1-18 in parallel 37-93 s each, RSS 1.92-2.00 GB, batch wall 95 s. Compare job 8834303 (`compare-to-fnal.pbs`, vs FNAL and vs Polaris) submitted.
- 2026-09-17 (b): **validation EXACT 19/19** (compare job 8834303, 2.4 min): `deep_compare.py` Aurora vs FNAL `r3-ncpi0-lynn-2026-09-15` identical T_kine+T_tagger hashes and every T_rec_charge point in all 19 events, every-branch census 0 differing (tree, branch) pairs; Aurora vs Polaris `ncsb-data-nuebdt-20260916-0446` likewise exact 19/19, 0 pairs. Bee (FNAL order): Aurora https://www.phy.bnl.gov/twister/bee/set/863b9ee0-d159-4b91-b633-e27f3883b207/event/list/ . Phase A3 done; next A4 scaling (needs plan decisions 1-3).
- 2026-09-17 (c): **MC CV pilot (issue 26 plan `docs/aurora-1step-validation-plan.md`) EXACT on every check** -- run 8834405 (`smoke.pbs DO_GATES=1 DO_RESYNC=0 NEVT=17`, dir `production-prep/mccv-pilot-20260917-1420`): G1-G6 pass (G4 `0 differences`, G5 sparseconvnet + torch 2.6.0, md5s of input/XGB/pth match), 18/18 rc=0, audit ok, DL vertex 0, rse_check ok vs `pilot.manifest`, 8 trees for events 6/11/29/37/47 and 21 Bee layers there, 18 elsewhere (same as the reference); compare 8834439 (`compare-mccv.pbs`): `deep_compare` exact 18/18, `compare_bee_zips` identical 18/18, `reference_checksums` 372/372 lines identical, branch census 0 pairs. Deviations agreed with Haiwang: WCT 9195180d (= pin 0ad64223 + 2 warning fixes, cfg identical), wcp-porting-validation main 794e470c (pin e100a631 = main + `enable_nugraph_h5`), wire-cell-data 74ff57a (= pin + 1 PDVD file). Reported on #26. Fixed `smoke-1evt.sh`: SL7 git 1.8 has no `git -C` (the WCT/LWC commit line printed "Unknown option: -C").
- 2026-09-17 (d): **50-event MC CV bench on Avinay's `gen2-cv-50evt-benchmark-20260915` reco1 (the sample family for the production, per Haiwang) -- exact 50/50 vs FNAL `r4-avinay-sep16-test`**: run 8834727 (`smoke.pbs DO_GATES=1 NEVT=49`, dir `production-prep/avinay-bench50-20260917-1545`): G4 0 differences, G5 ok, 50/50 rc=0/audit ok/DL vertex 0, rse_check ok, 20/50 candidates (same 20 as FNAL), 57 s/event mean at 49 concurrent (max 101), RSS max 2.11 GB, cold 199 s; logs clean. Compare 8834797 (`compare-mccv.pbs` with the r4 layout): `deep_compare` exact 50/50, `compare_bee_zips` identical 50, checksums 1070/1070, census 0 pairs. Bee (50 events, ascending event no., same order both): Aurora https://www.phy.bnl.gov/twister/bee/set/1e0bf31b-6588-4534-92c0-9483ca33fd16/event/list/ , FNAL reference https://www.phy.bnl.gov/twister/bee/set/b5a83966-c296-481e-83a7-5036c8503212/event/list/ . Reported on #26 and #29. **Production input decision (Haiwang): not twester's prod1-3 but new samples generated by Avinay** -- the plan's section 1.5 / decision 1 must be revised once the sample is produced.
- 2026-09-17 (e): definition of "exact" recorded in the #29 comment (https://github.com/HaiwangYu/wire-cell-toolkit-ai-helper/issues/29#issuecomment-5717512408): no byte comparison of ROOT/zip files; `deep_compare.py` (T_kine 21 + T_tagger 1216 branches at 1e-6, every T_rec_charge point at 1e-5), every-branch census of all 8 trees at full float precision (0 pairs = last-bit equal), `reference_checksums.py` text diff, `compare_bee_zips.py` md5 of every Bee JSON layer (byte-identical JSON; numeric fallback at rtol 1e-9 never triggered).
