From 62ddf0e4779928c45b8b62b3cc7eb1b6a15917fb Mon Sep 17 00:00:00 2001 From: adibarra <93070681+adibarra@users.noreply.github.com> Date: Thu, 2 Apr 2026 21:44:14 -0500 Subject: [PATCH 1/2] fix: reduce CDN s-maxage from 1 year to 1 day --- packages/app/src/lib/api-cache.test.ts | 4 ++-- packages/app/src/lib/api-cache.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/app/src/lib/api-cache.test.ts b/packages/app/src/lib/api-cache.test.ts index 7003442..ad800e9 100644 --- a/packages/app/src/lib/api-cache.test.ts +++ b/packages/app/src/lib/api-cache.test.ts @@ -143,9 +143,9 @@ describe('purgeAll', () => { }); describe('cachedJson', () => { - it('sets Cache-Control with max-age=0 and 1 year s-maxage', () => { + it('sets Cache-Control with max-age=0 and 1 day s-maxage', () => { const res = cachedJson({ ok: true }); - expect(res.headers.get('Cache-Control')).toBe('public, max-age=0, s-maxage=31536000'); + expect(res.headers.get('Cache-Control')).toBe('public, max-age=0, s-maxage=86400'); }); it('sets Vercel-Cache-Tag to db', () => { diff --git a/packages/app/src/lib/api-cache.ts b/packages/app/src/lib/api-cache.ts index 1dbb976..14ab5d6 100644 --- a/packages/app/src/lib/api-cache.ts +++ b/packages/app/src/lib/api-cache.ts @@ -47,9 +47,9 @@ export async function purgeAll(): Promise { return deleted; } -/** 1 year — Vercel max. Purged on demand via revalidateTag('db'), no TTL needed. */ +/** 1 day. Purged on demand via revalidateTag('db'). */ const CDN_HEADERS = { - 'Cache-Control': 'public, max-age=0, s-maxage=31536000', + 'Cache-Control': 'public, max-age=0, s-maxage=86400', 'Vercel-Cache-Tag': 'db', }; From f390b53ba3ff9260abf5334561e2a5454c03b1f3 Mon Sep 17 00:00:00 2001 From: adibarra <93070681+adibarra@users.noreply.github.com> Date: Thu, 2 Apr 2026 21:53:36 -0500 Subject: [PATCH 2/2] fix: show one row per run date in submissions table instead of aggregated --- .../submissions/SubmissionsTable.tsx | 25 ++-------- .../submissions/submissions-utils.test.ts | 8 +-- .../submissions/submissions-utils.ts | 6 ++- packages/app/src/lib/submissions-types.ts | 4 +- packages/db/src/queries/submissions.ts | 49 ++++++++++++------- 5 files changed, 43 insertions(+), 49 deletions(-) diff --git a/packages/app/src/components/submissions/SubmissionsTable.tsx b/packages/app/src/components/submissions/SubmissionsTable.tsx index 1c5830e..1a67569 100644 --- a/packages/app/src/components/submissions/SubmissionsTable.tsx +++ b/packages/app/src/components/submissions/SubmissionsTable.tsx @@ -41,13 +41,7 @@ function DetailItem({ ); } -type SortKey = - | 'hardware' - | 'model' - | 'precision' - | 'framework' - | 'latest_date' - | 'total_datapoints'; +type SortKey = 'hardware' | 'model' | 'precision' | 'framework' | 'date' | 'total_datapoints'; type SortDir = 'asc' | 'desc'; interface SubmissionsTableProps { @@ -62,7 +56,7 @@ function getModelDisplayName(dbModel: string): string { } export default function SubmissionsTable({ data }: SubmissionsTableProps) { - const [sortKey, setSortKey] = useState('latest_date'); + const [sortKey, setSortKey] = useState('date'); const [sortDir, setSortDir] = useState('desc'); const [search, setSearch] = useState(''); const [expandedRows, setExpandedRows] = useState>(new Set()); @@ -119,7 +113,7 @@ export default function SubmissionsTable({ data }: SubmissionsTableProps) { }, []); const rowKey = (row: SubmissionSummaryRow) => - `${row.model}_${row.hardware}_${row.framework}_${row.precision}_${row.spec_method}_${row.disagg}_${row.is_multinode}_${row.num_prefill_gpu}_${row.num_decode_gpu}_${row.prefill_tp}_${row.prefill_ep}_${row.decode_tp}_${row.decode_ep}`; + `${row.model}_${row.hardware}_${row.framework}_${row.precision}_${row.spec_method}_${row.disagg}_${row.is_multinode}_${row.num_prefill_gpu}_${row.num_decode_gpu}_${row.prefill_tp}_${row.prefill_ep}_${row.decode_tp}_${row.decode_ep}_${row.date}`; const SortHeader = ({ label, field }: { label: string; field: SortKey }) => ( - + @@ -219,7 +213,7 @@ function SubmissionRow({ {getModelDisplayName(row.model)} {row.precision} {getFrameworkLabel(row.framework)} - {row.latest_date} + {row.date} {row.total_datapoints.toLocaleString()} {isExpanded && ( @@ -231,15 +225,6 @@ function SubmissionRow({ {vendor} - - {row.first_date} - - - {row.run_days} - { prefill_ep: 1, decode_tp: 4, decode_ep: 1, - first_date: '2026-01-01', - latest_date: '2026-01-10', - run_days: 10, + date: '2026-01-10', total_datapoints: 100, distinct_sequences: 3, distinct_concurrencies: 10, @@ -117,9 +115,7 @@ describe('computeTotalStats', () => { prefill_ep: 1, decode_tp: 8, decode_ep: 1, - first_date: '2026-01-05', - latest_date: '2026-01-10', - run_days: 5, + date: '2026-01-05', total_datapoints: 50, distinct_sequences: 2, distinct_concurrencies: 5, diff --git a/packages/app/src/components/submissions/submissions-utils.ts b/packages/app/src/components/submissions/submissions-utils.ts index 40a6d75..0989795 100644 --- a/packages/app/src/components/submissions/submissions-utils.ts +++ b/packages/app/src/components/submissions/submissions-utils.ts @@ -93,18 +93,22 @@ export function computeCumulative(volume: SubmissionVolumeRow[]): CumulativePoin /** Compute total stats from summary rows. */ export function computeTotalStats(summary: SubmissionSummaryRow[]) { let totalDatapoints = 0; + const configs = new Set(); const models = new Set(); const gpus = new Set(); for (const row of summary) { totalDatapoints += row.total_datapoints; + configs.add( + `${row.model}_${row.hardware}_${row.framework}_${row.precision}_${row.spec_method}_${row.disagg}_${row.num_prefill_gpu}_${row.num_decode_gpu}`, + ); models.add(row.model); gpus.add(row.hardware); } return { totalDatapoints, - totalConfigs: summary.length, + totalConfigs: configs.size, uniqueModels: models.size, uniqueGpus: gpus.size, }; diff --git a/packages/app/src/lib/submissions-types.ts b/packages/app/src/lib/submissions-types.ts index fdc2001..ff84041 100644 --- a/packages/app/src/lib/submissions-types.ts +++ b/packages/app/src/lib/submissions-types.ts @@ -12,9 +12,7 @@ export interface SubmissionSummaryRow { prefill_ep: number; decode_tp: number; decode_ep: number; - first_date: string; - latest_date: string; - run_days: number; + date: string; total_datapoints: number; distinct_sequences: number; distinct_concurrencies: number; diff --git a/packages/db/src/queries/submissions.ts b/packages/db/src/queries/submissions.ts index 3b526b9..0971695 100644 --- a/packages/db/src/queries/submissions.ts +++ b/packages/db/src/queries/submissions.ts @@ -7,6 +7,15 @@ export interface SubmissionSummaryRow { precision: string; spec_method: string; disagg: boolean; + is_multinode: boolean; + num_prefill_gpu: number; + num_decode_gpu: number; + prefill_tp: number; + prefill_ep: number; + decode_tp: number; + decode_ep: number; + date: string; + total_datapoints: number; distinct_sequences: number; distinct_concurrencies: number; max_concurrency: number; @@ -19,8 +28,8 @@ export interface SubmissionVolumeRow { datapoints: number; } -/** Get unique config submissions with first/latest date and datapoint counts. - * Uses latest_benchmarks (deduplicated: newest per config+conc+isl+osl, no errors). */ +/** Get per-run config submissions (one row per config × date). + * Uses benchmark_results with error/workflow filters to include full history. */ export async function getSubmissionSummary(sql: DbClient): Promise { const rows = await sql` SELECT @@ -37,34 +46,36 @@ export async function getSubmissionSummary(sql: DbClient): Promise { const rows = await sql` SELECT - lb.date::text, + br.date::text, c.hardware, COUNT(*)::int AS datapoints - FROM latest_benchmarks lb - JOIN configs c ON c.id = lb.config_id - GROUP BY lb.date, c.hardware - ORDER BY lb.date ASC + FROM benchmark_results br + JOIN configs c ON c.id = br.config_id + JOIN latest_workflow_runs wr ON wr.id = br.workflow_run_id + WHERE br.error IS NULL + GROUP BY br.date, c.hardware + ORDER BY br.date ASC `; return rows as unknown as SubmissionVolumeRow[]; }