Repository navigation
Conversation
domgan-oai
marked this pull request as ready for review
August 10, 2026 13:16
95 tasks done
jonkwheeler
added a commit
to jonkwheeler/octane
that referenced
this pull request
Aug 10, 2026
Restore autoMemo LocalHazards from main (dropped by earlier merges) while keeping descriptorChildren bindings/lowering, and take octanejs#684 returned-JSX wall-B memoization. Co-authored-by: Cursor <[email protected]>
9 tasks done
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
Refs #673
Why
Returned JSX already cached wall B's derived descriptor array, but recreated its surrounding scoped host descriptor every render. Equal and context-only updates consequently performed 1,000 keyed survivor visits and 1,000 shallow memo comparisons even when the rows were unchanged.
Changes
Performance
Equal updates are approximately 188× faster. Context updates still refresh exactly 1,000 leaves, changed updates still reconcile the changed row, and context-restamping remains zero. The eligible fixture grows by 237 gzip bytes; unrelated production bundles and the fixed 16-file codegen corpus are byte-identical.
Validation
pnpm syncpnpm format:files:checkon all eight changed files.pnpm --config.enable-pre-post-scripts=false run typecheck— complete workspace TypeScript body; unrelated optional pretypecheck disabled.pnpm exec vitest run --project octane --project octane-prod --silent=passed-only— 804 files / 11,681 tests passed.node benchmarks/codegen-size/run.mjs— fixed corpus unchanged.Risk / follow-ups
Provenance
agent-authored)Note
Medium Risk
Changes compiler lowering and provider child reconciliation for a gated optimization path; incorrect admission could skip updates or break context/hydration, though fallbacks and extensive behavioral gates limit blast radius.
Overview
Returned-JSX wall B no longer rebuilds and reconciles 1000 unchanged
memo(Row)descriptors on equal or context-only parent updates. The compiler now threads auto-calculated renderable-array provenance through returned-JSX lowering (setup statements only, not the return root) and, for a narrow<Context.Provider value={…}><host>{rows}</host></Context.Provider>shape, wraps the scoped provider’sreadChildreninuseMemo+compilerCacheArraywhenrowsis a proven non-escaping calculation.Eligibility is gated at runtime by
compilerOwnsContextProvider, which checks whether the provider value is already inCURRENT_SCOPE.$$ctxValueswithout re-reading.Provideror user getters/proxies. Ineligible patterns (customProvidercomponents, escaped/mutated arrays, accessors, deferreduse(), etc.) keep the old path.Memo-wall docs and
work.mjsnow expect zero keyed survivors and zeroshallowEqualPropsfor JSX wall-B equal/context ops (TSRX-aligned), with upper ceilings on wrappercreateElementcounts. JSX work builds can disable minification viaMEMO_WALL_WORK=1like TSRX. A largeauto-memo.test.tsblock covers descriptors, hydration, context, refs, effects, and hostile providers.Reviewed by Cursor Bugbot for commit 7871550. Bugbot is set up for automated code reviews on this repo. Configure here.