Repository navigation
Conversation
…alesce-stream-signal-renders
Benchmark report
Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)❌ 9 value(s) exceed their committed budget. Reduce the growth, or raise the budget in a separate pull request that names the bytes and the reason (CONTRIBUTING.md, "Size budgets").
7 other measured values are unchanged. Public-import reachability bundles (bytes)❌ 26 value(s) exceed their committed budget. Reduce the growth, or raise the budget in a separate pull request that names the bytes and the reason (CONTRIBUTING.md, "Size budgets").
36 other measured values are unchanged. |
…am-signal-renders # Conflicts: # .agents/skills/performance-audit/references/scheduling.md # .claude/skills/performance-audit/references/scheduling.md # .cursor/skills/performance-audit/references/scheduling.md # .gemini/skills/performance-audit/references/scheduling.md # .github/skills/performance-audit/references/scheduling.md # .rulesync/skills/performance-audit/references/scheduling.md # benchmarks/scheduler-responsiveness/README.md
…am-signal-renders # Conflicts: # benchmarks/bundle-size/app-budgets.json
The merge took main's budget files. #1891 raised 70 rows ahead of #1875, which is still open. Each raw and gzip row now drops by exactly what this change saves against main (2f81266), measured per scenario on both trees. A row #1891 raised therefore keeps #1875's headroom. Brotli rows keep main's values, and no value is raised. Every head measurement fits its budget. The ratchet flags only the 70 rows #1891 raised for #1875, as it does for any PR until #1875 lands. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 8b0be53. Configure here.
| if (block.pending) { | ||
| if (TRANSITION_QUEUE.length !== 0) TRANSITION_TASK_DRIVER!.upgrade(block, mode, cue); | ||
| if (!background && TRANSITION_QUEUE.length !== 0) | ||
| TRANSITION_TASK_DRIVER!.upgrade(block, mode, cue); |
There was a problem hiding this comment.
Producer refresh clobbers transition priority
Medium Severity
A ready query or derived$ publication still sets pendingMode to urgent on an already-queued block when background skips upgrade. After a sync startTransition callback, TRANSITION_DEPTH is 0, so the later producer result overwrites the waiting transition. splitCue then fails and the cue microtask runs renderBlock, committing the transition work immediately instead of leaving it on the host-task queue.
Reviewed by Cursor Bugbot for commit 8b0be53. Configure here.
| block.pendingMode = mode; | ||
| block.pendingDeferred = deferred; | ||
| if (mode === 'transition' && TRANSITION_TASK_DRIVER?.queue(block, cue)) return; | ||
| if ((background || mode === 'transition') && TRANSITION_TASK_DRIVER?.queue(block, cue)) return; |
There was a problem hiding this comment.
Producer work suppresses sibling view transitions
Medium Severity
Urgent producer refreshes now join TRANSITION_QUEUE while keeping pendingMode urgent. queueAllTransition rejects the whole flush as soon as any queued block is not transition-priority, so a ready query or derived$ waiting beside an unrelated startTransition render prevents View Transition capture for that user update.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 8b0be53. Configure here.
The merge took main's budget files. Each raw and gzip row that main (abe9b42) fits drops by exactly what this change saves against main, measured per scenario on both trees. Brotli rows keep main's values unless the ratchet asks for less. That gives 24 lowers and no raises. Main measures over 35 rows after #1875 and #1888, and #1887 budgets that growth. Those rows keep main's values here. Merging #1887 will re-lower the ones this change also saves on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolve with #1875: splitCue/splitsCue moved to TRANSITION_ROOT_DRIVER, and the task queue now also takes native producer refreshes. The cue marks move out of queueTransitionBlock into the three hooks that raise a cue (markTransitionCue), so native-reader apps that reach the shared task queue carry none of them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… a row (#1890) * perf(octane): copy a keyed reorder's record directly until it relinks a row A keyed reorder records its list at the first row index it rewrites, before it knows whether it will relink a few rows or every row. Since #1833 that record allocated its `links` Map and a per-journal records Map up front. When the reorder then reached the LIS path, `fullForSlotRecord` walked the chain through the empty links Map and, for a key Map already out of chain order, built a Set of every row to filter it. The record now gets its links Map at its first relink (`forSlotLinks`). Until then only index writes have run, which change neither the chain nor the key Map, so converting it copies the list as it stands, which is the full form's cost before #1833. The record rides in the spare slot of its own undo entry, found again through the window's `seen` index, so `SLOT_RECORDS` is gone and the record still lives exactly as long as its log. - recursive-context zero-context reorder: 4 Map constructions -> 2, so context-cache-work.mjs passes its ceiling again (bisected to e595a13). - js-framework reorder matrix (octane-tsrx, paired, 12 samples): rotatef, rotateb and displace3-8 are 22-27% faster than main and within 5% of the runtime before #1833; removals and inserts keep #1833's gains. - Framework bundles are 129-137 raw bytes smaller; budgets lowered. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): look a keyed list's record up only when its window has an entry The PR bench counted two more production calls on every js-framework operation: journalForSlot and journalForOwnedListClear called the record lookup, and fullForSlotRecord with no record, even for a list's first record in a render, where there is no entry to find. Skip both when the list has no entry. Every js-framework calls_* and dom_* counter now equals main's (pair.mjs --work-only). Lower the bindings app and total brotli budgets the ratchet now asks for. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): read a keyed list's record from its undo entry inline Inline the record lookup in journalForSlot and journalForOwnedListClear. With the helper, the bindings app's framework chunk compressed 21 gzip bytes larger than main's, past its budget, although raw was 104 bytes smaller. Inline, it is 5 gzip bytes larger and 10 under the budget. Production calls are unchanged: every js-framework calls_* and dom_* counter equals main's (pair.mjs --work-only against c0192ec). Re-measure the bundle budgets on current main. The merges took main's budget files, and this writes 40 lowers and no raises. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): lower the budgets by this change's measured saving over #1891 The merge took main's budget files. #1891 raised 70 rows ahead of #1875, which is still open. Each raw and gzip row now drops by exactly what this change saves against main (2f81266), measured per scenario on both trees. A row #1891 raised therefore keeps #1875's headroom. Brotli rows keep main's values, and no value is raised. Every head measurement fits its budget. The ratchet flags only the 70 rows #1891 raised for #1875, as it does for any PR until #1875 lands. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): re-lower the budgets this change saves on after #1875 landed The merge took main's budget files. Each raw and gzip row that main (abe9b42) fits drops by exactly what this change saves against main, measured per scenario on both trees. Brotli rows keep main's values unless the ratchet asks for less. That gives 24 lowers and no raises. Main measures over 35 rows after #1875 and #1888, and #1887 budgets that growth. Those rows keep main's values here. Merging #1887 will re-lower the ones this change also saves on. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): re-lower the budgets this change saves on over #1893 The merge took main's budget files (6eef1e0). Each raw and gzip row that main fits drops by exactly what this change saves against main, measured per scenario on both trees. Brotli rows keep main's values unless the ratchet asks for less. That gives 37 lowers and no raises. The rows #1893 raised for #1892 keep #1892's growth. The 30 rows main exceeds until #1887 lands keep main's values. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): re-lower the budgets this change saves on over 87d9f95 The merge took main's budget files. Main now fits every row. Each raw and gzip row drops by exactly what this change saves against main, measured per scenario on both trees. Brotli rows keep main's values unless the ratchet asks for less. That gives 63 lowers and no raises. The rows #1893 raised for #1892 keep #1892's growth. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): lower the budgets by this change's saving over main's ratchet The merge took main's budget files. e14fbdf set every budget to main's measured bytes plus headroom. Each raw and gzip row drops by exactly what this change saves against main, measured per scenario on both trees. Brotli rows keep main's values unless the ratchet asks for less. That gives 56 lowers and no raises. Every ceiling and the ratchet hold locally, and so do the budget-raise and hydration-free checks. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): lower the budgets by this change's saving after #1892 The merge took main's budget files (68aa481), which match main's measured bytes. Each raw and gzip row drops by exactly what this change saves against main, measured per scenario on both trees. Brotli rows keep main's values unless the ratchet asks for less. That gives 54 lowers and no raises. Locally, binding-mantine-hooks-esbuild brotli is 7 bytes over main's value, 27,265 against 27,258. Its raw and gzip bytes equal main's: esbuild assigns different minified names in that bundle, and brotli compresses them differently. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: domgan-oai <[email protected]>
…sition test (#1902) "commits without animation when a pre-render passive adds urgent sibling work" relies on a passive effect from a sync commit still being pending when the transition's host task (#1873) starts rendering. In the test, that passive is drained at the next animation frame, which then posts to the runtime's long-lived post-paint port. When jsdom's frame timer comes due before the transition task runs, as it can on a loaded CI worker, the passive drains first and the transition animates. The test's capture mock never runs the update, so the left scope stays 'initial', and `vi.waitFor` timed out in octane-prod on #1893. The test now fakes setTimeout and requestAnimationFrame, so no frame and no fallback timer can drain the passive early. It waits for the transition with a host task posted after the runtime's, not by polling, because `vi.waitFor` would advance the fake timers. The host-task `nextTask()` helper moves to tests/_helpers.ts. It replaces the local copies in view-transition.test.ts and view-transition-matching.test.ts. #1875 already made the matching tests wait for the native transition start. Co-authored-by: Claude Opus 5.5 <[email protected]>
Since #1875 a ready producer whose shared 5 ms host budget is spent waits for a host task (yieldForHostBudget). drain() only awaited microtasks, so on a loaded CI shard the stream-query adoption tests saw result$.get() throw its pending promise. drain() now lets a host task run after each microtask checkpoint. With the budget forced to 1e-9 ms (one unit per window), the old drain fails both stream cases and the new one passes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* perf(octane): render hookless control-flow arms without a Block The compiler marks an @if/@switch arm lite when it calls no hook, use() or context read, holds no @Try, and makes no bare-identifier call while it renders. ifBlock and switchBlock take the mask. On a client mount under a root render that created the arm's owner, a lite arm renders in a ScopeImpl with a LiteBlockImpl stand-in that carries its bound the way an arm Block would, so boundary sharing, journaling and staged swaps read one shape. Teardown runs through the slot in tree order. A committed lite arm swaps out through the staged root-render path, and its release waits for the commit. Hydration, signal ownership, native reads and shared bodies keep Block arms. Paired: recursive-context cold mount 0.970, partial remount cycle 0.900; spa-navigation nav_mount 0.829, nav_deep 0.828. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): count a kept hookless arm in the profile build The same-arm path for a lite arm skipped the arm.keep probe. The profile docs and test now say a hookless arm mounted with its owner is not a Block, so a swap tears one down only once an update has mounted a Block arm. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): keep hook-producing attribute values and wrapped callees off lite arms The lite-arm proof skipped every ref and on* attribute value, so ref={useRef(null)} or onClick={useCallback(...)} marked an arm hookless. It now skips only an inline callback. A callee behind a TS cast, !, ?. or a comma, a bare tag, and helper.call/apply also keep an arm on a Block. Core slot teardown reaches unmountLiteArm through a hook that the lite mount installs, so a root without control flow carries none of the lite teardown. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): retire a return slot's lite arm and read its owner's disposal disposeReturnSlot already read a lite arm's bound for the deferred range; it now retires the arm's stand-in as well, as deferRootArmReplacement does, so queued renders under it stop with the slot. The post-teardown checks in renderBranchSlot read disposal from the owning Block, since a lite stand-in has none of its own. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(octane): share deferRootUnmount's range deferral with lite arms unmountLiteArm copied deferRootUnmount's node collection, rollback restore and commit-time reconnect. Both now call deferRootTeardown with their own release (unmountBlock or releaseLiteArm, passed by reference so core teardown never names the lite path), and a lite arm's immediate detach uses removeRange after its cleanups, as unmountBlock does. Control-flow bundles shrink by about 500 B raw (hydrate-frame -517 raw, -145 gzip); a root without control flow pays +57 raw for the extra call. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): let signals-serialization's drain run host-budget yields Since #1875 a ready producer whose shared 5 ms host budget is spent waits for a host task (yieldForHostBudget). drain() only awaited microtasks, so on a loaded CI shard the stream-query adoption tests saw result$.get() throw its pending promise. drain() now lets a host task run after each microtask checkpoint. With the budget forced to 1e-9 ms (one unit per window), the old drain fails both stream cases and the new one passes. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Since #1875 a ready producer whose shared 5 ms host budget is spent waits for a host task (yieldForHostBudget). drainProducers() waited for a single setImmediate, so on a loaded CI shard a stream step could still be parked behind that task and the test saw a pending or stale value. It now runs four rounds of setImmediate plus a postHostTask task, so each round lets at least one parked producer continue. With the budget forced to 1e-9 ms (one unit per window), the old helper failed signals-inspection's stream-activity case, three signals-streams cases, and two signals-unified cases in both octane-signals and octane-signals-prod; three rounds is the minimum that passes them all. Co-authored-by: Claude Opus 5.5 <[email protected]>


Summary
Ready query and asynchronous derived results currently alternate publication microtasks with native component render microtasks. A buffered stream can therefore perform a render and commit for every value without returning to the browser. Concurrent producers can also consume independent runs of CPU work without a shared scheduling boundary.
Coalesce producer-driven native component renders in the shared host-task queue and pace stream pulls and ready results with one approximately 5 ms host budget. Every source publication, graph effect, and direct signal binding remains observable. This addresses priority 3 in #1864 using main's landed task scheduler and shared reader budget. Only native producer admission and pacing are added here.
Changes
flushSync.Validation
c0192ec81failed 8 of the original 12 producer regressions.git diff --check, and the no-budget-raises policy pass. The performance scan has one scheduling candidate, covered by ordered-publication tests and the production marker-task probe below.pnpm syncwas attempted but stops at unavailabletypescript-native/package.json. The focused cached-toolchain checks do not replace pinned CI.Matched production-minified runtime + jsdom probe, Node 22.22.3: one excluded warmup pair and three alternating runs against exact main
90a57d820, usingnode benchmarks/scheduler-responsiveness/signal-backlog.mjs [baseline-path --report]. Candidate8b0be5339includes the landed split-cue change.Every ordered value and final DOM value is asserted. These are task-order and component-work measurements, not browser input-to-paint evidence. Concurrent completion is 241.92–242.01 ms on main versus 245.86–247.11 ms on the candidate: more intermediate commits buy earlier host-task opportunities.
Current-head CI
CI at
8b0be5339is running. The previous headd8fff71dfpassed every check, including the separate bundle-size gate and Chromium, in its completed run. This head resolves the new conflict with #1888 and fixes the native-first capability interaction described above.The native producer budgets landed in #1891; #1887 covers #1888. The integrated build needs 18 additional ceiling adjustments, proposed separately with the exact measurements in #1901. The #1875 and #1877 byte artifacts match, and all 64 runtime work counters are unchanged. This PR raises no budgets. Its unit, parity, and Chromium jobs pass; the size gates await those budget dependencies and the final downward ratchet.
Risk / follow-ups
The budget cannot interrupt one expensive callback, render, or commit. Urgent work can consume a queued producer render early. Direct signal binding writes still happen for every publication. Pacing concurrent roots can increase intermediate commits (21 versus 11 in the concurrent probe) while allowing other tasks to run. Bundle costs and all current-head CI checks remain required; no size budgets are raised here.
Provenance
agent-authored)Codex task · host
com-79386Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
High Risk
Touches core render scheduling and signal streaming paths where subtle ordering, urgency, and transition/cue interactions can regress; mitigated by broad tests but behavior is easy to get wrong in edge cases.
Overview
Ready query and asynchronous
derived$stream updates no longer drive a separate native component render on every publication. Graph notifications stay synchronous for subscribers, effects, and direct bindings; only DOM render admission moves onto the existing host-task queue viapublishNativeProducerand abackgroundpath inscheduleRender, while urgent writes, events, andflushSyncbehave as before.Stream pulls and ready-result handling in
requests.tsandcomputations.tsnow shareyieldForHostBudget(~5 ms) so bursts yield between units without dropping ordering, cancellation, or observation backpressure.Adds
signal-backlog.mjs, scheduler docs, a changeset, focusedsignal-tasktests, small bundle budget ratchets, and a mailroom e2e wait for post-save editor readiness.Reviewed by Cursor Bugbot for commit 8b0be53. Bugbot is set up for automated code reviews on this repo. Configure here.