Skip to content

feat(benchmarks): add the svg-dashboard SVG stress suite - #635

Merged
trueadm merged 6 commits into
mainfrom
feat/svg-dashboard-bench
Aug 8, 2026
Merged

trueadm merged 6 commits into
mainfrom
feat/svg-dashboard-bench

Conversation

@trueadm

@trueadm trueadm commented Aug 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds benchmarks/svg-dashboard — the first SVG coverage in the bench system: a hand-rolled-SVG observability dashboard (no chart libraries) rendered byte-identically by octane-tsrx, react 19, solid 2.0-beta, and svelte 5 fixtures (ports 5302–5305), registered in the unified runner with 27 curated ratio guards and a recorded local baseline.

The app is Grafana-shaped (~2,400 elements): a 150-node topology with curved edges and foreignObject HTML labels, 8 charts × 5 keyed series with gradient defs and SVG <a> legends, sparklines, a lucide-style createElement icon layer (deliberately on octane's de-opt reconciler), and a portal tooltip overlay (SVG has no z-index — the recharts ZIndexLayer pattern). Twelve timed ops cover path-d/transform churn, the value-identical diff-skip walk, per-commit overhead, setClassAttr churn, keyed reconcile with LIS moves inside <svg>, namespace push/pop, SVG portals, descriptor re-diffing, structural rescale, and style-object/spread updates.

Why

Octane's SVG surface (namespace-flagged templates, attribute-only class writes, foreignObject transitions, createElementNS de-opt path, flag-3 opaque roots, portals into SVG) was covered only by correctness tests. Static SVG structure is nearly free in octane (template clone), so the costs live in updates — exactly what no suite measured.

Changes

  • benchmarks/svg-dashboard/ — 4 fixture apps + harness + README (fairness ledger included). data.js/ops.js are vendored verbatim into every fixture and produce every DOM-bound string, so the frameworks contribute only binding/reconciliation machinery.
  • Harness gates (all fatal, all untimed): md5 identity of the vendored shared modules; a Node-side replay of the same ops module byte-compared against the DOM (every series d, transform, class, icon variant, style value, viewBox, tooltip placement, churn id order); namespace census at mount and after churn (a wrong-namespace path renders nothing and would look faster); keyed survivor identity; a canonical DOM serialization md5 that must match across all four fixtures; and a layout-read ban (getBBox/getBoundingClientRect instrumented). Negative-tested: a one-byte shared-module drift and a sabotaged class binding both fail the run.
  • benchmarks/bench.mjs — svg-dashboard manifest entry; pnpm-workspace.yaml — fixture packages; benchmarks/README.md — suite-table row.
  • benchmarks/baselines/ratios.json — 27 guards with dated notes: cross-framework tripwires (e.g. charts_tick ≤1.3× react, observed 0.95×; icon_swap ≤1.2× react as a de-opt cliff-width tripwire, observed 0.79×–0.81×) plus semantic controls pinning elements_full/svg_elements_full/foreignobject_html_full/defs_full at exactly 1.0 across flavors. benchmarks/baselines/local/svg-dashboard.json recorded at 20 iterations on the rebased head.
  • packages/octane-mcp-server/src/index.js — new suite in BENCHMARK_SUITES (its test pins the list against the runner manifest), with a patch changeset.
  • Also publishes production_calls_tick for octane via a --jitless precise-coverage pass (15,449 calls at introduction; hard ceiling 25k).

Findings at introduction (2026-08-07)

Octane wins mount (0.82× react, 0.49× solid), per-commit overhead (pan_zoom 0.32× react), SVG portals (tooltip_swarm 0.41× react), class churn (0.58× solid), and the icon de-opt flip vs react's normal path (0.81×). Guarded gaps: drag_nodes 1.50× react (per-frame keyed-row walk re-evaluates de-opt icon holes), style_spread_pulse 1.95× react (setSpread + per-property style diff), tick_sparse ~1.85× solid (prev-guard walk vs fine-grained skip). One octane structural lesson is baked into the fixture and README: colocating the ui domain in a Viewport leaf with reference-stable descriptor props took pan_zoom from 17.6 ms to 0.3 ms — a follow-up chip exists to investigate whether autoMemo should bail stable-prop subtrees automatically.

Reviewer notes (fairness ledger, full detail in the suite README): the icon layer maps to each ecosystem's real lucide mechanism; solid's portal and SVG-<a> are hand-rolled because the 2.0 beta cannot express either declaratively (upstream <Portal> crash; compile-time namespace resolution); class strings are pre-joined and style values pass as strings so no flavor's coercion heuristics run; <use> uses SVG2 href (still a sanitizer URL sink).

Validation

  • pnpm format:check
  • pnpm typecheck
  • pnpm test — full run was green except octane-mcp-server's pinned suite list (16,866/16,867), which this PR updates; that project re-run passes 15/15. Not re-run in full after the one-line list fix or the rebase.
  • targeted tests: node benchmarks/bench.mjs svg-dashboard full runs ×3 (one re-recorded after rebasing onto perf: reuse bounded keyed-reorder scratch storage #630–perf: cache stable renderable regions and prune sync warming #634), --quick --ratios, --compare --ratios ×2 — 0 regressions, 27/27 guards pass, DOM-parity hashes identical across all four fixtures; negative tests confirmed the md5 and byte-exact gates fire on sabotage; pnpm sync clean.

Risk / follow-ups

  • Benchmark-only plus one MCP suite-list entry — no runtime/compiler changes.
  • Solid 2.0-beta API drift is the most likely future breakage (Repeat regressions, createRenderEffect two-function form); the suite pins the store+reconcile shape that dbmon already uses.
  • Timing guards carry ~1.5× headroom; local absolute baselines are machine-specific by design (CI enforces --ratios only).
  • Follow-up (chip spawned): investigate autoMemo bail on reference-stable component props, using this suite's drag_nodes/style_spread_pulse guards as the improvement oracle.

Provenance

  • An agent produced this diff (agent-authored)

Note

Low Risk
Benchmark-only changes plus an MCP suite list entry; no runtime or compiler code paths are modified.

Overview
Introduces svg-dashboard, the first SVG-focused benchmark: a hand-rolled observability dashboard (~2,400 elements) implemented for octane-tsrx, react, solid, and svelte, with shared data.js / ops.js driving every DOM string so timing isolates reconciliation and binding.

The Playwright harness (run.mjs) runs fatal correctness gates before any samples: shared-module MD5 checks, Node replay vs live DOM, namespace census, keyed survivor identity, cross-flavor canonical DOM parity, and a layout-read ban. Twelve timed ops stress path d churn, sparse diff walks, drag/pan, keyed topology churn, foreignObject labels, SVG portal tooltips, runtime icon swaps, and style/spread pulses.

Wiring: benchmarks/bench.mjs manifest (ports 5302–5305), suite README, 27 ratio guards in baselines/ratios.json, local baseline JSON, MCP BENCHMARK_SUITES entry, and a patch changeset for @octanejs/mcp-server.

Reviewed by Cursor Bugbot for commit b6bdbce. Bugbot is set up for automated code reviews on this repo. Configure here.

A hand-rolled-SVG observability dashboard (no chart libraries) rendered
byte-identically by octane-tsrx, react, solid, and svelte fixtures
(~2,400 elements: 150-node topology with foreignObject labels, 8x5-series
charts with gradient defs and SVG <a> legends, sparklines, a createElement
icon layer on octane's de-opt path, and a portal tooltip overlay).

Twelve timed ops cover path-d/transform churn, the value-identical
diff-skip walk, per-commit overhead, SVG class-attribute churn, keyed
reconcile inside <svg> with LIS moves, namespace push/pop, SVG portals,
descriptor re-diffing, structural rescale, and style/spread updates.

The harness md5-gates the vendored shared modules, replays the same ops
module in Node and byte-compares the DOM, censuses namespaces (a
wrong-namespace path renders nothing and would look faster), verifies
keyed survivor identity, cross-hashes a canonical DOM serialization
across all four fixtures, and bans layout reads during ops. 27 ratio
guards recorded with dated notes; local baseline at 20 iterations;
suite exposed through @octanejs/mcp-server (changeset included).

Co-Authored-By: Claude Fable 5 <[email protected]>
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent feat PR: new feature or capability labels Aug 8, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review August 8, 2026 01:01
trueadm and others added 2 commits August 8, 2026 02:16
Regenerate lockfile-derived parity/evals records and re-append the
svg-dashboard ratio guards after the js-framework DOM-metric removal
(#636) and bundle side-effect guards (#637) rewrote ratios.json.

Co-Authored-By: Claude Fable 5 <[email protected]>
Regenerate lockfile-derived parity/evals records after the React
Compiler benchmark rollout (#639) and bundle-size reductions (#638).

Co-Authored-By: Claude Fable 5 <[email protected]>
…ture

Follows the #639 rollout: every primary React benchmark builds through
the shared benchmarks/react-compiler.mjs preset. The fixture's rows were
already hand-memo'd, so the compiler shifts little; drag_nodes moved
1.50x -> 1.89x observed (react's per-frame keyed updates got faster), so
its tripwire ceiling is re-curated to 2.5 with a dated note. All 27
ratio guards pass; DOM parity across the four fixtures is unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
@trueadm

trueadm commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator Author

Merged main twice to resolve conflicts (post-#636/#637 and post-#638/#639):

  • ratios.json: re-appended the 27 svg-dashboard guards on top of upstream's rewrite; the three pnpm-sync-generated files were regenerated against the merged lockfile.
  • Adopted the feat: enable React Compiler across framework benchmarks #639 React Compiler convention in the react fixture (reactCompiler() from the shared benchmarks/react-compiler.mjs). Its rows were already hand-memo'd, so most ratios barely moved (charts_tick 1.02x, icon_swap 0.79x); drag_nodes tightened 1.50x → 1.89x, so its tripwire ceiling was re-curated to 2.5 with a dated note.
  • Local baseline re-recorded on the merged head (an earlier record attempt was discarded — a concurrent full-suite test run in another worktree was loading the machine; the committed baseline compares clean: 85 ops, 0 regressions, twice).
  • Re-validated on the pushed head: svg-dashboard --record/--compare/--quick --ratios all green (27/27 guards), DOM-parity hashes still identical across the four fixtures, octane-mcp-server project 37/37, scoped format checks clean.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Eager state init skews octane timings
    • Changed useState(initialTopo()), useState(initialCharts()), and useState(initialUi()) to lazy initializer form useState(initialTopo), useState(initialCharts), useState(initialUi) to match the React fixture and avoid redundant allocations on every render.

Create PR

Or push these changes by commenting:

@cursor push 30828c5b51
Preview (30828c5b51)
diff --git a/benchmarks/svg-dashboard/octane-tsrx/src/App.tsrx b/benchmarks/svg-dashboard/octane-tsrx/src/App.tsrx
--- a/benchmarks/svg-dashboard/octane-tsrx/src/App.tsrx
+++ b/benchmarks/svg-dashboard/octane-tsrx/src/App.tsrx
@@ -228,7 +228,7 @@
 // subtrees arrive as descriptor props built by App, which only re-renders on
 // topo/charts commits — so ui commits touch just these few bindings.
 function Viewport({ defs, layers }: { defs: OctaneNode; layers: OctaneNode }) @{
-	const [ui, setUi] = useState(initialUi());
+	const [ui, setUi] = useState(initialUi);
 	const overlayRef = useRef<Element | null>(null);
 	bindSetters({ setUi });
 
@@ -246,8 +246,8 @@
 }
 
 export default function App() @{
-	const [topo, setTopo] = useState(initialTopo());
-	const [charts, setCharts] = useState(initialCharts());
+	const [topo, setTopo] = useState(initialTopo);
+	const [charts, setCharts] = useState(initialCharts);
 	bindSetters({ setTopo, setCharts });
 
 	<Viewport

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 2c1d892. Configure here.

trueadm and others added 2 commits August 8, 2026 02:48
…hboard fixture

Bugbot: the eager useState(initialTopo()) form re-evaluates its argument
on every re-render, re-slicing the snapshot row arrays inside timed
topo/charts/ui commits — overhead the react fixture's lazy form never
pays. Octane's useState accepts the same React-parity lazy initializer;
use it in App and Viewport. Baseline re-recorded; 27/27 ratio guards and
the compare gate pass (85 ops, 0 regressions).

Co-Authored-By: Claude Fable 5 <[email protected]>
Regenerate the evals manifest and lockfile-derived records after the
Version Packages release (#601).

Co-Authored-By: Claude Fable 5 <[email protected]>
@trueadm
trueadm merged commit 7a6fba3 into main Aug 8, 2026
34 checks passed
@trueadm
trueadm deleted the feat/svg-dashboard-bench branch August 8, 2026 09:12
trueadm added a commit that referenced this pull request Oct 3, 2026
… samples

Two quick CI runs of the paired, ~20 ms harness and same-runner A/B runs
against the commits that set each guard decided every waiver:

- Passing, waiver removed: activity reports, ssr-workerd
  cold_spawn_to_first_byte, svg-dashboard pan_zoom, memo-wall
  parent_rerender_equal_A and octane-jsx mount, spa-navigation
  nav_teardown and nav_mount (no Octane change since #674 on one runner).
- Rebaselined: svg-dashboard icon_swap 1.2 -> 1.6, because #983's esbuild
  minification made React 15% faster while Octane stayed flat.
- Confirmed Octane regressions, waiver kept and pointed at the fix:
  js-framework-reorder rotateb (1.41x per click since #639), memo-wall
  one_change_B (1.5x) and ctx_through_wall_B (1.44x), and svg-dashboard
  tooltip_swarm (1.31x since #635).
- The rotateb note claimed React moves every survivor; it moves one. A new
  rotatef guard covers the LIS-vs-lastPlacedIndex differentiator (0.043x).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 3, 2026
…nd re-judge them (#1646)

* ci(bench): triage the weekly ratio-guard breaches so new ones show

The weekly Bench job (`bench.mjs --quick --ratios`) was red with 81 ratio
breaches, 4 suites that wrote no numbers and 4 harness gate failures, so a new
breach was invisible. Every item is now a fix or a rebaseline.

- Harness drift, fixed. Each harness had stopped producing numbers when runtime
  source it anchors on changed:
  - ssr-final-replay: a second suspended loop since 2026-09-29.
  - root-transactions/contracts: staged-DOM text and attribute journaling since
    2026-09-15.
  - signal-dom-bindings: a second native style Block allocation site since
    2026-09-23.
  - codegen-size: the server runtime's lazy streamed-signals chunk since
    2026-09-16.
  - recursive-context: counted a pure-call annotation and trailing newlines as
    output growth.
- Rebaselined, with numbers in each note: five cross-framework bundle-size
  ratios and the workerd script-size ratio. The absolute app and server-render
  budgets are now the ratchet. Lynx's no-worklet byte caps from 2026-08-17 are
  reset to measured + 32, with the background program pinned exactly.
- Fix pending, with dated waivers that expire 2026-10-24, each with an owner
  task:
  - three exact counters the revived harnesses exposed (one extra closure per
    ssrTry, 128 live text reads per 128 unchanged compiled updates, compiled
    output at 1.295x its source);
  - Lynx create ratios and the re-entrant transport gate;
  - superlinear hydrate boundary preparation;
  - Octane Three versus R3F size and frame dispatch;
  - two timing regressions near the timer floor;
  - ten quick-mode timing guards whose samples are noise-bound;
  - the scoped descriptor shape change.
- bench.mjs supports a guard `waiver` ({ reason, expires }). A waived breach
  prints and does not fail, and fails again once the date passes.
  HARNESS_FAILURE_ALLOWLIST now also covers a suite whose harness writes no
  numbers.

The budget breaches (57) clear when the budget reset lands.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(benchmarks): pair and lengthen the timing samples behind waived ratio guards

Twelve timing guards breached in weekly quick runs without a verdict. Their
samples sat near Chromium's 100 µs clock or under two-sample noise, and each
target ran its whole block minutes after the other side of its guard.

- benchmarks/lib/paired.mjs: rotating per-round visit order and a ~20 ms
  sample calibration shared by the harnesses below.
- js-framework-reorder, memo-wall, svg-dashboard, spa-navigation: every
  target's page stays open in one browser and each sample round visits all
  targets; short ops repeat until a sample takes about 20 ms (clicks,
  hook invocations, op batches, and summed navigation legs).
- activity caught-reveal: a sample reveals several independent hidden roots
  in one window, with the small case revealing eight times as many roots so
  both cases do equal work; the cases alternate per round.
- ssr-workerd: an untimed priming spawn per target, then paired cold-spawn
  rounds; quick mode runs six rounds instead of two.
- bench.yml: a `suites` dispatch input to run selected suites.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(benchmarks): collect garbage before every timed spa-navigation leg

The untimed return leg mounts a whole route, and its collection landed
inside the next timed teardown: nav_teardown samples ran at 17-45% rme.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(benchmarks): re-judge the twelve waived timing guards with paired samples

Two quick CI runs of the paired, ~20 ms harness and same-runner A/B runs
against the commits that set each guard decided every waiver:

- Passing, waiver removed: activity reports, ssr-workerd
  cold_spawn_to_first_byte, svg-dashboard pan_zoom, memo-wall
  parent_rerender_equal_A and octane-jsx mount, spa-navigation
  nav_teardown and nav_mount (no Octane change since #674 on one runner).
- Rebaselined: svg-dashboard icon_swap 1.2 -> 1.6, because #983's esbuild
  minification made React 15% faster while Octane stayed flat.
- Confirmed Octane regressions, waiver kept and pointed at the fix:
  js-framework-reorder rotateb (1.41x per click since #639), memo-wall
  one_change_B (1.5x) and ctx_through_wall_B (1.44x), and svg-dashboard
  tooltip_swarm (1.31x since #635).
- The rotateb note claimed React moves every survivor; it moves one. A new
  rotatef guard covers the LIS-vs-lastPlacedIndex differentiator (0.043x).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(benchmarks): rebaseline spa-navigation nav_mount to its CI baseline

The 1.2 ceiling came from a local 0.94x reading. On CI runners #674 itself
measures 1.15x and head 1.09-1.16x, so the ceiling left 3% of quick-mode
headroom; 1.35 keeps a margin while still catching per-node mount growth.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): drop the three weekly waivers that now have fix PRs

The waived guards now have owner PRs: ssr-final-replay try_closures (#1644),
root-transactions equal_reads (#1643) and codegen-size gzip compiled/source
(#1645). #1645 rebaselines the same codegen-size entry, so this branch no
longer edits it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): leave lynx-render to its owner fix

The lynx-render transport gate failure and the create_1k/create_10k ratio
breaches both trace to #885's JSON-encoded transport and now have an owner
fix. Its branch re-notes those two guards, so this branch drops their waivers
and the suite's allowlist entry instead of editing the same entries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): keep harness failures unwaivable and leave descriptor shapes to their owner

Waiving a suite that throws before it writes numbers would hide any crash in
that suite, not only the known shape change, and skip all of its guards. The
scoped-descriptor-shapes defect has an owner fix in progress. That fix re-pins
the harness's expected keys, so narrowing the waiver here would edit the same
assertion. HARNESS_FAILURE_ALLOWLIST is empty again, and a thrown suite failure
always fails the job. Dated waivers remain only on individual ratio guards.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): leave the Three guards to their owner fixes

three-renderer frame_1k_subscribers and the two three-bundle-size ratios have
owner PRs (#1651, #1652) that re-note and ratchet those entries, so this branch
drops their waivers instead of editing the same entries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(benchmarks): point the four kept timing waivers at their attributed fixes

rotateb and ctx_through_wall_B clear with #1655 and #1656; one_change_B's
per-row remainder and tooltip_swarm's scoped-descriptor accessor reads each
have their own fix task.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(benchmarks): point parent_rerender_equal_A's note at its per-commit journal fix

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent feat PR: new feature or capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant