Skip to content

ci(bundle-size): raise budgets for the transition task flush (#1873) - #1874

Merged
trueadm merged 1 commit into
mainfrom
ci/budgets-transition-task
Oct 8, 2026
Merged

trueadm merged 1 commit into
mainfrom
ci/budgets-transition-task

Conversation

@trueadm

@trueadm trueadm commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Budget-only raise for #1873 (#1864 step 2, G1: transition-priority renders flush in a posted host task). Per CONTRIBUTING.md ("Size budgets"), it lands on its own. Every budget in the three files moves to #1873's measured bytes + 32, written with --write-budgets on #1873's head (merged with main 40fdefd):

raw gzip
Apps that never start a transition (cli-spa-starter, root-*, hooks-state, context, hydrate-*, …) about +189 +43 to +106
Apps with transitions (suspense-transition, base-ui, radix, apollo-client) +1,034 to +1,040 +381 to +446
run.mjs framework gzip octane-tsrx +88, octane-jsx +106, todomvc +86, chat-stream +72, weather +92, bindings +378, ceiling +415

budget-raises.mjs --base origin/main: 83 raises in a budget-only change. Brotli values that did not move stay as they are.

Why the growth is worth it

#1873 coalesces a backlog of ready Action results and transitions into one render in a later task:

  • 100 synchronous useActionState dispatches now give 2 commits, where they gave 101; React gives 2.
  • In Chromium, the release click of a 12-action form backlog goes from 176 to 184 ms of Event Timing latency (1× and 4× CPU) to no entry ≥ 16 ms, matching React 19.2.7.

The task path is a driver installed with the first transition. Apps that never start one carry only the checks in scheduleRender, flushSync, flushWork and the controlled-input restore, about 189 raw bytes. js-framework call and DOM-mutation counters are identical.

Merge order

Merge this immediately before #1873, ideally in the same minute. While this is on main without #1873, every other pull request (and main itself, after another push) fails the shard 1/4 ratchet, because these budgets sit about 190 to 1,040 bytes above main's measurement. #1873's own shard 1/4 fails production … bytes exceed committed budget until this lands. If #1873 is delayed after this merges, revert this PR rather than lowering budgets by hand.

Validation

  • node benchmarks/bundle-size/budget-raises.mjs --base origin/main: 83 raises in a budget-only change.
  • The values come from run-minimal.mjs --write-budgets and run.mjs --write-budgets octane-tsrx octane-jsx on fix(octane): render transition-priority work in a later task #1873's head.
  • pnpm test / pnpm typecheck / pnpm format:check: JSON-only change, left to CI.

Provenance

  • An agent produced this diff (agent-authored)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Low Risk
JSON-only CI threshold updates with no runtime or application code changes.

Overview
Raises committed bundle-size ceilings in app-budgets.json, jsx-budgets.json, and minimal-budgets.json so CI matches measured output from the upcoming transition–task flush work (#1873). Values were regenerated with --write-budgets (measured bytes + 32); 83 budget entries move up, mostly on framework raw/gzip (and brotli where it changed).

Growth is uneven: apps that never start a transition gain roughly +189 raw bytes; transition-heavy fixtures (suspense-transition, base-ui, radix, apollo-client, etc.) gain about +1k raw and +380–450 gzip. Octane app framework budgets in app-budgets.json rise in the same band.

This is a budget-only PR meant to merge immediately before #1873; until that lands, main and other PRs can fail the bundle-size ratchet because limits sit above current main measurements.

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

Budget-only raise for #1873 (#1864 step 2), which renders transition-priority
work in a posted host task. Every budget moves to #1873's measured bytes + 32.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent ci PR: CI or build pipeline labels Oct 8, 2026
@trueadm
trueadm marked this pull request as ready for review October 8, 2026 00:06
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Benchmark report

🟢 No budget breaches, no added work, and no timing changes beyond ±3%.

Compares 40fdefdeb, the merge commit's first parent with 385e27845 on the same runner. A byte value over its committed budget or any increase in a js-framework work counter fails this check. Wall time is a report: base and head samples alternate in one browser, and an operation is called slower or faster only when the 95% confidence interval of its ratio excludes ±3%. Workflow run

js-framework: 1k/10k row operations

All 20 timed operations (20 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 3.108 3.425 ±0.0% −3.1% … +3.3% ⚪ within noise
octane-tsrx replace 8.442 8.233 −0.5% −5.5% … +3.4% ⚪ within noise
octane-tsrx add 2.975 3.092 ±0.0% −3.3% … +6.9% ⚪ within noise
octane-tsrx update 0.151 0.151 +0.0% −5.4% … +3.0% ⚪ within noise
octane-tsrx select 0.006 0.006 −0.5% −1.9% … +1.1% ⚪ within noise
octane-tsrx swap 0.032 0.033 +1.4% −1.4% … +4.2% ⚪ within noise
octane-tsrx remove 0.018 0.017 −1.5% −6.0% … +3.1% ⚪ within noise
octane-tsrx runlots 25.467 26.075 −1.3% −4.1% … +2.1% ⚪ within noise
octane-tsrx select_lots 0.007 0.007 +0.6% −1.6% … +2.0% ⚪ within noise
octane-tsrx clear 51.542 52.167 +0.4% −2.4% … +3.7% ⚪ within noise
octane-jsx run 3.517 3.767 +2.6% −2.5% … +2.8% ⚪ within noise
octane-jsx replace 8.533 8.233 +1.5% −4.4% … +15.8% ⚪ within noise
octane-jsx add 3.942 3.925 +1.2% −2.6% … +7.3% ⚪ within noise
octane-jsx update 0.278 0.274 −0.8% −3.6% … +2.0% ⚪ within noise
octane-jsx select 0.158 0.167 −2.0% −8.5% … +3.2% ⚪ within noise
octane-jsx swap 0.276 0.276 −2.4% −9.5% … +1.0% ⚪ within noise
octane-jsx remove 0.212 0.215 +2.3% −4.3% … +4.4% ⚪ within noise
octane-jsx runlots 34.275 33.158 +0.6% −5.1% … +4.5% ⚪ within noise
octane-jsx select_lots 2.022 2.058 +2.9% −5.1% … +13.6% ⚪ within noise
octane-jsx clear 81.383 83.092 −3.9% −10.0% … +3.8% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

No changes across 60 measured values.

Public-import reachability bundles (bytes)

No changes across 111 measured values.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
octane-website eff04c2 Commit Preview URL

Branch Preview URL
Oct 08 2026, 12:21 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
octane-website-mcp eff04c2 Commit Preview URL

Branch Preview URL
Oct 08 2026, 12:23 AM

trueadm added a commit that referenced this pull request Oct 8, 2026
Shard 1/4 fails its byte budgets until #1874 merges, and fail-fast then cancels
shards 2-4. This commit only lets those shards report; it is reverted before
merge, and the raise lands through #1874.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 8, 2026
The test shards reported on a17a35a (all four passed with identical code).
The raise lands through #1874, which merges immediately before this PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@trueadm
trueadm merged commit 573127f into main Oct 8, 2026
53 checks passed
@trueadm
trueadm deleted the ci/budgets-transition-task branch October 8, 2026 07:06
trueadm added a commit that referenced this pull request Oct 8, 2026
* fix(octane): render transition-priority work in a later task (#1864)

Transition renders were flushed on a microtask, like urgent ones, so every
ready continuation paid for its own render and commit inside one microtask
checkpoint. A hundred synchronous useActionState dispatches committed 101
times where React 19 commits twice, and the browser could neither paint nor
deliver input until the last one finished (#1864, step 2, G1).

Transition renders scheduled outside a render or flush now wait in a
TRANSITION_QUEUE for a host task of their own (postHostTask), as React renders
a transition lane in a Scheduler task. That covers startTransition updates,
Action results, transitions started after an await, and the updates of the
async-Action window. The microtask flush never drains the queue; the task,
flushSync and act() do. An urgent update to a waiting block moves it onto the
microtask flush, and the pending cues (useTransition and useActionState raising
isPending, useOptimistic showing a value) keep the microtask flush so they
commit before the work they announce.

A transition's pending-count release waits for the task's flush
(afterTransitionFlush), and its retained FLUSHED_TRANSITION_UPDATES survive an
urgent flush that runs first, so a suspending transition still holds. Work
scheduled while the task (or the useDeferredValue swap task) runs joins its
own flush, and a view-transition-wrapped Suspense resume adopts the queue. The
task path is a driver installed with the first transition, so applications
that never start one keep the old scheduler shape. The island activation gate
now uses the shared postHostTask.

differences-from-react.md §Actions and §Scheduler, the website's Forms
section, and the transition-hooks benchmark harness (which now waits for the
host task) describe the new timing.

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

* fix(octane): commit waiting transitions before a controlled-input restore

maybeFlushDiscrete decided between the view-transition flush and flushSync from
QUEUE alone, so a transition-only controlled input (onInput calling
startTransition) waiting for its task fell to flushSync and skipped
startViewTransition. Adopt the waiting transitions first, as before #1864 step 2.

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

* fix(octane): adopt waiting transitions only in a resume that drains them

wrapResume adopted the transition queue before it knew whether it would drain:
on the paths that wait for an in-flight view transition or fall back to an
unwrapped resume, that retired the posted task and released the transition's
follow-ups (isPending's falling edge, form resets) before its render. Owners
now include the waiting blocks without adopting them; only the urgent-sibling
drain and the vtFlush update callback adopt, and the other paths leave the
queue to its own task.

Also move the website a11y baseline's /docs/core-apis table selector from
nth-child(204) to nth-child(205): the new Forms paragraph shifts that table.

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

* ci: temporarily carry #1874's budgets so the test shards run

Shard 1/4 fails its byte budgets until #1874 merges, and fail-fast then cancels
shards 2-4. This commit only lets those shards report; it is reverted before
merge, and the raise lands through #1874.

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

* test(remix-router): commit the revalidation's loading state across a task

Router updates are transitions, which now commit in a later task (#1864), so a
synchronous revalidation loader coalesced "loading" and "idle" into one
render and the boundary never saw the loading -> idle edge it resets on, as
under React's Scheduler. Keep the loader pending across tasks so the loading
state commits, and assert the caught error persists until the revalidation
completes.

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

* Revert "ci: temporarily carry #1874's budgets so the test shards run"

The test shards reported on a17a35a (all four passed with identical code).
The raise lands through #1874, which merges immediately before this PR.

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

* fix(octane): move an upgraded block out of the transition queue

upgradeTransitionBlock copied a waiting block onto QUEUE but left it in
TRANSITION_QUEUE. Once that render committed, the stale entry was adopted with a
null pendingMode, so the task's flush no longer looked all-transition and lost
its ViewTransition wrap, and the transition's follow-ups (isPending's falling
edge) stayed on a task with nothing left to do. Splice the block out, and when
the queue empties, retire the task so the follow-ups run after the microtask
flush that now renders the work.

The change shrinks brotli for suspense-transition and the bindings app, so their
budgets ratchet down with --write-budgets (lowerings only).

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 ci PR: CI or build pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant