Skip to content

fix: coalesce and pace ready signal producers - #1875

Merged
trueadm merged 16 commits into
octanejs:mainfrom
openai-oss-forks:codex/coalesce-stream-signal-renders
Oct 8, 2026
Merged

trueadm merged 16 commits into
octanejs:mainfrom
openai-oss-forks:codex/coalesce-stream-signal-renders

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Mark the existing graph publication batch so native component reads request task admission while retaining their current Suspense priority and normal render queue membership.
  • Preserve urgent native events, plain signal writes, layout cascades, imperative updates, and flushSync.
  • Check the shared producer budget before a pull and before processing a ready result. Revalidate producer leases after waiting and preserve server observation acknowledgements before the next pull.
  • Add regression coverage for query/derived ordering, cancellation, replacement, concurrent producers, controlled input, and unmount; document the timing contract and add a production-runtime benchmark.
  • Preserve the split pending-cue behavior landed in fix(octane): commit the pending cue apart from its component's transition (#1864) #1888. Cue-splitting stays on the transition root capability, while native-only readers install only task admission. Cover both initialization orders; a plain merge otherwise calls a missing cue method after a native read.

Validation

  • 171 focused development tests across signal scheduling, streaming, async signals, native collection, query observation/backpressure, and Action cues.
  • 30 production-mode signal and Action-cue tests. The new native-first integration regression fails before the capability fix (stale DOM plus a missing-method error); the transition-first case protects the reverse initialization order. Earlier control against main c0192ec81 failed 8 of the original 12 producer regressions.
  • Independent read-only correctness and complexity review is clean. The landed cue algorithm is unchanged, and native-only readers do not retain transition-root/offscreen rendering.
  • Changed-file formatting, 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.
  • Native View Transition tests wait for actual capture entry. The repeated-draft-save browser test waits for the loaded draft route and reset fetcher state before its second edit; it does not claim to preserve edits made during navigation.
  • Full local workspace gates: pnpm sync was attempted but stops at unavailable typescript-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, using node benchmarks/scheduler-responsiveness/signal-backlog.mjs [baseline-path --report]. Candidate 8b0be5339 includes the landed split-cue change.

Workload Main Candidate
100 ready query values 101 commits 1 commit
100 ready derived values 101 commits 1 commit
Query, 2 ms subscriber/value marker after 100 values / 203.26–204.10 ms; total 203.28–204.12 ms marker after 6 values / 12.27–12.95 ms; total 207.24–208.21 ms
Derived, 2 ms subscriber/value marker after 100 values / 203.21–203.66 ms; total 203.22–203.67 ms marker after 3 values / 6.05–6.32 ms; total 204.25–206.42 ms
12 concurrent queries, 10 values each marker after 120 values / 241.91–242.00 ms; 11 commits marker after 6 values / 12.11–12.46 ms; 21 commits

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 8b0be5339 is running. The previous head d8fff71df passed 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

  • An agent produced this diff (agent-authored)

Codex task · host com-79386


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with 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 via publishNativeProducer and a background path in scheduleRender, while urgent writes, events, and flushSync behave as before.

Stream pulls and ready-result handling in requests.ts and computations.ts now share yieldForHostBudget (~5 ms) so bursts yield between units without dropping ordering, cancellation, or observation backpressure.

Adds signal-backlog.mjs, scheduler docs, a changeset, focused signal-task tests, 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.

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix labels Oct 8, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review October 8, 2026 00:32

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/octane/src/runtime.ts Resolved
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • ❌ bundle-size: 9 value(s) exceed their committed budget
  • ❌ bundle-reachability: 26 value(s) exceed their committed budget
  • 🔴 bundle-size: 39 value(s) increased within budget
  • 🔴 bundle-reachability: 47 value(s) increased within budget

Compares 90a57d820, the merge commit's first parent with 930078d8a 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 2.367 2.358 ±0.0% −3.7% … ±0.0% ⚪ within noise
octane-tsrx replace 4.850 4.875 ±0.0% −1.9% … +2.0% ⚪ within noise
octane-tsrx add 2.267 2.208 ±0.0% −4.3% … +0.0% ⚪ within noise
octane-tsrx update 0.117 0.116 −0.0% −1.5% … +0.5% ⚪ within noise
octane-tsrx select 0.005 0.005 −1.1% −2.6% … −0.5% ⚪ within noise
octane-tsrx swap 0.028 0.027 −1.2% −2.8% … −0.6% ⚪ within noise
octane-tsrx remove 0.013 0.013 −1.0% −2.5% … +0.5% ⚪ within noise
octane-tsrx runlots 22.783 22.408 −0.2% −3.1% … +1.5% ⚪ within noise
octane-tsrx select_lots 0.006 0.006 −0.9% −3.1% … ±0.0% ⚪ within noise
octane-tsrx clear 39.950 41.000 +0.3% −1.3% … +2.1% ⚪ within noise
octane-jsx run 3.408 3.425 +1.3% −1.5% … +3.0% ⚪ within noise
octane-jsx replace 7.250 7.042 +2.1% ±0.0% … +3.2% ⚪ within noise
octane-jsx add 3.325 3.175 −3.6% −7.1% … +3.0% ⚪ within noise
octane-jsx update 0.264 0.262 −1.8% −3.9% … +2.0% ⚪ within noise
octane-jsx select 0.144 0.144 −2.3% −4.6% … +0.5% ⚪ within noise
octane-jsx swap 0.228 0.223 ±0.0% −1.4% … +1.8% ⚪ within noise
octane-jsx remove 0.175 0.181 +0.6% −0.9% … +1.7% ⚪ within noise
octane-jsx runlots 30.667 31.792 +0.5% −2.4% … +4.7% ⚪ within noise
octane-jsx select_lots 2.099 2.022 −2.3% −10.8% … +6.4% ⚪ within noise
octane-jsx clear 51.908 52.442 −0.1% −2.2% … +5.8% ⚪ within noise

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").

target metric head budget over
octane-tsrx chat_fw_gzip 36,807 36,791 +16
octane-tsrx chat_js_gzip 39,522 39,506 +16
octane-tsrx weather_js_brotli 44,467 44,466 +1
octane-tsrx bindings_fw_raw 341,240 339,858 +1,382
octane-tsrx bindings_fw_gzip 109,367 109,005 +362
octane-tsrx bindings_fw_brotli 94,998 94,788 +210
octane-tsrx bindings_js_raw 688,878 687,496 +1,382
octane-tsrx bindings_js_gzip 225,032 224,671 +361
octane-tsrx bindings_js_brotli 191,233 190,989 +244
target metric base head Δ
octane-tsrx js_raw 113,131 113,173 +42 (+0.0%) 🔴
octane-tsrx js_gzip 36,879 36,908 +29 (+0.1%) 🔴
octane-tsrx js_brotli 32,590 32,685 +95 (+0.3%) 🔴
octane-tsrx app_gzip 2,335 2,334 −1 (−0.0%) 🟢
octane-tsrx fw_raw 106,185 106,227 +42 (+0.0%) 🔴
octane-tsrx fw_gzip 34,544 34,574 +30 (+0.1%) 🔴
octane-tsrx fw_brotli 30,558 30,653 +95 (+0.3%) 🔴
octane-tsrx todo_js_raw 121,538 121,580 +42 (+0.0%) 🔴
octane-tsrx todo_js_gzip 39,674 39,704 +30 (+0.1%) 🔴
octane-tsrx todo_js_brotli 34,923 34,956 +33 (+0.1%) 🔴
octane-tsrx todo_app_gzip 2,221 2,219 −2 (−0.1%) 🟢
octane-tsrx todo_app_brotli 1,886 1,879 −7 (−0.4%) 🟢
octane-tsrx todo_fw_raw 116,920 116,962 +42 (+0.0%) 🔴
octane-tsrx todo_fw_gzip 37,453 37,485 +32 (+0.1%) 🔴
octane-tsrx todo_fw_brotli 33,037 33,077 +40 (+0.1%) 🔴
octane-tsrx chat_js_raw 120,287 120,329 +42 (+0.0%) 🔴
octane-tsrx chat_js_gzip 39,512 39,522 +10 (+0.0%) 🔴
octane-tsrx chat_js_brotli 34,858 34,879 +21 (+0.1%) 🔴
octane-tsrx chat_app_gzip 2,714 2,715 +1 (+0.0%) 🔴
octane-tsrx chat_app_brotli 2,386 2,388 +2 (+0.1%) 🔴
octane-tsrx chat_fw_raw 114,522 114,564 +42 (+0.0%) 🔴
octane-tsrx chat_fw_gzip 36,798 36,807 +9 (+0.0%) 🔴
octane-tsrx chat_fw_brotli 32,472 32,491 +19 (+0.1%) 🔴
octane-tsrx weather_js_raw 156,842 156,883 +41 (+0.0%) 🔴
octane-tsrx weather_js_gzip 50,886 50,924 +38 (+0.1%) 🔴
octane-tsrx weather_js_brotli 44,407 44,467 +60 (+0.1%) 🔴
octane-tsrx weather_app_gzip 7,871 7,873 +2 (+0.0%) 🔴
octane-tsrx weather_app_brotli 6,663 6,675 +12 (+0.2%) 🔴
octane-tsrx weather_fw_raw 134,688 134,729 +41 (+0.0%) 🔴
octane-tsrx weather_fw_gzip 43,015 43,051 +36 (+0.1%) 🔴
octane-tsrx weather_fw_brotli 37,744 37,792 +48 (+0.1%) 🔴
octane-tsrx bindings_js_raw 688,832 688,878 +46 (+0.0%) 🔴
octane-tsrx bindings_js_gzip 225,006 225,032 +26 (+0.0%) 🔴
octane-tsrx bindings_js_brotli 191,175 191,233 +58 (+0.0%) 🔴
octane-tsrx bindings_app_gzip 115,667 115,665 −2 (−0.0%) 🟢
octane-tsrx bindings_app_brotli 96,214 96,235 +21 (+0.0%) 🔴
octane-tsrx bindings_fw_raw 341,194 341,240 +46 (+0.0%) 🔴
octane-tsrx bindings_fw_gzip 109,339 109,367 +28 (+0.0%) 🔴
octane-tsrx bindings_fw_brotli 94,961 94,998 +37 (+0.0%) 🔴
octane-tsrx full_fw_raw 568,620 568,708 +88 (+0.0%) 🔴
octane-tsrx full_fw_gzip 171,214 171,256 +42 (+0.0%) 🔴
octane-tsrx full_fw_brotli 143,953 143,986 +33 (+0.0%) 🔴
octane-jsx js_raw 187,729 187,770 +41 (+0.0%) 🔴
octane-jsx js_gzip 59,529 59,562 +33 (+0.1%) 🔴
octane-jsx js_brotli 51,727 51,752 +25 (+0.0%) 🔴
octane-jsx app_gzip 2,856 2,857 +1 (+0.0%) 🔴
octane-jsx app_brotli 2,408 2,404 −4 (−0.2%) 🟢
octane-jsx fw_raw 179,464 179,505 +41 (+0.0%) 🔴
octane-jsx fw_gzip 56,673 56,705 +32 (+0.1%) 🔴
octane-jsx fw_brotli 49,319 49,348 +29 (+0.1%) 🔴
octane-jsx full_fw_raw 568,620 568,708 +88 (+0.0%) 🔴
octane-jsx full_fw_gzip 171,214 171,256 +42 (+0.0%) 🔴
octane-jsx full_fw_brotli 143,953 143,986 +33 (+0.0%) 🔴

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").

target metric head budget over
root-static brotli 45,596 45,579 +17
hydrate-root gzip 44,219 44,196 +23
hydrate-frame raw 366,104 365,796 +308
hydrate-frame gzip 113,537 113,469 +68
suspense-transition raw 141,591 140,222 +1,369
suspense-transition gzip 44,768 44,401 +367
suspense-transition brotli 39,293 39,132 +161
binding-base-ui-vite raw 199,790 198,414 +1,376
binding-base-ui-vite gzip 62,781 62,427 +354
binding-base-ui-vite brotli 54,502 54,383 +119
binding-base-ui-esbuild raw 215,315 213,931 +1,384
binding-base-ui-esbuild gzip 69,747 69,369 +378
binding-base-ui-esbuild brotli 60,479 60,247 +232
binding-radix-vite raw 201,825 200,448 +1,377
binding-radix-vite gzip 63,366 63,043 +323
binding-radix-vite brotli 55,095 54,923 +172
binding-radix-esbuild raw 217,139 215,755 +1,384
binding-radix-esbuild gzip 70,298 69,893 +405
binding-radix-esbuild brotli 61,053 60,813 +240
binding-mantine-hooks-vite gzip 28,398 28,396 +2
binding-apollo-client-vite raw 342,242 340,859 +1,383
binding-apollo-client-vite gzip 105,073 104,741 +332
binding-apollo-client-vite brotli 91,665 91,544 +121
binding-apollo-client-esbuild raw 365,458 364,070 +1,388
binding-apollo-client-esbuild gzip 116,087 115,728 +359
binding-apollo-client-esbuild brotli 101,330 101,084 +246
target metric base head Δ
cli-spa-starter raw 102,179 102,223 +44 (+0.0%) 🔴
cli-spa-starter gzip 33,980 34,024 +44 (+0.1%) 🔴
cli-spa-starter brotli 29,877 29,963 +86 (+0.3%) 🔴
root-static-specialized raw 72,693 72,734 +41 (+0.1%) 🔴
root-static-specialized gzip 23,820 23,853 +33 (+0.1%) 🔴
root-static-specialized brotli 21,295 21,303 +8 (+0.0%) 🔴
root-chained-jsx raw 74,571 74,612 +41 (+0.1%) 🔴
root-chained-jsx gzip 24,322 24,354 +32 (+0.1%) 🔴
root-chained-jsx brotli 21,732 21,762 +30 (+0.1%) 🔴
root-static raw 165,545 165,587 +42 (+0.0%) 🔴
root-static gzip 52,270 52,300 +30 (+0.1%) 🔴
root-static brotli 45,520 45,596 +76 (+0.2%) 🔴
root-static-local raw 72,692 72,733 +41 (+0.1%) 🔴
root-static-local gzip 23,802 23,839 +37 (+0.2%) 🔴
root-static-local brotli 21,290 21,299 +9 (+0.0%) 🔴
root-callback-local raw 74,597 74,638 +41 (+0.1%) 🔴
root-callback-local gzip 24,332 24,358 +26 (+0.1%) 🔴
root-callback-local brotli 21,750 21,772 +22 (+0.1%) 🔴
hooks-state raw 84,414 84,455 +41 (+0.0%) 🔴
hooks-state gzip 27,786 27,811 +25 (+0.1%) 🔴
hooks-state brotli 24,725 24,764 +39 (+0.2%) 🔴
prop-attributes raw 84,668 84,709 +41 (+0.0%) 🔴
prop-attributes gzip 27,782 27,809 +27 (+0.1%) 🔴
prop-attributes brotli 24,753 24,805 +52 (+0.2%) 🔴
context raw 96,621 96,662 +41 (+0.0%) 🔴
context gzip 31,475 31,508 +33 (+0.1%) 🔴
context brotli 27,955 27,922 −33 (−0.1%) 🟢
hydrate-root raw 138,068 138,109 +41 (+0.0%) 🔴
hydrate-root gzip 44,176 44,219 +43 (+0.1%) 🔴
hydrate-root brotli 38,631 38,634 +3 (+0.0%) 🔴
deferred-hydration raw 221,365 221,406 +41 (+0.0%) 🔴
deferred-hydration gzip 69,679 69,735 +56 (+0.1%) 🔴
deferred-hydration brotli 60,118 60,119 +1 (+0.0%) 🔴
hydrate-frame raw 364,520 366,104 +1,584 (+0.4%) 🔴
hydrate-frame gzip 112,947 113,537 +590 (+0.5%) 🔴
hydrate-frame brotli 96,534 97,070 +536 (+0.6%) 🔴
suspense-transition raw 141,550 141,591 +41 (+0.0%) 🔴
suspense-transition gzip 44,727 44,768 +41 (+0.1%) 🔴
suspense-transition brotli 39,252 39,293 +41 (+0.1%) 🔴
component-owned-effects raw 77,056 77,097 +41 (+0.1%) 🔴
component-owned-effects gzip 25,152 25,196 +44 (+0.2%) 🔴
component-owned-effects brotli 22,483 22,496 +13 (+0.1%) 🔴
binding-hooks raw 82,913 82,955 +42 (+0.1%) 🔴
binding-hooks gzip 27,417 27,453 +36 (+0.1%) 🔴
binding-hooks brotli 24,498 24,533 +35 (+0.1%) 🔴
binding-base-ui-vite raw 199,748 199,790 +42 (+0.0%) 🔴
binding-base-ui-vite gzip 62,770 62,781 +11 (+0.0%) 🔴
binding-base-ui-vite brotli 54,452 54,502 +50 (+0.1%) 🔴
binding-base-ui-esbuild raw 215,268 215,315 +47 (+0.0%) 🔴
binding-base-ui-esbuild gzip 69,720 69,747 +27 (+0.0%) 🔴
binding-base-ui-esbuild brotli 60,516 60,479 −37 (−0.1%) 🟢
binding-radix-vite raw 201,779 201,825 +46 (+0.0%) 🔴
binding-radix-vite gzip 63,341 63,366 +25 (+0.0%) 🔴
binding-radix-vite brotli 54,997 55,095 +98 (+0.2%) 🔴
binding-radix-esbuild raw 217,092 217,139 +47 (+0.0%) 🔴
binding-radix-esbuild gzip 70,262 70,298 +36 (+0.1%) 🔴
binding-radix-esbuild brotli 61,037 61,053 +16 (+0.0%) 🔴
binding-mantine-hooks-vite raw 86,471 86,512 +41 (+0.0%) 🔴
binding-mantine-hooks-vite gzip 28,391 28,398 +7 (+0.0%) 🔴
binding-mantine-hooks-vite brotli 25,276 25,296 +20 (+0.1%) 🔴
binding-mantine-hooks-esbuild raw 90,840 90,885 +45 (+0.0%) 🔴
binding-mantine-hooks-esbuild gzip 30,510 30,543 +33 (+0.1%) 🔴
binding-mantine-hooks-esbuild brotli 27,152 27,233 +81 (+0.3%) 🔴
binding-apollo-client-vite raw 342,199 342,242 +43 (+0.0%) 🔴
binding-apollo-client-vite gzip 105,054 105,073 +19 (+0.0%) 🔴
binding-apollo-client-vite brotli 91,622 91,665 +43 (+0.0%) 🔴
binding-apollo-client-esbuild raw 365,411 365,458 +47 (+0.0%) 🔴
binding-apollo-client-esbuild gzip 116,033 116,087 +54 (+0.0%) 🔴
binding-apollo-client-esbuild brotli 101,228 101,330 +102 (+0.1%) 🔴
binding-usehooks-ts-vite raw 87,237 87,282 +45 (+0.1%) 🔴
binding-usehooks-ts-vite gzip 28,594 28,640 +46 (+0.2%) 🔴
binding-usehooks-ts-vite brotli 25,536 25,505 −31 (−0.1%) 🟢
binding-usehooks-ts-esbuild raw 91,608 91,653 +45 (+0.0%) 🔴
binding-usehooks-ts-esbuild gzip 30,750 30,786 +36 (+0.1%) 🔴
binding-usehooks-ts-esbuild brotli 27,384 27,421 +37 (+0.1%) 🔴

36 other measured values are unchanged.

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/octane/src/runtime.ts Resolved
Comment thread packages/octane/src/host-budget.ts Resolved
…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
trueadm added a commit that referenced this pull request Oct 8, 2026


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]>

@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 2 potential issues.

Fix All in Cursor

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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8b0be53. Configure here.

@trueadm
trueadm merged commit 247dffe into octanejs:main Oct 8, 2026
31 of 34 checks passed
trueadm added a commit that referenced this pull request Oct 8, 2026
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]>
trueadm added a commit that referenced this pull request Oct 8, 2026
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]>
trueadm added a commit that referenced this pull request Oct 8, 2026
… 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]>
trueadm added a commit that referenced this pull request Oct 8, 2026
…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]>
trueadm added a commit that referenced this pull request Oct 8, 2026
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]>
trueadm added a commit that referenced this pull request Oct 8, 2026
* 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]>
trueadm added a commit that referenced this pull request Oct 8, 2026
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]>
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 fix PR: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants