Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/lib/navbench/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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([]);
});
});
20 changes: 17 additions & 3 deletions src/lib/navbench/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
Expand All @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion src/routes/navbench/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
hidden: new Set<string>(),
replicates: false,
markers: [],
annotations: annotationsWithinDays(annotationsFor(selectedTest), range),
annotations: annotationsWithinDays(annotationsFor(selectedTest, os), range),
reference: selection,
yLabel: 'Score (higher is better)',
beginAtZero: true
Expand Down Expand Up @@ -303,6 +303,7 @@
<SubtestCharts
signatures={signatures.value ?? []}
days={view.range}
{os}
href={(test) => href(withVideoClosed({ test }))}
/>
{/if}
Expand Down
6 changes: 4 additions & 2 deletions src/routes/navbench/SubtestChart.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,7 +35,7 @@
hidden: new Set<string>(),
replicates: false,
markers: [],
annotations: annotationsWithinDays(annotationsFor(test), days),
annotations: annotationsWithinDays(annotationsFor(test, os), days),
reference: null,
yLabel: 'Score (higher is better)',
beginAtZero: true
Expand Down
6 changes: 4 additions & 2 deletions src/routes/navbench/SubtestCharts.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,7 +27,7 @@
{/if}

{#each tests as test (test)}
<SubtestChart {test} {signatures} {days} href={href(test)} />
<SubtestChart {test} {signatures} {days} {os} href={href(test)} />
{/each}
</div>

Expand Down