Skip to content

Add Autorevert Signal Grid toggle to HUD - #7942

Merged
izaitsevfb merged 53 commits into
mainfrom
autorevert-hud-view
Apr 9, 2026
Merged

Add Autorevert Signal Grid toggle to HUD#7942
izaitsevfb merged 53 commits into
mainfrom
autorevert-hud-view

Conversation

@izaitsevfb

@izaitsevfb izaitsevfb commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

image

Adds an "⚡ Autorevert" toggle button to the HUD page (pytorch/pytorch main only) that switches between the normal job grid and an autorevert-specific signal grid.

Features

  • Signal grid: commits × signals matrix from autorevert state snapshots
  • All events visible: retries shown (not aggregated) — important for autorevert context
  • Cell highlights: red (suspect commit), blue (baseline), light-red (newer failures), dashed (restart targets)
  • AI advisor integration: verdict badges (REV/OK/JNK/?) with click-to-expand reasoning popover using AdvisorSection from PR Show AI advisor verdicts on HUD job cells #7940
  • Controls: timestamp navigator (±5min arrows + DateTimePicker + Now), workflow multi-select, signal text filter
  • Dark mode: full support via CSS variables
  • Shareable: URL param ?autorevert=1 persists the toggle state
image

Architecture

  • API endpoint /api/autorevert/state merges multiple workflow-set state snapshots from misc.autorevert_state into a unified response
  • Components: AutorevertView, AutorevertGrid, AutorevertCell, AutorevertControls in components/autorevert/
  • CH query: autorevert_state_for_ts fetches state rows near a target timestamp

Test plan

  • next build succeeds
  • Lintrunner passes
  • Manual test: navigate to pytorch/pytorch HUD, click toggle, verify grid renders
  • Test timestamp navigation and workflow filtering
  • Test dark mode

See the vercel preview.

Here's how a specific revert decision looks like (link shared with the reverted PR author).

screenshot image

or a more recent one

Adds a "⚡ Autorevert" toggle button to the HUD page (pytorch/pytorch main
only) that switches between the normal job grid and an autorevert-specific
signal grid showing commits × signals with:

- All events per cell (retries visible, not aggregated)
- Cell highlights: red (suspect), blue (baseline), dashed (restart)
- AI advisor verdict badges with click-to-expand reasoning
- Outcome badges per column (REV/RST/N/A)
- Timestamp navigator with ±5min arrows and DateTimePicker
- Workflow and signal text filters
- Dark mode support

Architecture:
- /api/autorevert/state endpoint merges multiple workflow-set
  state snapshots from misc.autorevert_state into unified response
- Client-side rendering with AutorevertView, AutorevertGrid,
  AutorevertCell, AutorevertControls components
- Reuses AdvisorSection and advisorVerdictUtils from PR #7940
- URL param (?autorevert=1) for shareability
@vercel

vercel Bot commented Apr 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
torchci Ready Ready Preview Apr 9, 2026 11:01pm

Request Review

@pytorch-bot pytorch-bot Bot added the ci-no-td label Apr 8, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 8, 2026
1. Toggle redesigned as HUD/Autorevert slider on far right side
2. Default workflows: Lint, trunk, pull (in that order)
3. Larger cells (20px) and more spacing between signals
4. Signal headers no longer truncated (overflow: visible)
5. Signal name hover shows full "workflow: key" + outcome details
6. Event hover uses MUI Tooltip with structured event details
7. Commits list uses only commits from state (not commit_times keys)
1. Settings panel back in original position, toggle moved after it
2. Wider cells (26px), larger event icons (1rem), show last 2 events
   with "+N" overflow indicator when >2 events per cell
3. Individual event tooltips (not grouped) with larger font (0.9rem)
4. Commits filtered to only those with events in visible columns
5. Available workflows includes monitored workflows from top-level
   array (fixes missing "Lint")
1. Commit list trimmed only from bottom (middle gaps preserved)
2. +N overflow badge: shown only for +2 or more, placed after events,
   click expands entire column (single column expanded at a time,
   highlighted background)
3. Time column tooltip with "Go here →" to navigate to that timestamp
4. Commit SHA tooltip fetches PR title, author, links to PR and HUD
   (lazy-loaded from commit_info_for_shas CH query)
5. << >> arrows for ±1 hour navigation alongside ◀ ▶ for ±5 min
6. AI advisor verdicts lazy-fetched via advisor_verdicts_for_hud
   query (from PR #7940) with per-event individual tooltips
7. Available workflows includes monitored workflows (Lint fix)
- Fix HUD URL: /pytorch/pytorch/commit/<sha> (not /hud/.../1)
- Guard against API returning error/partial data (no columns/commits)
  which caused "Cannot read properties of undefined" crash
The query now finds the most recent state per workflow set at or
before the target timestamp, with no lower bound. Previously,
navigating >10min before any snapshot returned empty results.
Use argMax(state, ts) GROUP BY workflows to get exactly the most
recent state per workflow set within a 24h window. Previously the
JOIN-based query caused a full table scan and browser hang.
Renamed ts → target_ts param and ts → snapshot_ts output column
to avoid ambiguity. Parse as String with toDateTime() for reliable
timezone handling. Also fixed row.workflows.sort() mutation.
- Grid time column uses LocalTimeHuman (same as main HUD)
- DateTimePicker stays in local time, converts to UTC only for API
- "Go here" tooltip shows local time
- Snapshot timestamp displays in local time
- Grid→picker navigation parses UTC and converts to local
Shows counts of autorevert actions (RST/RVT/AI) that occurred
between consecutive commits. Fetched from misc.autorevert_events_v2,
filtered by selected workflows.

- "5 RST" (blue), "1 RVT" (red), "2 AI" (purple) badges
- Click navigates to the commit's timestamp to see the state
  at that point in time
- Events fetched lazily for the time range of visible commits
ClickHouse returns timestamps without timezone suffix (e.g.
"2026-04-09T01:05:05"). JavaScript's new Date() treats these as
local time, causing wrong time range calculation for event queries.
Fixed by appending Z suffix before parsing, in all three locations:
- AutorevertView (time range for events query)
- AutorevertGrid (event bucketing per commit)
- API state.ts (commit sorting)
1. AI advisor dispatches now show with dashed purple border on cells
   (like restart's dashed orange border) + pulsing "AI" badge
2. Tooltip explains dispatch: "An AI advisor has been dispatched..."
3. Legend updated with "AI dispatched" dashed purple box

4. Signal key format standardized to "workflow:key" (no space after
   colon) everywhere: headers, tooltips, filter, CommitSummary
5. Extracted signalId(), parseFilterTerms(), signalMatchesFilter()
   to types.ts for shared use
6. 19 new tests covering signalId, parseFilterTerms, signalMatchesFilter
Cell interaction redesigned:
- Click on any cell opens a Popover (not Tooltip) with full details
- AI advisor section shows the full AdvisorSection component with
  expandable reasoning, verdict badge, confidence, summary, and
  "View advisor run" link
- "AI Advisor Analysis" label introduces the section
- Dispatch pending shows purple [AI] badge + explanation text
- Removed onClick from the tiny AI badge — popover handles everything
- Switched from Tooltip to Popover for cell details (interactive
  content: links, expandable reasoning, scrollable)
- New prop advisorWasDispatched (separate from advisorDispatchPending)
- Dashed purple border shown whenever cell was dispatched (not just
  when pending)
- Popover always explains "Autorevert dispatched an AI advisor to
  analyze this failure" when dispatched, then shows the verdict
  below if available
- When verdict hasn't arrived yet, says "The verdict has not been
  received yet"
1. Ran yarn format (CI requires it)
2. Cell popover now has 300ms hover delay before opening — prevents
   the popover from triggering while scrolling through the grid
MUI Popover creates a modal backdrop that captures scroll events,
making the grid unscrollable when a cell tooltip is open.

Replaced with a CSS-based tooltip using the same approach as the
main HUD's TooltipTarget: absolutely positioned div with
pointer-events: none on the container (doesn't block scrolling)
and pointer-events: auto on the content (links still clickable).

200ms hover delay prevents tooltip flashing while scrolling.
When &ar_focus is present in the URL, the grid only shows signals
that have either:
- An AutorevertPattern outcome (revert decision)
- An AI advisor "revert" verdict (from state or CH)

Useful with ar_sha to create focused permalinks showing only the
signals relevant to a specific revert decision.

Example:
/hud/.../autorevert?ar_sha=abc1234&ar_focus&ar_notl
@izaitsevfb
izaitsevfb merged commit 0718296 into main Apr 9, 2026
10 checks passed
@izaitsevfb
izaitsevfb deleted the autorevert-hud-view branch April 9, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants