Skip to content

Color runs by regex (Experiment Name): match experiment aliases first - #7171

Merged
cdavalos7 merged 3 commits into
tensorflow:masterfrom
despoisj:color-by-experiment-alias
Nov 19, 2026
Merged

cdavalos7 merged 3 commits into
tensorflow:masterfrom
despoisj:color-by-experiment-alias

Conversation

@despoisj

@despoisj despoisj commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Motivation for features / changes

"Color runs by regex" with Regex type = Experiment Name (GroupByKey.REGEX_BY_EXP) currently only matches the regex against experiment.name. In the compare view, users assign aliases in the URL (/compare/alias1:eid1,alias2:eid2), and these aliases are what they see and reason about, while experiment names are often auto-generated (e.g. launch timestamps or IDs). As a result, it is not possible to color by the aliases — for example to give a run and its resumed continuation (heads16, heads16_resumed) the same color.

The original feature request (internal b/216856119) asked for matching against the experiment name or its alias; only the name was implemented.

Technical description of changes

  • groupRuns (runs/store/utils.ts): for REGEX_BY_EXP, match the regex against the experiment alias first when one is defined, and fall back to the experiment name otherwise. Also no longer throws if an experiment name is missing for a run.
  • New selector getExperimentIdToAliasTextMap (app_routing/store/app_routing_selectors.ts): experiment id -> alias text, derived from getExperimentIdToExperimentAliasMap.
  • Thread an optional expAliasByExpId through fetchRunsSucceeded, runGroupByChanged, the runs reducer, the runs effects, the regex edit dialog (including the color group preview) and the group menu button.

No new GroupByKey, no URL/state format change, no UI change. Behavior only changes in the compare view, when the regex matches an alias (the alias' capture groups then define the color group). Regexes that match only experiment names keep working through the fallback.

Screenshots of UI changes (or N/A)

Compare view with 5 experiments aliased Baseline, Heads16, Heads16_8x8, Emb512, Emb512_8x8 (experiment names are timestamps), Regex type = Experiment Name:

  • Before, (Heads|Emb|Baseline): "There are no runs matching the regex".
  • After, same regex: 3 color groups — Baseline, Heads (Heads16 + Heads16_8x8), Emb (Emb512 + Emb512_8x8).
  • After, ^20261015 (matches experiment names only): grouped by name as before (fallback).
  • Regex type = Run Name, (train|test): unchanged.
before after

Detailed steps to verify changes work correctly (as executed by you)

  • Manually tested the scenarios above in a compare view (before/after).
  • Unit tests:
    • utils_test.ts: alias takes precedence over name; falls back to name when the alias does not match; works with aliases only.
    • app_routing_selectors_test.ts: getExperimentIdToAliasTextMap for compare and non-compare routes.
    • runs_effects_test.ts: fetchRunsSucceeded includes aliases.
    • regex_edit_dialog_test.ts: runGroupByChanged includes aliases.

Alternate designs / implementations considered (or N/A)

  • A separate "Experiment Alias" regex type: more UI and state (new GroupByKey, serialization) for little benefit, since aliases are only defined in the compare view and falling back to the name keeps existing regexes working.

@cdavalos7
cdavalos7 self-requested a review November 10, 2026 17:50

@cdavalos7 cdavalos7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really appreciate you contributing this. A couple of small suggestions and it's good to go.

@despoisj

Copy link
Copy Markdown
Contributor Author

Thanks for the review and for smoke-testing it!

-> Renamed the label to "Experiment Alias / Name" (dialog option, group menu, test assertion).
-> Added take(1) in onSave(), and a regression test that changing the store after saving doesn't dispatch again.

@despoisj
despoisj force-pushed the color-by-experiment-alias branch from 56a045b to 46ccfac Compare November 19, 2026 09:16

@cdavalos7 cdavalos7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for your contribution Julien

@cdavalos7
cdavalos7 merged commit f13ca37 into tensorflow:master Nov 19, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants