Repository navigation
perf: re-land record/commit codegen trims from next (#2157) - #2226
Merged
Merged
Conversation
#2157 merged into `next` as 32dc7f1 after `next` had already landed on main (#2103), so its compiled-output saving never shipped. Cherry-picked onto main; the one conflict kept main's bagOf rehome argument in the spill path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm
marked this pull request as ready for review
October 23, 2026 18:34
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website | 62fb65b | Commit Preview URL Branch Preview URL |
Oct 23 2026, 06:37 PM |
Contributor
|
Found 1 test failure on Blacksmith runners: Failure
|
Contributor
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)
2 other measured values are unchanged. Public-import reachability bundles (bytes)
39 other measured values are unchanged. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website-mcp | 62fb65b | Commit Preview URL Branch Preview URL |
Oct 23 2026, 06:35 PM |
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.
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Summary
main. It merged intonexton 2026-10-19 as32dc7f1bd0, afternexthad already landed on main through refactor: integrate next runtime redesign #2103 and been deleted, so main still emits the old commit prologue (const _n = _b.next; … _b.$ &= 255) andbagDone(__s, _b, _c$N).1994fd2c72,becfc77d0d,fa711540ff).Why
Changes
bagDone, the newcommitQueuedBagop, the inlined ops loop) clear bag state and pass the cells toC(bag, cells, careful);bagDonedrops its commit-function argument;sibling()omits its default step; byte-identical commit functions share one declaration in production builds, with source origins aliased; queued bags are identified by their commit op rather than a target's$.compile.js's_$bagOfspill path now returns fromfactoryLine(perf: trim record/commit codegen boilerplate #2157's shape) and keeps main's rehome argument (bag.hosts.has('__block.parentNode') ? [1] : []).Other PRs stranded on the deleted
nextgit merge-base --is-ancestor <merge sha> origin/mainfor every PR merged intonextafter the #2103 snapshot (e326ff4007):32dc7f1bd0424e5cc1fa2af686ebd7#2162 and #2165 are not re-landed here.
Validation
pnpm typecheck: greenpnpm format:files:checkon the changed files: greenpnpm test: not run locally (left to CI)commit-functions,compiler-template-origins,view-transition-scope-commit(85/85), plus 24 commit/bag/journal/event test files (254/254)view-transition-scope-commit.test.ts, "commits a host carrying an application$"): reverting the ops loop totypeof target?.$ === 'number'fails all 8 casescompiler-template-origins.test.ts, "aliases a repeated binding onto the commit code it shares in production"): disablingaliasSharedOriginsfails itf47ddbf2b2→ head: compiled gzip 43,875 → 42,848 (−1,027 B, −2.34%), minified 139,983 → 133,073 (−4.94%), raw −4.06%; every sentinel row shrinks 1–3%. (Measured with the Rspack void-root sentinel skipped: it asserts "hydrate: hydration replaced DOM" locally on unmodified origin/main too.)pair.mjs --work-only, base = origin/main): all 40calls_*/dom_*counters equal base.perf-review:node scripts/perf-review-scan.mjs→ no candidates. Hot paths:bagRecord(per changed binding),bagDone(per committed template), commitRootRenders' ops loop (per queued entry); each does the same calls as before (work counters equal), and the ops loop now compares op identity instead of readingtarget.$. Compiled output: commit functions take(_b, _n[, _f]); no new runtime imports. No must-fix findings.concise-code: a re-land of an already-reviewed diff; the only new authored code is the conflict merge, which keeps main's existing rehome argument.Risk / follow-ups
fw_*rows grow ~+106 B raw / +24–69 B gzip from the runtime-side state clearing, outweighing the savings in these few-template apps (the trade-off perf: trim record/commit codegen boilerplate #2157 recorded; bytes are report-only). The win is per-template, so it scales with template count (corpus −2.3% gzip).bagDonearity. Same risk profile as perf: trim record/commit codegen boilerplate #2157.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Runtime and compiler must ship together (new
bagDonearity and commit signature). Commit-queue identification changed from bag heuristics to op identity, affecting transition drop and error routing paths.Overview
Re-lands record/commit codegen trims: smaller compiled output and a tighter bag commit protocol.
Runtime: Hoisted commit functions are now
C(bag, cells, careful);bagDoneand queued commits clear the bag’s staged state and pass the cell array instead of each commit function reading_b.nextand masking_b.$.bagDonedrops its commit-function argument. Queued template bags are identified by a dedicatedcommitQueuedBagop in the root ops queue, not by probingtarget.$(so DOM hosts with app-owned$expandos stay safe).Compiler: Production builds dedupe byte-identical commit functions per module (dev/HMR/profile keep one per template) and alias inspect origins for shared bodies. Bag factory emission is deferred until the commit name is known;
sibling()calls omit the second argument when the step count is 1.Tests cover shared-commit isolation, production origin aliasing, and commit-queue behavior on hosts carrying
$.Reviewed by Cursor Bugbot for commit 62fb65b. Bugbot is set up for automated code reviews on this repo. Configure here.