Export every recorded input, not only the ones that vary

`export runs` dropped a `param.*` column whose value was constant across the
exported runs, so a downstream filter broke depending on which runs the
selection happened to hold. Every input the selection recorded is a column
now; `--params` still narrows it to a sweep's axis. The metrics default is
unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Hra4ndWMCLU5F3KjUuVAc
This commit is contained in:
2026-08-29 13:47:00 +02:00
co-authored by Claude Opus 5
parent c050a7a52c
commit 73cd37a608
4 changed files with 21 additions and 35 deletions
+6 -23
View File
@@ -422,25 +422,6 @@ def _dig(record: dict[str, Any], path: str) -> Any:
return value
def _varying(runs: list[Run]) -> list[str]:
"""The inputs that differ across these runs — the axis of a sweep.
What a reader comparing arms wants as columns, compared leaf by leaf: two
configurations differing in one field give that field as a column rather
than two blobs that are not the same. Under two runs nothing can differ,
and a table of one run with none of its inputs in it is not worth reading,
so all of them are kept.
"""
keys = sorted({path for run in runs for path, _ in _leaves(run.params)})
if len(runs) < 2:
return keys
return [
key
for key in keys
if len({json.dumps(_dig(run.params, key), sort_keys=True) for run in runs}) > 1
]
def _scored(runs: list[Run]) -> list[str]:
"""A run's final numbers: every number its declared outputs carry, however
deep it sits. A flag is not a number, and neither is a label."""
@@ -557,9 +538,9 @@ def export_runs(
"""One row per run: what it was given, what it scored, what code it ran.
The arm-comparison table. Inputs are columns rather than one JSON blob —
by default the ones that vary across the selection, which is the sweep
axis; ``params`` names them instead. ``metrics`` narrows the final numbers
to a few of a run's declared outputs.
every input the selection recorded, so the schema is the same whichever
runs are asked for; ``params`` narrows it. ``metrics`` narrows the final
numbers to a few of a run's declared outputs.
Both take dotted paths into a record a node returned:
``metrics=final_metrics.train_loss,test_metrics.known.perfect`` selects
@@ -567,7 +548,9 @@ def export_runs(
depth.
"""
runs = _selected(session, flow, status, group, ids, since, until)
inputs = [part for part in params.split(",") if part] or _varying(runs)
inputs = [part for part in params.split(",") if part] or sorted(
{path for run in runs for path, _ in _leaves(run.params)}
)
scores = [part for part in metrics.split(",") if part] or _scored(runs)
columns = [
*RUN_COLUMNS,