Repository navigation
fix(benchmarks): pair the timing samples behind waived ratio guards and re-judge them - #1646
Merged
Merged
Conversation
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]>
…atio 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]>
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]>
… 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]>
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]>
trueadm
marked this pull request as ready for review
October 3, 2026 08:08
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]>
…/bench-paired-timing
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]>
…/bench-paired-timing
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Non-empty harness failure allowlist restored
- Restored HARNESS_FAILURE_ALLOWLIST to an empty object and removed the catch-block waiver logic that let a suite crash silently pass CI, matching the #1592 requirement.
Or push these changes by commenting:
@cursor push ad9a0cf49b
Preview (ad9a0cf49b)
diff --git a/benchmarks/bench.mjs b/benchmarks/bench.mjs
--- a/benchmarks/bench.mjs
+++ b/benchmarks/bench.mjs
@@ -59,16 +59,7 @@
// waiver here. A waiver needs a reason (ideally an issue link) and an expiry
// date — when it lapses the failure becomes fatal again and must be re-triaged,
// so a known-bug exemption cannot quietly become permanent.
-//
-// A waiver also covers a suite whose harness fails before it writes numbers,
-// since that hides every guard in the suite until the failure is fixed.
-const HARNESS_FAILURE_ALLOWLIST = {
- 'scoped-descriptor-shapes': {
- reason:
- 'Since #1069 (2026-09-16) every scoped element descriptor defines an enumerable __octaneInvocationSite accessor that ordinary descriptors carry only when set, so the two no longer share one shape. Decide the descriptor contract, then re-pin the expected keys.',
- expires: '2026-10-24',
- },
-};
+const HARNESS_FAILURE_ALLOWLIST = {};
const todayISO = () => new Date().toISOString().slice(0, 10);
const SUITES = [
@@ -1880,13 +1871,6 @@
const res = await runSuite(suite);
resultsBySuite.set(suite.name, res);
} catch (e) {
- const waiver = HARNESS_FAILURE_ALLOWLIST[suite.name];
- if (waiver && todayISO() <= waiver.expires) {
- console.error(
- `! ${suite.name}: ${e.message} — waived until ${waiver.expires} (${waiver.reason})`,
- );
- continue;
- }
console.error(`✗ ${suite.name}: ${e.message}`);
hardErrors.push(`${suite.name}: ${e.message}`);
}You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 7f4def6. Configure here.
Contributor
Benchmark report
Compares js-framework: 1k/10k row operations (ms, lower is better)All 20 timed operations (20 within noise)
Application bundle size (bytes)
8 other measured values are unchanged. Public-import reachability bundles (bytes)
24 other measured values are unchanged. |
…es 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]>
…/bench-paired-timing
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]>
…/bench-paired-timing
This was referenced Oct 3, 2026
…ed 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]>
…it journal fix Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm
added a commit
that referenced
this pull request
Oct 3, 2026
#1646 waived memo-wall one_change_B (octane-tsrx/react, maxRatio 1.4) until the per-row survivor work was fixed. With same-component de-opt survivors taking the memo bail directly, paired ~20 ms samples measured 0.80x, 0.80x and 0.82x across two same-runner runs (the previous code: 1.30-1.41x; #639: 0.97x). 1.1 keeps about 35% headroom while catching a return of the per-row item render. Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm
added a commit
that referenced
this pull request
Oct 3, 2026
…ng its render (#1664) * perf(octane): record event signal authority on the host instead of weak maps #1069 made every module that can receive a signal handle record each native handler's signal authority: the element's owner in one weak map and an "escaped" mark for the scope in another. Keyed rows paid two weak-map insertions per mounted row even with no signals in use. A same-runner paired A/B put prepend100/append100/insertmid100 at 0.48 -> 0.76 ms across #1069. The element's authority now lives in a $$signalOwner property beside its handler slots, journaled and rolled back like before, and the escape mark is a signalTokenEscaped field on Scope/Block with the same retirement truth table. Mounting no longer touches a weak map. bindSignalText also writes a scalar over the Text it already owns directly, skipping bindDirectSignal's policy dispatch; setText still journals the text and the binding bag. That path runs for every compiled text-hole update in such a module (memo-wall context refresh: 0.669 -> 0.622 ms paired). The signal-dom-bindings suite gains a deterministic guard counting weak-map insertions per mounted and inserted handler row (2 on main, 0 now), with dispatch and survivor-identity controls. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): restore keyed survivor indices from the list's shape record #833 made root renders undoable and journaled every keyed survivor's previous itemIndex in updateSurvivor: four journal slots per row on each reorder, removal, or insertion that shifts positions. A same-runner paired A/B put a 1,000-row rotate at 0.050 ms before #833 and 0.071 ms on main. An index moves only when the list's membership or order does, which records the list's shape (journalForSlot) anyway. reconcileKeyed now takes that record before the first survivor index write, and restoreForSlot restores each row's itemIndex from its chain position; a row whose index already differed is kept exactly. The hydration adoption branch, which restores a DOM range instead of a chain, still journals indices per row. Transition journals, which never restored itemIndex, now restore it too. The shape record also builds the key order with one spread and an early-exit comparison instead of an iterator loop that copied the order element by element. The root-transactions suite gains reorders.mjs, which counts root-journal slots per row for rotate/reverse/remove-first/insert-first (4 on main, 0 now). A held-root test pins that index-reading rows render their positions after a held reorder retries; it fails when the index restore is removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(bench): observe stable event authority on the host property The stable-event-authority work observer counted authority writes through WeakMap.prototype.set. Authority now lives in each host's $$signalOwner property, so the observer counts writes through an Element.prototype accessor instead. The expected counts are unchanged (400 mount, 0 retained, 0 changed capture), and dropping the runtime's unchanged-authority skip still fails the retained-write assertion. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): trim the keyed index journal to +51 raw / +10 gzip bytes The bench report on this PR measured +250 raw / +90 gzip bytes in every bundle with a keyed list. journalForSlot now returns false, so the call sites clear their pending flag without a helper. Rollback restores each row's index from its chain position without a side map, since every reconcile leaves a row's index equal to its position and the record is taken before the first survivor index write. The hydration-adoption branch does not restore a chain at all (its rows are fresh), so it no longer journals indices per row either. js-framework octane-tsrx bundle against main: +51 raw / +10 gzip (was +251 / +51). The held-root index test still fails when the restore is removed; the reorder guard still reads 0 slots per row. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): keep row indices across a hydrating keyed rollback The hydration-adoption branch of journalForSlot restores a DOM range, not a chain, so the trim that dropped its per-row index entries left an existing row's itemIndex on the aborted position after a hydrating render reordered the list and rolled back. Journal each existing row's index there again, before reconcileKeyed moves any of them. Bundle cost against main is now +130 raw / +31 gzip for js-framework octane-tsrx. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): update a same-component de-opt list item without entering its render A value-position list rebuilt by createElement (memo-wall wall B, every @octanejs binding) hands back a fresh descriptor per row. Each surviving row entered its item render (renderBlock, deoptItemBody, a nested childSlot) only to reach the memo bail of the component already mounted there, and the root journal recorded the item's inputs and render for every row. updateSurvivor now hands a plain de-opt item to updateDeoptComponent, which takes that nested childSlot's same-component branch directly, in the item's scope and with the priority its render would inherit: the memo bail, the identical-props bail, or a journaled props update and render of the existing component Block. A bail leaves the item's committed descriptor in place. Hydration, signal owners, native reads, non-root captures, unsettled items and every other child regime keep the ordinary item render. The function reaches updateSurvivor through ForSlot.itemUpdate, stamped in renderPreparedChildList, so compiled @for bundles never retain the descriptor renderer. Per bailed row (new memo-wall survivor-work guard, jitless precise calls): 48 calls and 8 root-journal slots before, 26 and 0 now. One __oneChangeB on the memo-wall production build: 46,138 calls before, 24,138 now. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): point childSlot's same-component branch at its de-opt item twin Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): drop de-opt item fast-path checks its component Block already implies An item whose nested slot holds a component Block never has recorded $$ctxReads (it is neither memo nor armed) and never also holds a portal. Its end marker and a former body-function flag do not change the same-component branch it mirrors. A non-object item fails the kind check without the separate null and typeof tests. -100 raw / -17 gzip in bundles that include the descriptor renderer. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): drop the one_change_B waiver and tighten its guard to 1.1 #1646 waived memo-wall one_change_B (octane-tsrx/react, maxRatio 1.4) until the per-row survivor work was fixed. With same-component de-opt survivors taking the memo bail directly, paired ~20 ms samples measured 0.80x, 0.80x and 0.82x across two same-runner runs (the previous code: 1.30-1.41x; #639: 0.97x). 1.1 keeps about 35% headroom while catching a return of the per-row item render. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): carry the de-opt survivor update in ForSlot.plainDeopt The plain de-opt flag now holds the list's survivor update itself (updateDeoptComponent, or null), so ForSlot needs no second field and the compiled @for path that shares updateSurvivor pays only one optional call. updateDeoptComponent writes the survivor's index. The js-framework rows app (compiled lists only) now grows +20 raw / +11 gzip over main, within the committed +32 budget, instead of +74 / +29. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Stacked on #1641 (
ci/weekly-ratio-triage), which adds datedwaiversupport. Review the three commits afterci(bench): triage the weekly ratio-guard breaches…. This branch rebases onto main once #1641 lands.#1641 waived twelve timing guards whose weekly breaches could not be judged. The samples sat near Chromium's 100 µs clock or rested on two samples, and each target ran its whole block minutes apart from the other side of its guard. This PR hardens those harnesses, then re-judges every guard from paired CI runs and same-runner A/B runs against the commits that set the guards.
Harnesses (new
benchmarks/lib/paired.mjs: a rotating per-round visit order and the ~20 ms calibration)js-framework-reorder,memo-wall,svg-dashboard,spa-navigation: every target's page stays open in one browser, each in its own context, and every sample round visits all targets in a rotating order. Short operations repeat until a sample takes about 20 ms: clicks, hook invocations, op batches, and summed navigation legs with a GC before each timed leg.activitycaught-reveal: a sample reveals several independent hidden roots in one window. The small case reveals 8× the large case's roots, so both cases do equal work, and the cases alternate per round. Quick mode takes at least 5 samples.ssr-workerd: each target gets an untimed priming spawn, then cold spawns run in paired rounds. Quick mode runs 6 rounds instead of 2. The first workerd launch of a run also pages in the binary, which used to land on whichever target ran first.bench.yml: asuitesdispatch input runs selected suites.Guards (
benchmarks/baselines/ratios.json)reports(≤1.35)cold_spawn_to_first_byte(≤1.2)pan_zoom(≤0.7)mountjsx/tsrx (≤1.6)parent_rerender_equal_A(≤0.6)nav_teardown(≤1.6)nav_mount(1.2 → 1.35)icon_swap(1.2 → 1.6)rotateb(≤0.6)one_change_B(≤1.4)ctx_through_wall_B(≤0.85)tooltip_swarm(≤0.8)The A/B runs served three builds at once: the guard-setting commit's fixtures (#639 for reorder and memo-wall, #635 for svg, #674 for spa), today's fixtures, and today's fixtures rebuilt with the pre-#983 minifier. The rebuild matched today's numbers everywhere, so the minifier does not explain any Octane slowdown. React got 10–20% faster from #983's esbuild minification, which is why
icon_swapis a rebaseline and not a regression.rotateb's note claimed React moves every survivor; with production React it moves one, as LIS does. A newrotatefguard (≤0.15, measured 0.042–0.045×) covers the LIS-vs-lastPlacedIndexdifferentiator, where React moves all 999 rows.Validation
--quick --ratiosover all six suites; 84 guards checked, the only breaches are the waivedrotatebandctx_through_wall_B). Thenav_mountrebaseline came after them and only loosens a passing guard.pnpm format:files:checkandpnpm typecheck:fileson the activity fixture pass. No benchmarks ran locally.pnpm format:checkpnpm typecheckpnpm testRisk / follow-ups
benchmarks/baselines/local/predate the new sampling; re-record them deliberately.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Changes how CI ratio guards are sampled and which breaches fail vs waive; mis-tuned pairing or rebaselines could hide real regressions or cause flaky CI, though product runtime code is largely untouched.
Overview
Introduces
benchmarks/lib/paired.mjsand rewires the browser timing suites that feed ratio guards so targets are measured in the same run, interleaved per sample (rotating visit order) instead of back-to-back blocks minutes apart. Short work is scaled to ~20 ms samples viacalibratedReps/SAMPLE_MS, including reorder clicks, memo-wall batches, SVG op repeats, SPA navigation legs (GC before each timed leg), activity caught-reveal (many hidden roots per sample with equal total boundary work), and ssr-workerd cold spawns (untimed priming spawn per target, then paired rounds; quick mode 6 rounds).bench.ymladds a manualsuitesinput passed throughBENCH_SUITES;bench.mjsbumps caught-reveal quick iterations to at least 5 and documents waiver handling already on the stack.ratios.jsonis re-triaged after paired CI/A/B runs: waivers dropped where noise drove weekly failures (activity caught-reveal, workerd cold start, several memo/svg/spa guards), waivers kept for confirmed Octane regressions (rotateb, memo-wall,tooltip_swarm, hydrate slicing, etc.), ceilings rebaselined where methodology or React minification shifted baselines (nav_mount,icon_swap, bundle gzip ratios), and a newjs-framework-reorderrotatefguard replaces the oldrotatebLIS story.Smaller harness fixes track bundler/runtime drift (Rspack async chunk, root-transaction journal hooks, scoped-signal block counts, Lynx gzip budgets, plain-hook byte normalization).
Reviewed by Cursor Bugbot for commit 876039f. Bugbot is set up for automated code reviews on this repo. Configure here.