Allow giant analyze to compare multiple rollouts against a single shared reference #77
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Today
giant analyzeis hardwired end-to-end for exactly one rollout vs one reference. Goal:accept multiple rollouts, render them as distinct colored series in the same plots, with
exactly one reference line/histogram — and assert all supplied rollouts point at the same
reference (seed) file, since the whole premise is "compare candidates against one ground
truth," not N independent comparisons.
Concrete places this is currently singular:
giant/analysis/sources.py—Sideenum (line ~84) is binaryrollout/reference.giant/analysis/catalog.py—Bundle(line ~65) holds one fixedr_all/t_all/r_phys/t_physpair; the literal keys_ROLL = "rollout"/_REF = "reference"(line ~147) are baked into every
compute_partial/finalizeacross all plot families(marginals, per-event totals, shower profiles, species/leakage, secondaries, router
diagnostics).
giant/analysis/reduced.py—Reduced.payloadis keyed by the string literals"rollout"/"reference"(or"{key}_mean"/"_std"for profiles), not a list/dict of series.giant/analysis/render.py—_SERIES_LABELS(line ~25) is a fixed 2-entry dict; everyrenderer (
_render_overlay,_render_profile,_render_bar,_render_router_gating,_render_router_share) hardcodes iteration over("reference","rollout")or the reverse.No explicit color map exists — colors come from matplotlib's default cycle over exactly 2
items.
_render_bar's bar-offset math (width/2) assumes exactly 2 bars.giant/analysis/condor.py—load_rollout_yaml()(line ~100) requires exactly one YAML(
output+datasetkeys);RunMeta.rollout: str(line ~144) is singular;derive_run_dir,prep(),compute_reduced/compute_oneall assume one rollout. The condor job grid ischunked only by
(plot_id, chunk_index)— no rollout dimension.giant/cli.py—analyze prep/analyze submit(analyze_app, ~line 1550) take a singlepositional
rollout_yaml: Path;analyze rendertakes a singlerun_dir.Needed changes:
giant analyze submit rollout_a.yaml rollout_b.yaml ...). Validate up front that every YAML'sdataset(reference file) matches— fail fast with a clear error otherwise. Single-rollout usage (today's YAML schema, N=1)
must keep working unchanged.
sources.py: generalize the binarySideinto "one reference side" + "a named list ofrollout sides" (name = YAML stem, or an explicit label field in the YAML).
catalog.py: generalizeBundleto a reference pair plus adict[name, frames]forrollouts; rewrite every
compute_partial/finalizeto loop over rollout names instead ofthe hardcoded
"rollout"key.reduced.py: changeReduced.payloadschema so series are represented as aname-keyed structure (e.g.
payload["series"] = {name: ...}) with the reference kept as onedistinguished entry, not a second hardcoded literal.
render.py: replace_SERIES_LABELSand the hardcoded 2-tuples with a loop over N rolloutseries + 1 reference; add an explicit color palette (reference gets one fixed, consistent
style — e.g. black/dashed — across every plot; each rollout gets a distinct color, stable
across plots for the same run). Fix
_render_bar's two-bar offset math to handle N+1 bars.condor.py:RunMeta.rollout: str→ a list of named rollouts sharing onereference;derive_run_dirneeds to combine multiple rollout identifiers into one run-dir name;compute_reduced/compute_oneneed a way to iterate rollouts per (plot, chunk) job —likely simplest to keep chunking by
event_idand loop rollouts inside one compute-onejob (reading N rollout files instead of 1), rather than exploding the condor queue by a
rollout dimension.
prediction_id/stem; with N rollouts it needs to represent a set.