From c4f29218ef790379af86b06776a6a04c2e63d98a Mon Sep 17 00:00:00 2001 From: KS Date: Tue, 6 Oct 2026 13:02:14 -0400 Subject: [PATCH] add per-platform navbench annotations, mark bug 2050165 on windows --- src/lib/navbench/config.test.ts | 18 +++++++++++++----- src/lib/navbench/config.ts | 20 +++++++++++++++++--- src/routes/navbench/+page.svelte | 3 ++- src/routes/navbench/SubtestChart.svelte | 6 ++++-- src/routes/navbench/SubtestCharts.svelte | 6 ++++-- 5 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/lib/navbench/config.test.ts b/src/lib/navbench/config.test.ts index a58f244..5c660a6 100644 --- a/src/lib/navbench/config.test.ts +++ b/src/lib/navbench/config.test.ts @@ -61,14 +61,22 @@ describe('annotationsFor', () => { const untargeted = { date: '2026-09-03', label: 'Everywhere' }; const targeted = { date: '2026-09-04', label: 'Amazon only', tests: ['amazon-nav-load-score'] }; + const windowsOnly = { date: '2026-07-01', label: 'Windows only', platforms: ['windows'] }; + it('puts an untargeted annotation on every chart, the overall included', () => { - expect(annotationsFor(OVERALL_TEST, [untargeted])).toEqual([untargeted]); - expect(annotationsFor('bbc-nav-load-score', [untargeted])).toEqual([untargeted]); + expect(annotationsFor(OVERALL_TEST, 'linux', [untargeted])).toEqual([untargeted]); + expect(annotationsFor('bbc-nav-load-score', 'windows', [untargeted])).toEqual([untargeted]); }); it('keeps a targeted annotation to the charts it names', () => { - expect(annotationsFor('amazon-nav-load-score', [targeted])).toEqual([targeted]); - expect(annotationsFor('bbc-nav-load-score', [targeted])).toEqual([]); - expect(annotationsFor(OVERALL_TEST, [targeted])).toEqual([]); + expect(annotationsFor('amazon-nav-load-score', 'linux', [targeted])).toEqual([targeted]); + expect(annotationsFor('bbc-nav-load-score', 'linux', [targeted])).toEqual([]); + expect(annotationsFor(OVERALL_TEST, 'linux', [targeted])).toEqual([]); + }); + + it('keeps a platform-targeted annotation to the platforms it names', () => { + expect(annotationsFor(OVERALL_TEST, 'windows', [windowsOnly])).toEqual([windowsOnly]); + expect(annotationsFor('bbc-nav-load-score', 'windows', [windowsOnly])).toEqual([windowsOnly]); + expect(annotationsFor(OVERALL_TEST, 'osxm4', [windowsOnly])).toEqual([]); }); }); diff --git a/src/lib/navbench/config.ts b/src/lib/navbench/config.ts index 110cc2a..199b2b7 100644 --- a/src/lib/navbench/config.ts +++ b/src/lib/navbench/config.ts @@ -73,10 +73,12 @@ export function displayName(test: string): string { * Events worth calling out on the charts, drawn as dashed markers. * * `date` is the autoland push time. `tests` limits an annotation to the charts - * of those tests; without it, the annotation appears on every chart. + * of those tests, and `platforms` to those platform keys; without them, the + * annotation appears on every chart. */ export interface NavBenchAnnotation extends ChartAnnotation { tests?: readonly string[]; + platforms?: readonly string[]; } export const NAVBENCH_ANNOTATIONS: readonly NavBenchAnnotation[] = [ @@ -86,15 +88,27 @@ export const NAVBENCH_ANNOTATIONS: readonly NavBenchAnnotation[] = [ description: 'Added google, facebook, yahoo and google-docs to the benchmark; overall score is now a geomean over more sites', url: 'https://bugzilla.mozilla.org/show_bug.cgi?id=2043896' + }, + { + date: '2026-07-01T20:28:07Z', + label: 'Bug 2050165', + description: 'Cleaned up nav-bench output data and fixed annotated videos on Windows', + url: 'https://bugzilla.mozilla.org/show_bug.cgi?id=2050165', + platforms: ['windows', 'windows-hwref'] } ]; -/** The annotations to draw on one test's chart. */ +/** The annotations to draw on one test's chart on one platform. */ export function annotationsFor( test: string, + platform: string, annotations: readonly NavBenchAnnotation[] = NAVBENCH_ANNOTATIONS ): ChartAnnotation[] { - return annotations.filter((annotation) => !annotation.tests || annotation.tests.includes(test)); + return annotations.filter( + (annotation) => + (!annotation.tests || annotation.tests.includes(test)) && + (!annotation.platforms || annotation.platforms.includes(platform)) + ); } export function videoScenario(test: string): string | undefined { diff --git a/src/routes/navbench/+page.svelte b/src/routes/navbench/+page.svelte index 9b217bf..0f12995 100644 --- a/src/routes/navbench/+page.svelte +++ b/src/routes/navbench/+page.svelte @@ -130,7 +130,7 @@ hidden: new Set(), replicates: false, markers: [], - annotations: annotationsWithinDays(annotationsFor(selectedTest), range), + annotations: annotationsWithinDays(annotationsFor(selectedTest, os), range), reference: selection, yLabel: 'Score (higher is better)', beginAtZero: true @@ -303,6 +303,7 @@ href(withVideoClosed({ test }))} /> {/if} diff --git a/src/routes/navbench/SubtestChart.svelte b/src/routes/navbench/SubtestChart.svelte index 90a6fff..3a0babc 100644 --- a/src/routes/navbench/SubtestChart.svelte +++ b/src/routes/navbench/SubtestChart.svelte @@ -12,11 +12,13 @@ test: string; signatures: PerfSignature[]; days: number; + /** Platform key, for platform-specific annotations. */ + os: string; /** Link that makes this test the main chart. */ href: string; } - let { test, signatures, days, href }: Props = $props(); + let { test, signatures, days, os, href }: Props = $props(); // One resource per chart, all started at once and paced by the shared // concurrency limiter in http.ts -- the same arrangement as Speedometer's @@ -33,7 +35,7 @@ hidden: new Set(), replicates: false, markers: [], - annotations: annotationsWithinDays(annotationsFor(test), days), + annotations: annotationsWithinDays(annotationsFor(test, os), days), reference: null, yLabel: 'Score (higher is better)', beginAtZero: true diff --git a/src/routes/navbench/SubtestCharts.svelte b/src/routes/navbench/SubtestCharts.svelte index 1f186bf..1e96fec 100644 --- a/src/routes/navbench/SubtestCharts.svelte +++ b/src/routes/navbench/SubtestCharts.svelte @@ -7,10 +7,12 @@ interface Props { signatures: PerfSignature[]; days: number; + /** Platform key, for platform-specific annotations. */ + os: string; href(test: string): string; } - let { signatures, days, href }: Props = $props(); + let { signatures, days, os, href }: Props = $props(); // The per-site tests only. The overall score is already the chart at the top // of the page, so repeating it here would be a duplicate rather than a @@ -25,7 +27,7 @@ {/if} {#each tests as test (test)} - + {/each}