Skip to content

perf: reuse warmed transition resources - #701

Merged
domgan-oai merged 2 commits into
octanejs:mainfrom
openai-oss-forks:fix/673-reuse-warmed-transition-resources
Aug 10, 2026
Merged

domgan-oai merged 2 commits into
octanejs:mainfrom
openai-oss-forks:fix/673-reuse-warmed-transition-resources

Conversation

@domgan-oai

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

Copy link
Copy Markdown
Contributor

Summary

  • Reuse resource-creator results already harvested by a held or promoted transition instead of recreating them when a dependent request starts its second wave.
  • Reduce the existing async-composition transition from 13 to 8 resource-creator calls while retaining eight actual network requests, two request waves, and an atomically committed dashboard.
  • Tighten the existing production benchmark's transition creator ceiling to eight only after the real runtime behavior reaches that floor.

Correctness and scope

  • Preserve existing current-episode warm-cache hits and active real-memo precedence; consult the episode-agnostic held/promoted harvest only on the speculative warmMemo cold path.
  • Match existing slot/dependency identities and claim one concrete occurrence per warm plan without consuming the real component's adoption rights or publishing duplicate cache entries.
  • Treat previously adopted harvest entries as occurrence tombstones so a sibling already rendered before the dependent owner does not restart its factory.
  • Restrict harvest reuse to descendants of the held/promoted transition's existing owning block; unrelated roots with identical compiled slots, dependencies, and loader identity retain their own requests.
  • Preserve duplicate same-slot occurrences, true owner dependencies, urgent supersession, held previous DOM, keyed panel identity, controlled board state, fallback behavior, effects, hydration, and independent roots.
  • Add no runtime state, allocations, public APIs, compiler changes, ordinary-render-path work, or changes to generic static/Suspense/hydration production bundles.

Production work

Existing authored async-composition dashboard, unchanged fixtures/resources, production minification, and interleaved real-Chromium baseline/candidate runs:

Observation Before After
Initial resource-creator calls 8 8
Transition resource-creator calls 13 8
Duplicated transition creator calls 5 0
Actual network starts per operation 8 8
Independent first-wave requests 7 7
Request waves per operation 2 2
Mixed-version committed states 0 0

The eliminated duplicate creators were badge, activity, activity-summary, insights, and insights-chart; they previously ran when the dependent owner request started, before it settled. Same-source update medians were 106.10 ms versus 105.10 ms, within the fixed two-wave network-latency floor, so no wall-clock improvement is claimed. The affected application adds 185 raw bytes / 72 gzip bytes / 57 Brotli bytes; generic static-root, Suspense-transition, and hydration applications and the fixed 16-file compiler corpus are byte-identical.

Validation

  • Full Octane development/production core suite: 806 files / 11,953 tests passed.
  • Focused affected transition, Suspense, parallel-use, SSR, hydration, effect/action, universal, and reconciler suites: 258 project-file executions / 3,056 tests passed.
  • Existing real-Chromium Suspense/hydration suite: 11 tests passed.
  • Public production/development transition regressions: exact one-creator-per-resource behavior, cross-root isolation RED-to-GREEN, and urgent-supersession/stale-result isolation.
  • Independent same-hook-slot/equal-dependency repeated-occurrence baseline/candidate probe preserves distinct component results.
  • Existing tightened async-composition production Chromium gate: eight initial/eight update creators, eight network starts, seven independent first-wave starts, two waves, and zero mixed states.
  • Exact-head generic bundle and fixed-compiler-corpus byte comparisons.
  • Full workspace typecheck: pnpm --config.verify-deps-before-run=false --config.enable-pre-post-scripts=false run typecheck.
  • Final repository synchronization: pnpm --config.verify-deps-before-run=false sync.
  • Scoped Prettier verification and git diff --check.

Refs #673.

Provenance

  • An agent produced this diff (agent-authored)

Note

Medium Risk
Changes only the speculative warmMemo path in held/promoted transitions, but incorrect harvest matching could skip needed fetches or break adoption; mitigated by scoped ancestor checks, tombstone behavior, and broad transition/async-composition tests.

Overview
When a held or promoted transition starts a new warm episode after the dependent owner request begins, speculative warmMemo no longer re-runs creators for resources already warmed in the first round. It looks up the episode-agnostic warm harvest (HELD_SYNC_TRANSITION / PROMOTED_WARM_HARVEST) for a matching slot and dependencies under the transition origin, claims that occurrence via CURRENT_WARM_CLAIMS, and skips compute()—without consuming adoption or adding cache entries. Already-adopted harvest slots still act as tombstones so siblings do not restart factories.

The async-composition benchmark update creator ceiling moves from 13 to 8 (matching init), with README and transition-plan docs updated to record P2 warm reuse. Regression tests in parallel-use.test.ts cover transition request ordering (two waves, held UI until owner settles), independent roots during a pending transition, and no reuse after urgent supersession.

Reviewed by Cursor Bugbot for commit 275d558. 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 Aug 10, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review August 10, 2026 22:35
@domgan-oai
domgan-oai merged commit e2466a5 into octanejs:main Aug 10, 2026
3 of 28 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