`giant predict`'s sidecar previously stopped at kind/prediction_id/
output/dataset/checkpoint/timestamp, unlike `giant rollout`'s, which
carries full run provenance (model_config, training_epoch,
training_config, timing, ...) that flows into analysis gallery
metadata. `analyze --prediction` consumed the same thin sidecar, so a
prediction series in an analysis run was nearly unlabeled compared to
its rollout counterparts.
- `_write_prediction_ref` takes an `extra: dict | None` merged into
the sidecar; `giant rollout` now uses it instead of a
load/update/rewrite round trip (identical output).
- New `_build_predict_timing`, key-compatible with
`_build_rollout_timing`, from timers now wrapping predict's setup/
sample/write phases.
- `giant predict` writes coord, has_truth, schema_version, steps,
weights, device, batch_size(+auto), row/skip/unknown-pdg counts,
timing, and the checkpoint's model_config/config_overrides/
training_epoch/best_val_loss/training_config/training_meta.
- `giant/analysis/condor.py`'s `_PLOT_META_KEYS` forwards the new
predict-only keys (plus rollout's previously-unforwarded
config_overrides) into each plot's gallery metadata.yaml.
- Fixes a `ty` regression from the prior commit in
tests/test_cli_predict.py (Command has no static `.commands`).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpxE9nij3ujg9XcuzvQ26q
The --help-text assertion was brittle to CI's terminal width/color
settings (rich can wrap or re-color the flag name mid-word), causing a
false CI failure even though the flag itself is fine. Inspect the
click command's registered option directly instead of parsing rendered
--help output.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpxE9nij3ujg9XcuzvQ26q
Adds a `prediction` plot family to `giant analyze`, alongside the existing
rollout-vs-reference comparison, and extends `giant predict` to make it
possible:
- `giant predict --coord global` gains schema v3 (`--truth/--no-truth`,
default on): writes true_* physical columns and true secondary lists
alongside the predictions, so the output is fully paired.
- New `giant/analysis/prediction.py` builds one canonical true/pred frame
(`paired_frame`) from either predict coord mode.
- `catalog.py` gains 35 `pred_*` specs: marginals, 2D truth-vs-pred scatter
(new `heatmap2d` kind), residuals/relative-residuals/calibration profiles,
KS/bias/RMSE scorecards, n_sec + secondary-species confusion matrices,
direction-alignment and constraint-violation checks, and a correlation
delta. Two new Reduced kinds (`paired_hist`, `heatmap2d`) get renderers.
Every spec degrades to kind="unavailable" with no --prediction given.
- `condor.py`/`cli.py`: `--prediction`/`--prediction-label` on
`analyze prep`/`submit`, threaded through RunMeta and every compute job.
Full test suite (1162 tests), ruff, and ty all pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpxE9nij3ujg9XcuzvQ26q