Skip to content

perf: reuse consecutive fixed-style rollback snapshots - #1157

Merged
domgan-oai merged 1 commit into
octanejs:mainfrom
openai-oss-forks:codex/perf-fixed-style-journal-20260919
Sep 19, 2026
Merged

domgan-oai merged 1 commit into
octanejs:mainfrom
openai-oss-forks:codex/perf-fixed-style-journal-20260919

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Updating six changed fixed-key style declarations now takes one whole-style rollback snapshot for that host within a render checkpoint, matching the equivalent opaque style object's snapshot count. The six CSS declaration writes and binding-bag journal entries remain.

Tracks #1130 §2.6. This is an operation reduction; it does not close the remaining generic bundle or prospective metadata regressions.

Changes

  • Reuse only an immediately preceding same-host style snapshot within the current checkpoint, with at most one hop over the current binding bag's four-slot journal record.
  • Preserve intervening attribute writes, other hosts/bags, CSS coercion order, staged rendering, and abandoned-render restoration without new fields, maps, or lifetimes.
  • Add public rollback/adoption/coercion/native-preparation controls and a development/production fixed-versus-opaque operation guard wired into ci:workflow:test.

Evidence

Matched against base 0b48d5d0723b669eee1a903fcefe99f2a88de4f9, using the same compiler, frozen consumer inputs, lockfile, Node 24.19.0, and esbuild 0.28.1:

  • Native Chromium: fixed-key style snapshots 6 → 1; opaque control stays 1; both still write all 6 declarations. All eight base/candidate × dev/prod × fixed/opaque lanes preserve CSS, host/input identity, trusted-input draft, focus/caret, and cleanup with empty pre-navigation console/page-error capture.
  • 100-host public operation guard: Happy DOM style reads 1,200 → 700, matching the opaque control at 700 in development and production. Its setter-internal reads are shared by both controls.
  • Production operation consumer: +123 raw / +85 gzip bytes. Of 15 public closure controls, 14 are SHA-identical, including generic root, engine, SSR, binding capabilities, streamed bootstrap, and pure native application. A real signal application also using fixed-key scalar styles adds +123 raw / +75 gzip bytes and preserves model/DOM/cleanup behavior.
  • Host-check omission fails 4 public cases; attribute-name-check omission fails 8. Exact candidate source restored before final validation. No checkpoint-omission RED was established; that bound is retained as a defensive invariant, not counted as mutant evidence.

The checked-in report is benchmarks/scoped-signals/fixed-style-journal.md. This is a source-selected public-compiler/esbuild Chromium proof, not a Vite/Rspack build or CPU improvement claim.

Validation

  • Targeted frozen-AST/location-asserted runtime, events during mutation, style, Suspense, transition, native staging, direct binding, and Action tests: 746/746, 22 files, dev/prod/signals projects.
  • pnpm run ci:workflow:test: 214/214, 13 suites, including both new operation guards.
  • New public rollback suite against unchanged base: 24/24 pass; new operation guard against base: 2/2 fail, then pass with the candidate.
  • Eight native Chromium lanes and four matched real-signal application smokes.
  • Scoped typecheck and formatting; changeset validation; pnpm sync; git diff --check.
  • Repository-wide pnpm test, pnpm typecheck, and pnpm format:check were not run locally.
  • Full current-head GitHub CI (26/26 jobs) and Bugbot pass at signed a11c32dd9796c33bf8940c758cbb38e789918399; PR is ready and mergeable.

Risk / follow-up

Snapshot reuse is deliberately bounded to the journal tail and current checkpoint; it never combines declarations or changes coercion order. The checkpoint omission has no established public failing mutant because authored component bodies are entered after a JOURNAL_RENDER barrier. No claim is made that this eliminates all style journaling or unused-signal metadata cost.

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 transition-journal rollback for inline style updates in the client runtime; behavior is tightly scoped but affects DOM restoration on abandoned renders and errors.

Overview
Reuses one whole-style rollback snapshot when multiple fixed-key inline declarations update the same element in a single render checkpoint, instead of snapshotting the live attribute on every declaration (e.g. six snapshots → one, matching an opaque style={object} control). Declaration writes and binding-bag journal entries are unchanged.

In setStyleProperty, transition journaling now inspects the journal tail: it may skip a redundant journalAttr(el, 'style') only when the immediately prior record is the same host and 'style' within the current checkpoint (optionally stepping back one current-scope JOURNAL_BAG slot). Other hosts, intervening writes, earlier checkpoints, coercion order, staged DOM, and abandoned/suspended renders stay isolated.

Adds a fixed vs opaque operation guard (benchmarks/scoped-signals/fixed-style-journal.*) wired into ci:workflow:test, a benchmark write-up, an octane patch changeset, and a public rollback suite (style-transaction-rollback.test.ts) for suspense, coercion failures, reentrancy, SSR hydration, and view-transition preparation.

Reviewed by Cursor Bugbot for commit a11c32d. 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 perf PR: performance work labels Sep 19, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review September 19, 2026 19:33
@domgan-oai
domgan-oai merged commit 068ead5 into octanejs:main Sep 19, 2026
52 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 perf PR: performance work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant