Skip to content

fix: propagate context updates through lightweight memo scopes - #1696

Merged
trueadm merged 5 commits into
octanejs:mainfrom
mikamikasuki:fix/memo-context-lite-scopes
Oct 4, 2026
Merged

trueadm merged 5 commits into
octanejs:mainfrom
mikamikasuki:fix/memo-context-lite-scopes

Conversation

@mikamikasuki

@mikamikasuki mikamikasuki commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Validation

  • pnpm sync
  • pnpm format:check — ran the targeted pnpm format:files:check instead; it passed.
  • pnpm typecheck — ran the targeted pnpm typecheck:files instead; it passed.
  • pnpm test — the complete Vitest tree was run directly, but the single-command run began before Playwright Chromium was installed.
  • targeted tests:
    • The new regression failed before the fix in both development and production projects; after the fix, both passed.
    • Related context/activity/hydration tests: 106 passed.
    • Full Octane tree before Chromium installation: 1,508 files and 41,803 tests passed; 455 browser tests could not launch because Chromium was absent.
    • After installing the repository-matched Chromium, all 31 browser files and 455 tests passed. An earlier browser run hit one transient Vite 504 Outdated Optimize Dep; the affected file passed alone (6/6), and the full browser rerun passed.
    • pnpm format:files:check, pnpm typecheck:files, and git diff --check passed.

Risk / follow-ups

  • Context bailout refresh now walks lightweight child scopes using the existing subtree taxonomy. The change adds memo ancestry to lightweight block metadata; CI and review should watch for runtime or allocation regressions.

Provenance

  • An agent produced this diff (agent-authored)

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


Note

Medium Risk
Changes memo-bailout context refresh in the core runtime using a broader subtree walk; behavior is covered by new tests but touches update scheduling for context consumers.

Overview
Fixes lazy context propagation when a memo boundary bails on props but descendants still consume an updated provider: context refresh now walks the tree with the shared forEachSubtreeChild path instead of only iterating _slots on the memo block.

LiteBlockImpl inherits memoInChain from its parent block so hookless lightweight scopes keep correct memo ancestry during that walk. A new refreshContextSubtree step treats real blocks as context refresh targets and recurses through lightweight scopes (where scope !== block) so consumers under nested lite components are no longer skipped.

Adds a regression fixture covering retained Activity children with and without memo, asserting updated context text without replacing DOM nodes.

Reviewed by Cursor Bugbot for commit 150b57a. 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 4, 2026
@mikamikasuki
mikamikasuki marked this pull request as ready for review October 4, 2026 12:55
@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🟡 js-framework: 1 timed operation(s) slower beyond ±3%
  • 🔴 bundle-size: 23 value(s) increased within budget
  • 🔴 bundle-reachability: 36 value(s) increased within budget

Compares 78ec8326a, the merge commit's first parent with f89e7cbc3 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

target operation base ms head ms head/base 95% CI
octane-tsrx select_lots 0.006 0.007 +9.9% +8.7% … +10.8% 🟡 slower
All 20 timed operations (19 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 3.342 3.167 ±0.0% −6.3% … +3.1% ⚪ within noise
octane-tsrx replace 6.217 6.633 ±0.0% −2.3% … +4.9% ⚪ within noise
octane-tsrx add 2.742 2.758 ±0.0% −3.5% … ±0.0% ⚪ within noise
octane-tsrx update 0.125 0.126 +0.3% −1.3% … +2.5% ⚪ within noise
octane-tsrx select 0.006 0.006 −0.5% −0.6% … +0.3% ⚪ within noise
octane-tsrx swap 0.040 0.041 +0.4% −0.7% … +1.1% ⚪ within noise
octane-tsrx remove 0.020 0.020 −0.3% −2.5% … +1.9% ⚪ within noise
octane-tsrx runlots 28.275 28.433 +0.2% −2.0% … +5.0% ⚪ within noise
octane-tsrx select_lots 0.006 0.007 +9.9% +8.7% … +10.8% 🟡 slower
octane-tsrx clear 48.433 47.958 −2.4% −4.1% … +0.4% ⚪ within noise
octane-jsx run 3.867 3.833 +1.2% −5.1% … +7.5% ⚪ within noise
octane-jsx replace 7.708 7.492 −3.3% −6.6% … +2.6% ⚪ within noise
octane-jsx add 3.608 3.633 ±0.0% −2.6% … +2.8% ⚪ within noise
octane-jsx update 0.258 0.260 +0.0% −0.4% … +1.1% ⚪ within noise
octane-jsx select 0.140 0.142 +0.8% −0.3% … +5.7% ⚪ within noise
octane-jsx swap 0.246 0.251 −0.3% −1.2% … +1.8% ⚪ within noise
octane-jsx remove 0.187 0.186 −0.0% −0.6% … +0.9% ⚪ within noise
octane-jsx runlots 31.450 31.700 −1.3% −2.5% … ±0.0% ⚪ within noise
octane-jsx select_lots 1.587 1.608 +0.8% −0.0% … +2.2% ⚪ within noise
octane-jsx clear 53.625 52.858 −0.7% −2.3% … +0.9% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx js_raw 125,664 125,695 +31 (+0.0%) 🔴
octane-tsrx js_gzip 41,548 41,554 +6 (+0.0%) 🔴
octane-tsrx js_brotli 36,670 36,694 +24 (+0.1%) 🔴
octane-tsrx app_gzip 2,562 2,563 +1 (+0.0%) 🔴
octane-tsrx app_brotli 2,224 2,230 +6 (+0.3%) 🔴
octane-tsrx fw_raw 118,152 118,183 +31 (+0.0%) 🔴
octane-tsrx fw_gzip 38,986 38,991 +5 (+0.0%) 🔴
octane-tsrx fw_brotli 34,446 34,464 +18 (+0.1%) 🔴
octane-tsrx todo_js_raw 141,141 141,172 +31 (+0.0%) 🔴
octane-tsrx todo_js_gzip 46,609 46,618 +9 (+0.0%) 🔴
octane-tsrx todo_js_brotli 40,895 40,920 +25 (+0.1%) 🔴
octane-tsrx todo_app_brotli 2,117 2,120 +3 (+0.1%) 🔴
octane-tsrx todo_fw_raw 136,031 136,062 +31 (+0.0%) 🔴
octane-tsrx todo_fw_gzip 44,132 44,141 +9 (+0.0%) 🔴
octane-tsrx todo_fw_brotli 38,778 38,800 +22 (+0.1%) 🔴
octane-tsrx chat_js_raw 140,261 140,292 +31 (+0.0%) 🔴
octane-tsrx chat_js_gzip 46,549 46,553 +4 (+0.0%) 🔴
octane-tsrx chat_js_brotli 40,951 40,978 +27 (+0.1%) 🔴
octane-tsrx chat_app_gzip 2,979 2,978 −1 (−0.0%) 🟢
octane-tsrx chat_app_brotli 2,638 2,636 −2 (−0.1%) 🟢
octane-tsrx chat_fw_raw 133,608 133,639 +31 (+0.0%) 🔴
octane-tsrx chat_fw_gzip 43,570 43,575 +5 (+0.0%) 🔴
octane-tsrx chat_fw_brotli 38,313 38,342 +29 (+0.1%) 🔴
octane-tsrx weather_js_raw 177,239 176,939 −300 (−0.2%) 🟢
octane-tsrx weather_js_gzip 57,986 57,925 −61 (−0.1%) 🟢
octane-tsrx weather_js_brotli 50,398 50,383 −15 (−0.0%) 🟢
octane-tsrx weather_app_gzip 9,033 9,034 +1 (+0.0%) 🔴
octane-tsrx weather_app_brotli 7,574 7,567 −7 (−0.1%) 🟢
octane-tsrx weather_fw_raw 150,560 150,260 −300 (−0.2%) 🟢
octane-tsrx weather_fw_gzip 48,953 48,891 −62 (−0.1%) 🟢
octane-tsrx weather_fw_brotli 42,824 42,816 −8 (−0.0%) 🟢
octane-tsrx bindings_js_raw 720,011 719,711 −300 (−0.0%) 🟢
octane-tsrx bindings_js_gzip 240,871 240,799 −72 (−0.0%) 🟢
octane-tsrx bindings_js_brotli 205,103 204,962 −141 (−0.1%) 🟢
octane-tsrx bindings_app_gzip 121,728 121,718 −10 (−0.0%) 🟢
octane-tsrx bindings_app_brotli 101,740 101,699 −41 (−0.0%) 🟢
octane-tsrx bindings_fw_raw 364,090 363,790 −300 (−0.1%) 🟢
octane-tsrx bindings_fw_gzip 119,143 119,081 −62 (−0.1%) 🟢
octane-tsrx bindings_fw_brotli 103,363 103,263 −100 (−0.1%) 🟢
octane-jsx js_raw 228,256 227,956 −300 (−0.1%) 🟢
octane-jsx js_gzip 72,893 72,858 −35 (−0.0%) 🟢
octane-jsx js_brotli 63,197 63,047 −150 (−0.2%) 🟢
octane-jsx app_brotli 2,500 2,503 +3 (+0.1%) 🔴
octane-jsx fw_raw 219,797 219,497 −300 (−0.1%) 🟢
octane-jsx fw_gzip 69,958 69,923 −35 (−0.1%) 🟢
octane-jsx fw_brotli 60,697 60,544 −153 (−0.3%) 🟢

8 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
cli-spa-starter raw 115,461 115,492 +31 (+0.0%) 🔴
cli-spa-starter gzip 38,996 39,001 +5 (+0.0%) 🔴
cli-spa-starter brotli 34,107 34,113 +6 (+0.0%) 🔴
root-static-specialized raw 77,362 77,393 +31 (+0.0%) 🔴
root-static-specialized gzip 25,710 25,717 +7 (+0.0%) 🔴
root-static-specialized brotli 22,915 22,944 +29 (+0.1%) 🔴
root-chained-jsx raw 84,690 84,721 +31 (+0.0%) 🔴
root-chained-jsx gzip 28,040 28,052 +12 (+0.0%) 🔴
root-chained-jsx brotli 24,971 24,972 +1 (+0.0%) 🔴
root-static raw 204,479 204,179 −300 (−0.1%) 🟢
root-static gzip 65,112 65,019 −93 (−0.1%) 🟢
root-static brotli 56,453 56,459 +6 (+0.0%) 🔴
root-static-local raw 77,365 77,396 +31 (+0.0%) 🔴
root-static-local gzip 25,700 25,704 +4 (+0.0%) 🔴
root-static-local brotli 22,901 22,971 +70 (+0.3%) 🔴
hooks-state raw 89,425 89,456 +31 (+0.0%) 🔴
hooks-state gzip 29,709 29,715 +6 (+0.0%) 🔴
hooks-state brotli 26,427 26,466 +39 (+0.1%) 🔴
prop-attributes raw 96,039 96,070 +31 (+0.0%) 🔴
prop-attributes gzip 31,831 31,837 +6 (+0.0%) 🔴
prop-attributes brotli 28,333 28,286 −47 (−0.2%) 🟢
context raw 109,520 109,220 −300 (−0.3%) 🟢
context gzip 36,232 36,155 −77 (−0.2%) 🟢
context brotli 32,086 32,041 −45 (−0.1%) 🟢
hydrate-root raw 173,662 173,693 +31 (+0.0%) 🔴
hydrate-root gzip 55,132 55,139 +7 (+0.0%) 🔴
hydrate-root brotli 48,099 48,106 +7 (+0.0%) 🔴
deferred-hydration raw 237,012 236,712 −300 (−0.1%) 🟢
deferred-hydration gzip 74,946 74,842 −104 (−0.1%) 🟢
deferred-hydration brotli 64,667 64,582 −85 (−0.1%) 🟢
suspense-transition raw 165,468 165,168 −300 (−0.2%) 🟢
suspense-transition gzip 53,139 53,044 −95 (−0.2%) 🟢
suspense-transition brotli 46,531 46,449 −82 (−0.2%) 🟢
component-owned-effects raw 81,878 81,909 +31 (+0.0%) 🔴
component-owned-effects gzip 26,995 27,001 +6 (+0.0%) 🔴
component-owned-effects brotli 24,118 24,053 −65 (−0.3%) 🟢
binding-hooks raw 87,941 87,972 +31 (+0.0%) 🔴
binding-hooks gzip 29,447 29,452 +5 (+0.0%) 🔴
binding-hooks brotli 26,213 26,228 +15 (+0.1%) 🔴
binding-base-ui-vite raw 214,739 214,439 −300 (−0.1%) 🟢
binding-base-ui-vite gzip 68,699 68,641 −58 (−0.1%) 🟢
binding-base-ui-vite brotli 59,607 59,494 −113 (−0.2%) 🟢
binding-base-ui-esbuild raw 212,677 212,389 −288 (−0.1%) 🟢
binding-base-ui-esbuild gzip 68,625 68,543 −82 (−0.1%) 🟢
binding-base-ui-esbuild brotli 59,530 59,489 −41 (−0.1%) 🟢
binding-radix-vite raw 216,655 216,355 −300 (−0.1%) 🟢
binding-radix-vite gzip 69,228 69,172 −56 (−0.1%) 🟢
binding-radix-vite brotli 60,084 59,984 −100 (−0.2%) 🟢
binding-radix-esbuild raw 214,552 214,264 −288 (−0.1%) 🟢
binding-radix-esbuild gzip 69,224 69,152 −72 (−0.1%) 🟢
binding-radix-esbuild brotli 60,101 60,027 −74 (−0.1%) 🟢
binding-mantine-hooks-vite raw 96,522 96,553 +31 (+0.0%) 🔴
binding-mantine-hooks-vite gzip 32,030 32,035 +5 (+0.0%) 🔴
binding-mantine-hooks-vite brotli 28,475 28,500 +25 (+0.1%) 🔴
binding-mantine-hooks-esbuild raw 96,125 96,156 +31 (+0.0%) 🔴
binding-mantine-hooks-esbuild gzip 32,176 32,182 +6 (+0.0%) 🔴
binding-mantine-hooks-esbuild brotli 28,641 28,607 −34 (−0.1%) 🟢
binding-apollo-client-vite raw 359,706 359,406 −300 (−0.1%) 🟢
binding-apollo-client-vite gzip 112,747 112,656 −91 (−0.1%) 🟢
binding-apollo-client-vite brotli 98,408 98,360 −48 (−0.0%) 🟢
binding-apollo-client-esbuild raw 362,631 362,343 −288 (−0.1%) 🟢
binding-apollo-client-esbuild gzip 114,965 114,896 −69 (−0.1%) 🟢
binding-apollo-client-esbuild brotli 100,214 100,163 −51 (−0.1%) 🟢
binding-usehooks-ts-vite raw 97,303 97,334 +31 (+0.0%) 🔴
binding-usehooks-ts-vite gzip 32,280 32,285 +5 (+0.0%) 🔴
binding-usehooks-ts-vite brotli 28,737 28,710 −27 (−0.1%) 🟢
binding-usehooks-ts-esbuild raw 96,891 96,922 +31 (+0.0%) 🔴
binding-usehooks-ts-esbuild gzip 32,421 32,428 +7 (+0.0%) 🔴
binding-usehooks-ts-esbuild brotli 28,807 28,840 +33 (+0.1%) 🔴

36 other measured values are unchanged.

trueadm added a commit that referenced this pull request Oct 4, 2026
…opes (#1709)

Budget-only raise for #1696, which fixes #1695. LiteBlockImpl now copies its
parent's memoInChain, adding 31 raw bytes to every bundle that mounts a
lightweight component. Each raised value is #1696's measured bytes on its head
merged with main 77504c1, plus the usual headroom.

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 4, 2026
Main took #1709, which raised the same app budgets for #1696. Re-measure
#1702 on its head da7c31d (merged with main c16fe6d), and keep
#1709's reservation for #1696 on top of measured + 32, so the two fixes
can land in either order. chat.framework.brotli no longer needs a raise.

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 and removed agent-authored Diff or issue body substantially produced by an AI agent labels Oct 4, 2026
trueadm added a commit that referenced this pull request Oct 4, 2026
…1711)

* ci(bench): raise app byte budgets for the superseded pending arm fix

Budget-only raise for #1702, which fixes #1698. Each raised value is the
measured production bytes on #1702's head f028149 (merged with main
77504c1) plus the usual headroom: 32 raw and gzip, 256 brotli. Only
the 17 breached values move.

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

* ci(bench): re-measure the superseded pending arm budgets on current main

Main took #1709, which raised the same app budgets for #1696. Re-measure
#1702 on its head da7c31d (merged with main c16fe6d), and keep
#1709's reservation for #1696 on top of measured + 32, so the two fixes
can land in either order. chat.framework.brotli no longer needs a raise.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
@trueadm
trueadm merged commit 252ad4f into octanejs:main Oct 4, 2026
32 checks passed
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.

Memo skips descendant context updates through lightweight component scopes

2 participants