From 0ce3910c9e44f32e4333ae4ea080f9447917b9c3 Mon Sep 17 00:00:00 2001 From: Florent Tapponnier Date: Thu, 25 Jun 2026 18:03:52 +0200 Subject: [PATCH] feat(worker): enumerate venue dimension in variant combos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit variantCombos() walked chain × region × kind only. Specs declaring dimensions.venue (pm-data-freshness, pm-api-latency) saw their venue tabs render in the UI but every variant request fell back to the unfiltered aggregate because the worker never materialized per-venue snapshots. Add venue to the cartesian product and propagate it through variantPath(). After this lands and the worker redeploys, /api/bench//variant?venue=X returns the per-venue snapshot, and the Venue toggle on the bench page actually filters. --- worker/index.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/worker/index.ts b/worker/index.ts index 3c9fb74f..5851788a 100644 --- a/worker/index.ts +++ b/worker/index.ts @@ -191,17 +191,21 @@ function variantCombos(spec: Spec): BenchmarkFilters[] { const chains = (dims.chain ?? []).map((d) => d.value).filter((v) => v !== "all"); const regions = (dims.region ?? []).map((d) => d.value).filter((v) => v !== "all"); const kinds = (dims.kind ?? []).map((d) => d.value).filter((v) => v !== "all"); + const venues = (dims.venue ?? []).map((d) => d.value).filter((v) => v !== "all"); const opt = (xs: T[]): (T | undefined)[] => (xs.length ? [undefined, ...xs] : [undefined]); const combos: BenchmarkFilters[] = []; for (const chain of opt(chains)) { for (const region of opt(regions)) { for (const kind of opt(kinds)) { - if (!chain && !region && !kind) continue; // the aggregate is tier A - combos.push({ - ...(chain ? { chain } : {}), - ...(region ? { region } : {}), - ...(kind ? { kind } : {}), - }); + for (const venue of opt(venues)) { + if (!chain && !region && !kind && !venue) continue; // the aggregate is tier A + combos.push({ + ...(chain ? { chain } : {}), + ...(region ? { region } : {}), + ...(kind ? { kind } : {}), + ...(venue ? { venue } : {}), + }); + } } } } @@ -297,6 +301,7 @@ function variantPath(slug: string, f: BenchmarkFilters): string { if (f.chain) qs.set("chain", f.chain); if (f.region) qs.set("region", f.region); if (f.kind) qs.set("kind", f.kind); + if (f.venue) qs.set("venue", f.venue); return `/api/bench/${slug}/variant${qs.size ? `?${qs.toString()}` : ""}`; }