Skip to content

Commit 40c5a7a

Browse files
habdelraclaude
andcommitted
Tighten incremental no-pre-warm comments to the actual mechanism
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>
1 parent fb47438 commit 40c5a7a

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

packages/runtime-common/index-runner.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,16 @@ export class IndexRunner {
434434
}
435435
current.#scheduleClearCacheForNextRender();
436436
}
437-
// Incremental indexing does no module pre-warming. The module cache
438-
// is already warm from the prior from-scratch, and any module a
439-
// render needs that isn't cached resolves through the on-demand
440-
// `lookupDefinition` read-through during the visit (PagePool-safe: the
441-
// sub-prerender materializes its own tab). Leaning on the read-through
442-
// keeps this path's cost bounded by the cards it actually visits
443-
// instead of fanning out a separate module-warming pass.
437+
// Incremental indexing does no module pre-warming. Query-backed field
438+
// expansion during a prerender `_search` reads the `queryFieldDefs`
439+
// pre-extracted onto each result instance's stored meta
440+
// (`populateQueryFieldsFromMeta`), so it needs no `modules`-table row
441+
// for the queried type. The prerender-search definition path is
442+
// cache-only by design — a read-through there would re-enter the same
443+
// affinity tab mid-render and deadlock the pool — while definition
444+
// needs outside it resolve through the on-demand `lookupDefinition`
445+
// read-through. There is nothing left for a pre-warm pass to
446+
// front-load here.
444447
let filesCompleted = 0;
445448
let totalFiles = invalidations.length;
446449

@@ -686,10 +689,9 @@ export class IndexRunner {
686689
// mid-card-render at lookup time, which is the wait-shape the
687690
// PagePool's tab-materialization for module/command callers is
688691
// meant to relieve. This realm-wide sweep runs only on from-scratch
689-
// indexing, where the module cache is cold; incremental indexing does
690-
// no pre-warming and relies on the cache the last from-scratch left
691-
// warm (the cost of this sweep is O(realm module count), not O(files
692-
// changed)).
692+
// indexing, where the module cache is cold by definition; incremental
693+
// indexing does no pre-warming (the cost of this sweep is O(realm
694+
// module count), not O(files changed)).
693695
//
694696
// `.gts` / `.gjs` only is an optimization, not a correctness gate:
695697
// `.ts` / `.js` files CAN host `CardDef` (e.g. command-input

0 commit comments

Comments
 (0)