Skip to content

fix: avoid false async warm plans for synchronous prop reads - #679

Merged
trueadm merged 2 commits into
octanejs:mainfrom
openai-oss-forks:fix/673-avoid-false-async-warm-plans
Aug 10, 2026
Merged

trueadm merged 2 commits into
octanejs:mainfrom
openai-oss-forks:fix/673-avoid-false-async-warm-plans

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Teach same-module async reachability to recognize flat props destructuring, aliased destructuring, and direct prop reads when each JSX edge supplies the required keys as compiler-owned own-data properties.
  • Keep genuine async descendants, imported/opaque components, missing or inherited keys, getters, spreads, defaults/rest patterns, prototype-sensitive keys, reassigned props, and shadowed bindings on their existing conservative paths.
  • Add consumer-visible Suspense regressions and strengthen the existing production component-chain benchmark without changing its output or weakening any work ceilings.

Part of #673: P0 — Avoid false asynchronous warm plans. This PR does not close the broader tracking issue.

Why

Previously, a synchronous prop-reading child was conservatively treated as potentially asynchronous. Its parent emitted an empty warm batch and eagerly evaluated child props even when the child had no async plan. With an earlier suspended sibling, a Proxy-backed prop getter ran twice before the child was actually reached.

The new proof is attached to each JSX call site rather than assuming a component's props are globally safe. Async reachability still propagates transitively, and server/universal warming behavior is unchanged.

Performance

Existing production-browser work gate, with equivalent rendered output:

Scenario Warm registrations before Warm registrations after
Mount 100 0
Shallow update 92 0
Middle update 42 0
Deep update 2 0
Batched update 92 0

The realistic 100-component fixture shrank from 70,799 to 52,101 generated bytes. The independent 16-file fixed corpus improved by 808 raw bytes, 363 minified bytes, and 44 gzip bytes.

Validation

  • pnpm sync
  • pnpm format:check
  • pnpm typecheck — its unrelated Solana pretypecheck cannot run in this worktree because a required uncached registry package returns HTTP 403.
  • pnpm --config.enable-pre-post-scripts=false run typecheck — the complete root typecheck body passed; only that unrelated prehook was skipped.
  • pnpm test — the entire monorepo suite was not run.
  • pnpm exec vitest run --project octane --project octane-prod --silent=passed-only — 788 files / 11,283 tests passed.
  • pnpm exec vitest run packages/octane/tests/parallel-use.test.ts packages/octane/tests/ssr-parallel-use.test.ts --project octane --project octane-prod --silent=passed-only — 90 tests passed after the final sync.
  • pnpm --dir benchmarks/signal-favoring bench:work — all 12 existing production operation gates pass without changed ceilings.
  • node benchmarks/bench.mjs --quick compiler-throughput codegen-size
  • pnpm changeset:check
  • Adversarial frozen-AST/source-location probes for missing own keys, inherited keys, defaults, rest, computed/nested access, prototype keys, reassignment, lexical shadowing, async descendants, server output, and universal output.

Risk / follow-ups

The optimization is limited to the DOM client's existing same-module warm graph. Unsafe or unproven call sites continue to retain their previous warming behavior; no public API, authoring contract, runtime representation, or server plan changes.

Provenance

  • An agent produced this diff (agent-authored)

Note

Medium Risk
Changes compiler warm-graph logic on the client Suspense/parallel-use path; unproven call sites keep conservative behavior, but incorrect proofs could skip needed warming or change render timing.

Overview
The DOM client compiler no longer treats synchronous same-module children that only read plain props as async warm targets when each JSX call site passes those keys as own attributes—so parents stop emitting empty warm batches that eagerly evaluate child props while an earlier sibling is still suspended.

classifySameModuleWarmPotential now records which prop keys a component reads (flat destructuring, aliases, props.foo) and tracks per–call-site JSX edges instead of component names only. A fixed-point pass and warmCallsiteOwnsRequiredProps require every required key at that edge (rejecting spreads, __proto__, missing keys, etc.); unsafe patterns still force the old conservative warming. warmKids filtering uses the same proof so prop reads are not warmed speculatively.

Adds Suspense regressions (Proxy-backed props, key/ref) and extends the signal-favoring benchmark chain with passed-through kind props to stress this path.

Reviewed by Cursor Bugbot for commit ca9dcb7. 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 Aug 9, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 54729c0. Configure here.

Comment thread packages/octane/src/compiler/compile.js Resolved
@trueadm
trueadm marked this pull request as ready for review August 10, 2026 00:12
@trueadm
trueadm merged commit a84fcaa into octanejs:main Aug 10, 2026
49 of 50 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.

2 participants