Skip to content

Skip module pre-warming on incremental indexing#5121

Merged
habdelra merged 2 commits into
mainfrom
worktree-no-prewarm-incremental-index
Jun 5, 2026
Merged

Skip module pre-warming on incremental indexing#5121
habdelra merged 2 commits into
mainfrom
worktree-no-prewarm-incremental-index

Conversation

@habdelra
Copy link
Copy Markdown
Contributor

@habdelra habdelra commented Jun 5, 2026

Incremental indexing no longer pre-warms the definition cache for the modules involved in a change set (the invalidated module files, their per-row boxel_index deps, and the adoptsFrom module of a novel .json). It now does no module pre-warming at all.

The module cache is already warm from the prior from-scratch index, and any module a render needs that isn't cached resolves through the on-demand lookupDefinition read-through during the visit phase. That read-through is PagePool-safe — the sub-prerender materializes its own tab rather than queueing behind the render that triggered the lookup, so there's no affinity deadlock to pre-empt. Leaning on it keeps the incremental path's cost bounded by the cards it actually visits.

From-scratch indexing is unchanged: it still runs the realm-wide .gts/.gjs sweep plus the per-invalidation deps warm, because there the module cache is cold by definition.

The existing indexing-test.ts case "the full-realm module pre-warm sweep runs on from-scratch indexing but not on incrementals" continues to encode the contract — it asserts an orphan module (never visited, never a dependency) is not cached after an incremental, which holds with zero pre-warming.

🤖 Generated with Claude Code

Incremental indexing no longer pre-warms the definition cache for the
modules in the change set. The module cache is already warm from the
prior from-scratch, and any module a render needs that isn't cached
resolves through the on-demand `lookupDefinition` read-through during
the visit (PagePool-safe: the sub-prerender materializes its own tab).

From-scratch indexing is unchanged — it still runs the realm-wide
`.gts`/`.gjs` sweep plus the per-invalidation deps warm, where the
module cache is cold by definition.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb47438b25

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/runtime-common/index-runner.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes module pre-warming from the incremental indexing path in IndexRunner, relying instead on the existing on-demand lookupDefinition read-through during the visit phase. From-scratch indexing continues to do the realm-wide .gts/.gjs sweep plus per-invalidation warming, preserving cold-cache behavior.

Changes:

  • Removed preWarmModulesTable() invocation during incremental indexing and adjusted totalFiles accounting accordingly.
  • Updated incremental indexing comments to describe the new “no pre-warm” behavior.
  • Clarified (in comments) that the realm-wide sweep is from-scratch-only.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/runtime-common/index-runner.ts Outdated
Comment thread packages/runtime-common/index-runner.ts Outdated
Describe how query-backed field expansion stays correct without
pre-warming: a prerender `_search` reads the `queryFieldDefs`
pre-extracted onto each result instance's stored meta
(`populateQueryFieldsFromMeta`), so it needs no `modules`-table row for
the queried type, and the prerender-search definition path is cache-only
by design. Drops the imprecise "cache is already warm from the prior
from-scratch" claim — the realm-wide sweep is from-scratch-only because
that is when the cache is cold, not because incremental assumes a warm
one.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@habdelra habdelra requested a review from a team June 5, 2026 01:06
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Host Test Results

    1 files      1 suites   1h 49m 24s ⏱️
2 936 tests 2 921 ✅ 15 💤 0 ❌
2 955 runs  2 940 ✅ 15 💤 0 ❌

Results for commit 40c5a7a.

Realm Server Test Results

    1 files      1 suites   11m 28s ⏱️
1 559 tests 1 558 ✅ 1 💤 0 ❌
1 650 runs  1 649 ✅ 1 💤 0 ❌

Results for commit 40c5a7a.

@habdelra habdelra merged commit ce60b49 into main Jun 5, 2026
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants