Skip to content

[CRCR] Compute nightly summary stats from matrix data instead of raw array - #8696

Open
subinz1 wants to merge 2 commits into
mainfrom
crcr-nightly-summary-from-matrix
Open

[CRCR] Compute nightly summary stats from matrix data instead of raw array#8696
subinz1 wants to merge 2 commits into
mainfrom
crcr-nightly-summary-from-matrix

Conversation

@subinz1

@subinz1 subinz1 commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the discrepancy between the nightly summary cards (Total Jobs, Failures) and the table reported in #8691.

Root cause: NightlySummaryCards computed stats from the raw data array (all individual job records), while the table uses buildNightlyMatrix() which groups jobs by pytorch_head_sha and keeps only the latest run_attempt per (sha, job_name). When multiple run_ids target the same SHA (e.g., nightly re-triggers), the summary counted all jobs individually but the table collapsed them into one row — so "Total Jobs 42" in the card while only 35 cells were visible.

Fix: Change NightlySummaryCards to accept the matrix rows (post SHA-grouping and dedup) and iterate over row.jobs.values() to compute stats. This ensures the cards count exactly the jobs visible in the table.

Before: NightlySummaryCards({ data: CrcrJobRow[] }) — flat array, counts duplicates
After: NightlySummaryCards({ rows: NightlyRow[] }) — matrix rows, matches table

Companion to #8695 (which fixes partial rows at the time-window boundary).

Ref #8691

Test plan

  • Verify Total Jobs / Failures cards match the actual cell counts in the nightly table
  • Confirm Pass Rate is consistent with visible data
  • CI passes

Fixes #8691 (partial — companion: #8695)

The nightly summary cards (Total Jobs, Failures, Pass Rate) were
computed from the flat data array, while the table groups jobs by
SHA and keeps only the latest run_attempt per (sha, job_name). When
multiple run_ids target the same SHA (e.g. re-triggers), the summary
counted all jobs individually but the table collapsed them into one
row — producing a mismatch between the reported totals and the
visible cells.

Now NightlySummaryCards receives the matrix rows (post SHA-grouping
and dedup) and iterates over the visible jobs, ensuring the cards
always match the table.

Ref #8691
@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 Sep 1, 2026
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
torchci Ignored Ignored Sep 1, 2026 1:43pm UTC

Request Review

@subinz1
subinz1 marked this pull request as ready for review September 1, 2026 14:24
@subinz1
subinz1 requested a review from atalman September 1, 2026 14:24
@atalman
atalman deployed to torchci-preview September 1, 2026 14:42 — with GitHub Actions Active
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

torchci preview for 56cead7: https://torchci-6k1aqphpv-fbopensource.vercel.app

Pushing to this PR clears preview-ready; re-apply it to deploy the
new commit.

@subinz1 subinz1 changed the title Compute nightly summary stats from matrix data instead of raw array [CRCR] Compute nightly summary stats from matrix data instead of raw array Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CRCR] Fix discrepancy between jobs and failures reported and the table displayed. Fix invalid no signal on last row

2 participants