From cfa684c0ff680815123b846cdbf1dc192f71cc6b Mon Sep 17 00:00:00 2001 From: Will Manning Date: Sat, 21 Nov 2026 18:16:13 -0500 Subject: [PATCH 1/3] Dot the homepage figures that trail far behind each row's best MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The results table now calls out a figure 10 times or more behind its row's best: the figure and a dotted underline are in warn-ink, and the foot says "Dotted: 10× or more behind the best". A rule picks the cells, not a hand-kept list. Today it flags Lance on ClickBench and TPC-H, and Parquet on random access. On phones the other systems' columns hide, so the key hides too unless Vortex's own column has a dotted figure. The rule is in the design system (v141): results.js gives each cell `behind` and `far`, and the stylesheet adds `.is-far`. This copies both. Signed-off-by: Will Manning --- src/components/results-table/index.tsx | 25 ++++++++++------ src/styles/vortex.css | 7 ++++- src/vendor/vortex-design/SHA256SUMS | 4 +-- src/vendor/vortex-design/results.d.ts | 12 +++++++- src/vendor/vortex-design/results.js | 40 +++++++++++++++++++------- tests/unit/results-table.test.tsx | 19 ++++++++++++ 6 files changed, 84 insertions(+), 23 deletions(-) diff --git a/src/components/results-table/index.tsx b/src/components/results-table/index.tsx index 573df868..2ca4777d 100644 --- a/src/components/results-table/index.tsx +++ b/src/components/results-table/index.tsx @@ -1,7 +1,11 @@ import { OpenInNewIcon } from "@/components/icons"; import { benchHref } from "@/lib/bench-link"; import { formatReadDate, type Panel } from "@/lib/bench-summary"; -import { resultsRow, resultsSystems } from "@/vendor/vortex-design/results.js"; +import { + FAR_KEY, + resultsRow, + resultsSystems +} from "@/vendor/vortex-design/results.js"; const classes = (...names: (string | false)[]) => names.filter(Boolean).join(" ") || undefined; @@ -9,13 +13,14 @@ const classes = (...names: (string | false)[]) => /** * The design system's results table, drawn in JSX from the system's own * rules (results.js): a row per panel and a column per system, Vortex - * first in Blue, the best figure in each row underlined, and how Vortex does - * against Parquet last. Its markup is the same as the system's - * `renderResults`, and tests/unit/results-table.test.tsx holds it there. A + * first in Blue, the best figure in each row underlined, a figure 10× or more + * behind it dotted, and how Vortex does against Parquet last. Its markup is + * the same as the system's `renderResults`, and + * tests/unit/results-table.test.tsx holds it there. A * row whose figures are not bench's names their source in its head's hover * title and screen-reader text. The page leaves the table out when the * figures cannot be read. The head names bench and the read date on one line, - * and the foot keys the underline. + * and the foot keys the underline, and the dots when a cell has them. */ export function ResultsTable({ panels, @@ -25,6 +30,7 @@ export function ResultsTable({ readAt: Date; }) { const systems = resultsSystems(panels); + const rows = panels.map((panel) => resultsRow(panel, systems)); return (

@@ -58,10 +64,9 @@ export function ResultsTable({ - {panels.map((panel) => { - const row = resultsRow(panel, systems); + {rows.map((row) => { return ( - + {row.name} {row.source && ( @@ -74,6 +79,7 @@ export function ResultsTable({ className={classes( c.ours && "is-ours", c.best && "is-best", + c.far && "is-far", c.state !== "measured" && "is-missing" )} title={`${c.system}: ${c.exact}`} @@ -90,6 +96,9 @@ export function ResultsTable({

Underlined: the best in each row + {rows.some((row) => row.cells.some((c) => c.far)) && ( + {FAR_KEY} + )}

); diff --git a/src/styles/vortex.css b/src/styles/vortex.css index 832b6af9..2f31bc79 100644 --- a/src/styles/vortex.css +++ b/src/styles/vortex.css @@ -1,7 +1,7 @@ /* Vortex design system components (sections: base, brand, chrome, site, blog, tables, focus), copied by tools/site-styles.mjs. Edit the system, then run tools/site-styles.mjs; do not edit here. Made by: node tools/site-styles.mjs --sections base,brand,chrome,site,blog,tables,focus --faces --vx-face --base --reads .. - sha256 bddb79f13fb3cf9a0fd1d27897b97b3bafbd7ffcf29179f01b4015e992e37641 */ + sha256 3c6d214570f9918827fd21414bcbd34f1a7d44942dc2034b91aecd539a3c8df9 */ /* ------------------------------------------------------------------ base */ /* Every component sizes with border-box, so it draws the same under a site's reset or none. */ @@ -614,10 +614,15 @@ html:has(.vx-header) { scroll-padding-top: calc(var(--space-64) + var(--space-8) /* The underline is ink on every column: it names the result, and Blue names Vortex. */ .vx-results-table .is-best { color: var(--ink); font-weight: 600; text-decoration: underline 2px var(--ink); text-underline-offset: 5px; } .vx-results-table .is-best.is-ours { color: var(--accent-ink); } +/* Far behind the best: the best's underline, dotted, in warn-ink. The dots carry it without the colour; Vortex's figure stays Blue. */ +.vx-results-table .is-far { color: var(--warn-ink); text-decoration: underline dotted 2px var(--warn-ink); text-underline-offset: 5px; } +.vx-results-table .is-far.is-ours { color: var(--accent-ink); } .vx-results-table .is-verdict { padding-left: var(--space-24); color: var(--ink); } @media (max-width: 760px) { .vx-results { padding: var(--space-16); } .vx-results-table :is(th, td):not(:first-child, .is-ours, .is-verdict) { display: none; } + /* The other systems' columns are gone, so the dots' key goes too, unless Vortex's own column has a dotted figure. */ + .vx-results:not(:has(.is-far.is-ours)) .vx-results-key-far { display: none; } } /* The narrowest phones, 320px: the three columns fit inside the frame with 12px of padding, 12px between them, and headings that wrap. */ @media (max-width: 400px) { diff --git a/src/vendor/vortex-design/SHA256SUMS b/src/vendor/vortex-design/SHA256SUMS index 3c8015e7..116536e4 100644 --- a/src/vendor/vortex-design/SHA256SUMS +++ b/src/vendor/vortex-design/SHA256SUMS @@ -2,8 +2,8 @@ b915c52f8505a5f514cad929e25b4639239bfbfa9d2091fd77369c084e7ecc6d ascii-core.d.t c7462c84b8ef8859ac25902edf8c565dcd161895ff9e0034403e1599ebd9659a ascii-mark.d.ts a40a25417fd2e2821aab505815e4ddf50ac47e0af819117eda7d4fc737b900e4 ascii-core.js 02c4efe2952106703240201678629e831e99f1e6429346c2f837ef26a8e00716 ascii-mark.js -47de8b1d4db8c2d3cbeb55328b5e456883a8eddb23d59cc220778997d9e5e47c results.d.ts -9b9e3c7bcc4f90414d6dcf749d0a14964aec40bda6b2274db2fe88cd12a8bf61 results.js +ed7e163f29eea3bdd548899dae2ca2beb14a6c59d74efd5b67ec1c05257e3150 results.d.ts +421b4acf0e103863fee8a46d5447c22260c6b0540f4418f22d504fdb8cb9d25b results.js b59c1b277849e9c6adcd1e84468fea3b59945be1b1d9fe6a2f386bc0882b7fc2 callout.d.ts dacdc197af6ae4fe546907d9578e36f32343d9ff4112c641a00428c6c28fed2f callout.js 1f540989def6dfe2f98fcd537de2ce3cfed2baf07f458287ad15ab53462a165d code-block.d.ts diff --git a/src/vendor/vortex-design/results.d.ts b/src/vendor/vortex-design/results.d.ts index 4f93eac8..73689171 100644 --- a/src/vendor/vortex-design/results.d.ts +++ b/src/vendor/vortex-design/results.d.ts @@ -121,14 +121,24 @@ export type ResultsCell = { system: string; /** The value a bar prints ("42.25 ms", "5.12×"), "Not measured", "N/A", or "—" for a system the panel does not show. */ label: string; - /** The value with its full unit, for the cell's title: as `PanelRow.exact`, or "not run in this benchmark". */ + /** The value with its full unit, for the cell's title: as `PanelRow.exact`, with how far behind the best when `far` ("575.75 ms, 14× behind the best"), or "not run in this benchmark". */ exact: string; state: PanelRow["state"] | "not-run"; ours: boolean; /** Whether the cell holds the row's best measured score. Every cell that ties for it is best. */ best: boolean; + /** How many times worse than the row's best the score is: 1 for the best, null with no score. */ + behind: number | null; + /** Whether the score is `FAR_BEHIND` times or more behind the best. `exact` then says how far. */ + far: boolean; }; +/** How many times behind its row's best a figure must be to be `far`: 10. */ +export const FAR_BEHIND: number; + +/** The foot's key for the far mark: "Dotted: 10× or more behind the best". */ +export const FAR_KEY: string; + export type ResultsRow = { name: string; cells: ResultsCell[]; diff --git a/src/vendor/vortex-design/results.js b/src/vendor/vortex-design/results.js index f3157217..fa409fa3 100644 --- a/src/vendor/vortex-design/results.js +++ b/src/vendor/vortex-design/results.js @@ -209,11 +209,23 @@ export function resultsSystems(panels) { return [...seen.values()]; } +/** + * How many times behind its row's best a figure must be for the results table to call it out + * (`far`): an order of magnitude, a gap no reader should miss. + */ +export const FAR_BEHIND = 10; + +/** The foot's key for the far mark, which `renderResults` prints only when a cell is far behind. */ +export const FAR_KEY = `Dotted: ${FAR_BEHIND}× or more behind the best`; + /** * One panel as a row of the results table: {name, cells, verdict}. `name` is the panel's `short` * name, or its title. There is a cell per name in `systems`, with the label and exact value a bar * shows (`panelRows`); a system the panel does not show was not run, and reads "—". `best` marks - * the measured cells with the panel's best score, every one of them when they tie. + * the measured cells with the panel's best score, every one of them when they tie. `behind` is how + * many times worse than the best a measured cell is (1 for the best, null for a cell with no + * score), and `far` marks a cell `FAR_BEHIND` times or more behind, whose `exact` then says so + * ("575.75 ms, 14× behind the best"). */ export function resultsRow(panel, systems) { const { title, short, unit, kind, better, rows } = panel; @@ -221,17 +233,22 @@ export function resultsRow(panel, systems) { const top = shown[0]?.state === "measured" ? shown[0].score : null; const cells = systems.map((system) => { const r = shown.find((x) => String(x.system).toLowerCase() === String(system).toLowerCase()); - if (!r) return { system, label: "—", exact: "not run in this benchmark", state: "not-run", ours: isOurs(system), best: false }; - return { system, label: r.label, exact: r.exact, state: r.state, ours: r.ours, best: top !== null && r.state === "measured" && r.score === top }; + if (!r) return { system, label: "—", exact: "not run in this benchmark", state: "not-run", ours: isOurs(system), best: false, behind: null, far: false }; + const measured = top !== null && r.state === "measured"; + const behind = measured ? (better === "higher" ? top / r.score : r.score / top) : null; + const far = behind !== null && behind >= FAR_BEHIND; + const exact = far ? `${r.exact}, ${formatFactor(behind)} behind the best` : r.exact; + return { system, label: r.label, exact, state: r.state, ours: r.ours, best: measured && r.score === top, behind, far }; }); return { name: short ?? title, cells, verdict: panelVerdict(kind, versusParquet(rows, better)), source: panel.source ?? null }; } /** * The results table: one row per panel and a column per system, Vortex first in Blue, the best - * figure in each row underlined, and the verdict against Parquet last. The head names the source - * and the date the figures were read (`read`, "2 Nov 2026") on one line; the foot keys the - * underline. `icon` is the markup of the open_in_new icon that ends the + * figure in each row underlined, a figure `FAR_BEHIND` times or more behind it dotted, and the + * verdict against Parquet last. The head names the source and the date the figures were read + * (`read`, "2 Nov 2026") on one line; the foot keys the underline, and the dots when a cell has + * them. `icon` is the markup of the open_in_new icon that ends the * source link, as every source line does. */ export function renderResults(panels, { read, icon = "" } = {}) { @@ -240,15 +257,16 @@ export function renderResults(panels, { read, icon = "" } = {}) { const when = read ? `read ${esc(read)}` : ""; const head = `

File format benchmarksbench.vortex.dev${icon}${when}

`; const cols = `Benchmark${systems.map((s) => `${esc(s)}`).join("")}vs Parquet`; - const body = panels - .map((p) => { - const row = resultsRow(p, systems); - const cells = row.cells.map((c) => `${esc(c.label)}`).join(""); + const rows = panels.map((p) => resultsRow(p, systems)); + const body = rows + .map((row) => { + const cells = row.cells.map((c) => `${esc(c.label)}`).join(""); const src = row.source ? ` title="${esc(row.source.note)}"` : ""; const srText = row.source ? `, ${esc(row.source.note)}` : ""; return `${esc(row.name)}${srText}${cells}${esc(row.verdict)}`; }) .join(""); - const foot = `

Underlined: the best in each row

`; + const far = rows.some((row) => row.cells.some((c) => c.far)) ? `${FAR_KEY}` : ""; + const foot = `

Underlined: the best in each row${far}

`; return `
${head}
${cols}${body}
${foot}
`; } diff --git a/tests/unit/results-table.test.tsx b/tests/unit/results-table.test.tsx index 9c91c21c..c7bbcbff 100644 --- a/tests/unit/results-table.test.tsx +++ b/tests/unit/results-table.test.tsx @@ -58,4 +58,23 @@ describe("ResultsTable", () => { for (const row of html.split(' { + assert.ok(PANELS); + const html = renderToStaticMarkup( + + ); + const far = [...html.matchAll(//g)].map( + (m) => m[1] + ); + assert.deepEqual(far, [ + "Lance: 578.63 ms, 14× behind the best", + "Lance: 846.80 ms, 14× behind the best", + "Parquet: 70.61 ms, 97× behind the best" + ]); + assert.match( + html, + /Underlined: the best in each row<\/span>Dotted: 10× or more behind the best<\/span><\/p>/ + ); + }); }); From 6104626c903fb6362d26891e1131e3955a6e7d8a Mon Sep 17 00:00:00 2001 From: Will Manning Date: Sat, 21 Nov 2026 18:30:07 -0500 Subject: [PATCH 2/3] Show phones each benchmark's verdict against Parquet and Lance On phones the homepage benchmarks table showed Vortex's figure beside its verdict against Parquet, which said the same thing twice. Below 760px it now shows the benchmark, how Vortex does against Parquet, and how Vortex does against Lance. The verdict heads read "Vortex vs" and wrap, the key hides (no marked figure shows), and below 340px the table is set in 12px so the three columns fit at 320px. Desktop is unchanged. From the Vortex design system v145: renderResults' `rival` option. Signed-off-by: Will Manning --- src/components/results-table/index.tsx | 18 ++++++++--- src/styles/vortex.css | 23 ++++++++++---- src/vendor/vortex-design/SHA256SUMS | 4 +-- src/vendor/vortex-design/results.d.ts | 15 +++++++-- src/vendor/vortex-design/results.js | 42 ++++++++++++++++++-------- tests/unit/results-table.test.tsx | 17 +++++++++-- 6 files changed, 90 insertions(+), 29 deletions(-) diff --git a/src/components/results-table/index.tsx b/src/components/results-table/index.tsx index 2ca4777d..12bb42ca 100644 --- a/src/components/results-table/index.tsx +++ b/src/components/results-table/index.tsx @@ -7,6 +7,9 @@ import { resultsSystems } from "@/vendor/vortex-design/results.js"; +/** The system a phone compares Vortex with, after Parquet, in place of the figures. */ +const RIVAL = "Lance"; + const classes = (...names: (string | false)[]) => names.filter(Boolean).join(" ") || undefined; @@ -14,7 +17,8 @@ const classes = (...names: (string | false)[]) => * The design system's results table, drawn in JSX from the system's own * rules (results.js): a row per panel and a column per system, Vortex * first in Blue, the best figure in each row underlined, a figure 10× or more - * behind it dotted, and how Vortex does against Parquet last. Its markup is + * behind it dotted, and how Vortex does against Parquet last. A phone shows + * only the verdicts: against Parquet, and against Lance. Its markup is * the same as the system's `renderResults`, and * tests/unit/results-table.test.tsx holds it there. A * row whose figures are not bench's names their source in its head's hover @@ -30,7 +34,9 @@ export function ResultsTable({ readAt: Date; }) { const systems = resultsSystems(panels); - const rows = panels.map((panel) => resultsRow(panel, systems)); + const rows = panels.map((panel) => + resultsRow(panel, systems, { rival: RIVAL }) + ); return (

@@ -59,7 +65,10 @@ export function ResultsTable({ ))} - vs Parquet + Vortex vs Parquet + + + Vortex vs {RIVAL} @@ -88,6 +97,7 @@ export function ResultsTable({ ))} {row.verdict} + {row.rivalVerdict} ); })} @@ -97,7 +107,7 @@ export function ResultsTable({

Underlined: the best in each row {rows.some((row) => row.cells.some((c) => c.far)) && ( - {FAR_KEY} + {FAR_KEY} )}

diff --git a/src/styles/vortex.css b/src/styles/vortex.css index 2f31bc79..166d8557 100644 --- a/src/styles/vortex.css +++ b/src/styles/vortex.css @@ -1,7 +1,7 @@ /* Vortex design system components (sections: base, brand, chrome, site, blog, tables, focus), copied by tools/site-styles.mjs. Edit the system, then run tools/site-styles.mjs; do not edit here. Made by: node tools/site-styles.mjs --sections base,brand,chrome,site,blog,tables,focus --faces --vx-face --base --reads .. - sha256 3c6d214570f9918827fd21414bcbd34f1a7d44942dc2034b91aecd539a3c8df9 */ + sha256 a6f0b79a7f5a1d42b0d3dcb2b5e7bfafca0a8b41eba5d01465c5d5c4cbe5c4ae */ /* ------------------------------------------------------------------ base */ /* Every component sizes with border-box, so it draws the same under a site's reset or none. */ @@ -618,18 +618,29 @@ html:has(.vx-header) { scroll-padding-top: calc(var(--space-64) + var(--space-8) .vx-results-table .is-far { color: var(--warn-ink); text-decoration: underline dotted 2px var(--warn-ink); text-underline-offset: 5px; } .vx-results-table .is-far.is-ours { color: var(--accent-ink); } .vx-results-table .is-verdict { padding-left: var(--space-24); color: var(--ink); } +/* The verdict's head names Vortex only on a phone, where Vortex's column is gone. The rival's verdict shows only there too. */ +.vx-results-subject { display: none; color: var(--accent-ink); } +.vx-results-table .is-rival { display: none; } @media (max-width: 760px) { .vx-results { padding: var(--space-16); } - .vx-results-table :is(th, td):not(:first-child, .is-ours, .is-verdict) { display: none; } - /* The other systems' columns are gone, so the dots' key goes too, unless Vortex's own column has a dotted figure. */ - .vx-results:not(:has(.is-far.is-ours)) .vx-results-key-far { display: none; } -} -/* The narrowest phones, 320px: the three columns fit inside the frame with 12px of padding, 12px between them, and headings that wrap. */ + /* A phone shows each benchmark and its verdicts alone: against Parquet and, with a rival, against it. Vortex's figure would repeat the verdict. With no figure left to mark, the key goes too. The verdict heads wrap ("Vortex vs / Parquet"). */ + .vx-results-table :is(th, td):not(:first-child, .is-verdict) { display: none; } + .vx-results-table .is-rival { display: table-cell; } + .vx-results-table .is-verdict { padding-left: var(--space-16); } + .vx-results-table thead .is-verdict { white-space: normal; } + .vx-results-subject { display: inline; } + .vx-results-foot { display: none; } +} +/* Small phones: 12px of padding, 12px between the columns, and headings that wrap. */ @media (max-width: 400px) { .vx-results { padding: var(--space-12); } .vx-results-table :is(th, td):not(:first-child) { padding-left: var(--space-12); } .vx-results-table th { white-space: normal; } } +/* The narrowest phones, 320px: at 13px the three columns are 10px wider than the frame, so the table is set in 12px. */ +@media (max-width: 340px) { + .vx-results-table { font-size: 12px; } +} .vx-eyebrow { display: inline-flex; align-items: center; gap: var(--space-8); } .vx-eyebrow::before { content: ""; width: 6px; height: 6px; background: var(--ink-muted); flex: none; } diff --git a/src/vendor/vortex-design/SHA256SUMS b/src/vendor/vortex-design/SHA256SUMS index 116536e4..349ec096 100644 --- a/src/vendor/vortex-design/SHA256SUMS +++ b/src/vendor/vortex-design/SHA256SUMS @@ -2,8 +2,8 @@ b915c52f8505a5f514cad929e25b4639239bfbfa9d2091fd77369c084e7ecc6d ascii-core.d.t c7462c84b8ef8859ac25902edf8c565dcd161895ff9e0034403e1599ebd9659a ascii-mark.d.ts a40a25417fd2e2821aab505815e4ddf50ac47e0af819117eda7d4fc737b900e4 ascii-core.js 02c4efe2952106703240201678629e831e99f1e6429346c2f837ef26a8e00716 ascii-mark.js -ed7e163f29eea3bdd548899dae2ca2beb14a6c59d74efd5b67ec1c05257e3150 results.d.ts -421b4acf0e103863fee8a46d5447c22260c6b0540f4418f22d504fdb8cb9d25b results.js +1463ef3d28dbadb73e35ae5743edd7927b724c9d83117dc9758aed6def97bb63 results.d.ts +25d2ecf667cd7cb0ed349d6f2b9fa80801185a27e9e6e74c3834ef335e0117ec results.js b59c1b277849e9c6adcd1e84468fea3b59945be1b1d9fe6a2f386bc0882b7fc2 callout.d.ts dacdc197af6ae4fe546907d9578e36f32343d9ff4112c641a00428c6c28fed2f callout.js 1f540989def6dfe2f98fcd537de2ce3cfed2baf07f458287ad15ab53462a165d code-block.d.ts diff --git a/src/vendor/vortex-design/results.d.ts b/src/vendor/vortex-design/results.d.ts index 73689171..214e6574 100644 --- a/src/vendor/vortex-design/results.d.ts +++ b/src/vendor/vortex-design/results.d.ts @@ -61,7 +61,7 @@ export type Versus = { /** Whether the scores are equal (then `factor` is 1 and `vortexWins` false), or null when either is not measured. */ tie: boolean | null; /** The system that is not measured, Vortex first, or null when both are. */ - missing: "Vortex" | "Parquet" | null; + missing: string | null; }; export function formatScore(score: number, unit: string): string; @@ -82,6 +82,13 @@ export function panelRows( /** The panel's value column: its longest value or "N/A", in ch ("9ch"). */ export function valueWidth(rows: readonly PanelRow[]): string; +/** Vortex against any system the rows name, as `versusParquet`; `missing` is "Vortex" or `name`. */ +export function versus( + rows: readonly BenchRow[], + better: BenchPanel["better"], + name: string +): Versus; + export function versusParquet( rows: readonly BenchRow[], better: BenchPanel["better"] @@ -143,12 +150,14 @@ export type ResultsRow = { name: string; cells: ResultsCell[]; verdict: string; + /** With the `rival` option, how Vortex does against that system, worded as `verdict`: "14× faster", "N/A", or "—" when the panel does not show it. Otherwise null. */ + rivalVerdict: string | null; /** Where the figures come from when they are not bench's, as the row head's hover title and screen-reader text. */ source: PanelSource | null; }; /** One panel as a row of the results table, with a cell per name in `systems`. */ -export function resultsRow(panel: BenchPanel, systems: readonly string[]): ResultsRow; +export function resultsRow(panel: BenchPanel, systems: readonly string[], options?: { rival?: string }): ResultsRow; /** The results table as HTML. `read` is the date the figures were read, "2 Nov 2026", which the head prints after the source link; `icon` is the open_in_new icon's markup, which ends that link. */ -export function renderResults(panels: readonly BenchPanel[], options?: { read?: string; icon?: string }): string; +export function renderResults(panels: readonly BenchPanel[], options?: { read?: string; icon?: string; rival?: string }): string; diff --git a/src/vendor/vortex-design/results.js b/src/vendor/vortex-design/results.js index fa409fa3..6bd34068 100644 --- a/src/vendor/vortex-design/results.js +++ b/src/vendor/vortex-design/results.js @@ -113,11 +113,16 @@ export function valueWidth(rows) { * that is, Vortex first. Otherwise `missing` is null. */ export function versusParquet(rows, better) { + return versus(rows, better, "Parquet"); +} + +/** Vortex against any system the rows name (`name`, matched whatever the case), as `versusParquet`; `missing` is "Vortex" or `name`. */ +export function versus(rows, better, name) { const v = find(rows, "vortex"); - const p = find(rows, "parquet"); - if (!isMeasured(v) || !isMeasured(p)) return { factor: null, vortexWins: null, tie: null, missing: isMeasured(v) ? "Parquet" : "Vortex" }; - const vortexWins = better === "higher" ? v.score > p.score : v.score < p.score; - return { factor: Math.max(v.score / p.score, p.score / v.score), vortexWins, tie: v.score === p.score, missing: null }; + const o = find(rows, String(name).toLowerCase()); + if (!isMeasured(v) || !isMeasured(o)) return { factor: null, vortexWins: null, tie: null, missing: isMeasured(v) ? name : "Vortex" }; + const vortexWins = better === "higher" ? v.score > o.score : v.score < o.score; + return { factor: Math.max(v.score / o.score, o.score / v.score), vortexWins, tie: v.score === o.score, missing: null }; } /** A factor in ×: 32× from 10 up, 5.1× from 1.1 up, 1.07× below, — for none. The verdict uses it from 2× up (`panelFactor`). */ @@ -209,6 +214,18 @@ export function resultsSystems(panels) { return [...seen.values()]; } +/** + * How Vortex does against `rival` in one panel, worded as the verdict against Parquet is ("14× faster", + * "48% smaller"): "N/A" when the rival cannot run the benchmark, "Lance not measured" when it has no + * result, and "—" when the panel does not show it. + */ +function rivalVerdict(panel, rival) { + const r = find(pickSystems(panel.rows, panel.systems), String(rival).toLowerCase()); + if (!r) return "—"; + if (r.unavailable) return "N/A"; + return panelVerdict(panel.kind, versus(panel.rows, panel.better, rival)); +} + /** * How many times behind its row's best a figure must be for the results table to call it out * (`far`): an order of magnitude, a gap no reader should miss. @@ -227,7 +244,7 @@ export const FAR_KEY = `Dotted: ${FAR_BEHIND}× or more behind the best`; * score), and `far` marks a cell `FAR_BEHIND` times or more behind, whose `exact` then says so * ("575.75 ms, 14× behind the best"). */ -export function resultsRow(panel, systems) { +export function resultsRow(panel, systems, { rival } = {}) { const { title, short, unit, kind, better, rows } = panel; const shown = panelRows(pickSystems(rows, panel.systems), better, unit); const top = shown[0]?.state === "measured" ? shown[0].score : null; @@ -240,7 +257,7 @@ export function resultsRow(panel, systems) { const exact = far ? `${r.exact}, ${formatFactor(behind)} behind the best` : r.exact; return { system, label: r.label, exact, state: r.state, ours: r.ours, best: measured && r.score === top, behind, far }; }); - return { name: short ?? title, cells, verdict: panelVerdict(kind, versusParquet(rows, better)), source: panel.source ?? null }; + return { name: short ?? title, cells, verdict: panelVerdict(kind, versusParquet(rows, better)), rivalVerdict: rival ? rivalVerdict(panel, rival) : null, source: panel.source ?? null }; } /** @@ -248,25 +265,26 @@ export function resultsRow(panel, systems) { * figure in each row underlined, a figure `FAR_BEHIND` times or more behind it dotted, and the * verdict against Parquet last. The head names the source and the date the figures were read * (`read`, "2 Nov 2026") on one line; the foot keys the underline, and the dots when a cell has - * them. `icon` is the markup of the open_in_new icon that ends the + * them. With `rival` ("Lance"), a phone shows a second verdict, against that system, in place of the + * figures (`is-rival`, hidden on wider screens). `icon` is the markup of the open_in_new icon that ends the * source link, as every source line does. */ -export function renderResults(panels, { read, icon = "" } = {}) { +export function renderResults(panels, { read, icon = "", rival } = {}) { const systems = resultsSystems(panels); const cls = (...c) => (c.filter(Boolean).length ? ` class="${c.filter(Boolean).join(" ")}"` : ""); const when = read ? `read ${esc(read)}` : ""; const head = `

File format benchmarksbench.vortex.dev${icon}${when}

`; - const cols = `Benchmark${systems.map((s) => `${esc(s)}`).join("")}vs Parquet`; - const rows = panels.map((p) => resultsRow(p, systems)); + const cols = `Benchmark${systems.map((s) => `${esc(s)}`).join("")}Vortex vs Parquet${rival ? `Vortex vs ${esc(rival)}` : ""}`; + const rows = panels.map((p) => resultsRow(p, systems, { rival })); const body = rows .map((row) => { const cells = row.cells.map((c) => `${esc(c.label)}`).join(""); const src = row.source ? ` title="${esc(row.source.note)}"` : ""; const srText = row.source ? `, ${esc(row.source.note)}` : ""; - return `${esc(row.name)}${srText}${cells}${esc(row.verdict)}`; + return `${esc(row.name)}${srText}${cells}${esc(row.verdict)}${rival ? `${esc(row.rivalVerdict)}` : ""}`; }) .join(""); - const far = rows.some((row) => row.cells.some((c) => c.far)) ? `${FAR_KEY}` : ""; + const far = rows.some((row) => row.cells.some((c) => c.far)) ? `${FAR_KEY}` : ""; const foot = `

Underlined: the best in each row${far}

`; return `
${head}
${cols}${body}
${foot}
`; } diff --git a/tests/unit/results-table.test.tsx b/tests/unit/results-table.test.tsx index c7bbcbff..0433180b 100644 --- a/tests/unit/results-table.test.tsx +++ b/tests/unit/results-table.test.tsx @@ -31,7 +31,8 @@ describe("ResultsTable", () => { // and its own /bench elsewhere (bench-link.ts), the one difference. const system = renderResults(PANELS, { read: formatReadDate(READ), - icon: renderToStaticMarkup() + icon: renderToStaticMarkup(), + rival: "Lance" }).replace('href="https://bench.vortex.dev"', `href="${benchHref()}"`); assert.equal(html, system); }); @@ -74,7 +75,19 @@ describe("ResultsTable", () => { ]); assert.match( html, - /Underlined: the best in each row<\/span>Dotted: 10× or more behind the best<\/span><\/p>/ + /Underlined: the best in each row<\/span>Dotted: 10× or more behind the best<\/span><\/p>/ ); }); + + it("adds the verdict against Lance for phones", () => { + assert.ok(PANELS); + const html = renderToStaticMarkup( + + ); + assert.match( + html, + /Vortex <\/span>vs Lance<\/th>/ + ); + assert.equal(html.match(//g)?.length, 7); + }); }); From 2e4ec28d719c0a149766e9187391a809eb156b6f Mon Sep 17 00:00:00 2001 From: Will Manning Date: Sat, 21 Nov 2026 18:38:50 -0500 Subject: [PATCH 3/3] Check the phone results table's three columns in the smoke tests The phone layout now shows Benchmark, Vortex vs Parquet, and Vortex vs Lance. The test also checks that the table fits its frame without a sideways scroll at 320px and 375px. Signed-off-by: Will Manning --- tests/smoke.spec.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/smoke.spec.ts b/tests/smoke.spec.ts index e8827404..724858de 100644 --- a/tests/smoke.spec.ts +++ b/tests/smoke.spec.ts @@ -899,7 +899,7 @@ test.describe("results table on phones", () => { test.describe(`at ${width}px`, () => { test.use({ viewport: { width, height: 812 } }); - test("shows Vortex and the verdict, inside the screen", async ({ + test("shows the verdicts against Parquet and Lance, inside the screen", async ({ page }) => { await page.goto("/"); @@ -910,12 +910,22 @@ test.describe("results table on phones", () => { ).toHaveText("File format benchmarks"); const m = await table.evaluate((el) => ({ right: el.getBoundingClientRect().right, + // The table fits its frame, so the wrap does not scroll sideways. + overflow: (() => { + const wrap = el.querySelector(".vx-results-wrap"); + return wrap ? wrap.scrollWidth - wrap.clientWidth : -1; + })(), heads: [...el.querySelectorAll("thead th")] .filter((th) => getComputedStyle(th).display !== "none") .map((th) => th.textContent) })); - expect(m.heads).toEqual(["Benchmark", "Vortex", "vs Parquet"]); + expect(m.heads).toEqual([ + "Benchmark", + "Vortex vs Parquet", + "Vortex vs Lance" + ]); expect(m.right).toBeLessThanOrEqual(width); + expect(m.overflow).toBe(0); }); }); }