Repository navigation
perf: preserve private Context proofs across split templates - #1160
Merged
domgan-oai merged 2 commits intoSep 19, 2026
Merged
domgan-oai merged 2 commits into
domgan-oai merged 2 commits into
Conversation
domgan-oai
marked this pull request as ready for review
September 19, 2026 20:17
This was referenced Sep 19, 2026
8 of 9 tasks
This was referenced Sep 19, 2026
4 of 5 tasks
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
Preserve the production compiler's existing closed-module Context lifetime proof through compiler-owned split Hydrate capture modules. Exact original provider tags and generated capture binding IDs keep private providers on the existing compiled output path; exported, escaped, shadowed or authored-override identities retain general rendering. No runtime or public ABI changes.
Against measured main
068ead53d23feeaae0a6d8b2bf3bb3fad5eb4499(landed #1155/#1157), the same complete button-only consumer shrinks from 92,428 to 65,715 gzip bytes (-26,713). Its values, native update identity and mount/cleanup match. All seven stock/export and fifteen public/model/SSR/used-signal controls have identical bundle SHA and raw/gzip/Brotli bytes. The matched predecessor incorporates docs-only main95e6674e2d1d2c485e7a80bb16ff3126e6e92aa5. Main95’s 204 Octane source files, package.json and lock are identical to measured main068; candidate files match the validated immutable candidate snapshot. The committed report pins fixtures, sources, toolchain, runners, public results and limitations.Validation
pnpm format:check(repository-wide not run locally)pnpm typecheck(repository-wide not run locally)pnpm test(repository-wide not run locally)ci:workflow:test218 Node results..tsrxtypes, changed-file formatting, changeset and sync checks. No generated/unrelated diff.The PR is ready for review; latest-head full CI is tracked below. The throwaway Git-fixture workflow tests used process-scoped signing disablement only for fixture commits; no authored commit/config uses that override.
The initial full main068 run passed 135/136, missing the dev nested provider's inner text after update. The unchanged isolated case passed both projects, then one unchanged full rerun passed 136/136. No source/assertion/deadline changed. That exact fixture's dev/HMR object-registry parent and five sidecars are byte-identical between base/patch, and the selected runtime hashes match; this does not establish the cause of the initial loaded-run failure.
Risk / follow-ups
This addresses an exact closed Context capture seam; it does not certify arbitrary imported components or eliminate all unused-signal/generic renderer bytes. A historical main0b shared imported Reader control retained a separate
componentSlot(Reader)edge and saved only 62 gzip bytes; it was not repeated on main068. Before #1155 landed, the same fixture's Context-only patch on main929 saved 30 gzip; the material measured delta uses the now-landed Hydrate policy.The extra original-lifetime proof adds compiler analysis. A historical main0b 12-pair sample observed parent+query medians 9.092→10.298ms / 13.756→14.806ms on two actual Context corpora, with paired ratios1.059/1.033 and IQRs crossing1. No current-base CPU speedup or zero-cost claim. Ordinary Vitest scalar→handle and nested identity assertions also fail on unchanged-main controls; source-selected bundled/native identity proof is reported separately, with no runtime workaround.
Related to #1118 and the unused-signal/generic graph discussion in #1130; this does not close the compound checklist.
Current base and CI
Signed normal merge
d630679ec49f4846a17e4c2a692b77aab162d823includes live main40ff19fcf39839714f02f2dc6bfa9e9fbd2f38cd(landed SSR Frame fix #1152). Both the incoming SSR guard and this PR’s own guard list are preserved without duplicates. Refreshed local checks pass: 18 public cases, 220 actual workflow guards, scoped package formatting, changesets,pnpm syncand diff checks. All 204 source hashes are stable; incomingruntime.server.tsis exactly main40ff, and this PR’s existing client/compiler patch is unchanged. No new byte or CPU claim is made by this merge. Full current-head CI run 35467472675 passes (26 successful jobs). Current-head Bugbot passes; no unresolved review threads.Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Compiler-only but changes Context provider codegen on split-hydration paths; incorrect certification could mis-route providers, though proofs are narrowly gated and heavily tested.
Overview
Extends the production compiler so closed-module private
Contextproofs still apply after<Hydrate>splits a child module. During boundary extraction it re-derives the original lifetime proof, records generated capture binding IDs for provider tags moved into capture slots, and only then routes those providers through the existing__createCompiledContext/componentSlotVoidpath when lexical resolution matches the original binding.Exported, escaped, shadowed, or override-heavy contexts (e.g. authored
children, spreads,__*attrs, dev/HMR/server modes) stay on genericcomponentSlotrendering—no runtime or public ABI changes.Adds benchmark fixtures, a size-audit runner, boundary Node tests (wired into
ci:workflow:test), hydration Vitest coverage, pinned evidence/report for the closed split consumer (~−27KB gzip with unchanged semantics), and a patch changeset.Reviewed by Cursor Bugbot for commit d630679. Bugbot is set up for automated code reviews on this repo. Configure here.