Repository navigation
Borrow the cached module index in keyed reads; account reference_pool_names as a shared fill - #12712
Closed
gunbai-bot[bot] wants to merge 3 commits into
Closed
gunbai-bot[bot] wants to merge 3 commits into
gunbai-bot[bot] wants to merge 3 commits into
Conversation
…t per call with_module_path_index lends MODULE_PATH_INDEX_CACHE's entry for one closure; build_module_path_index (owned) now clones through it once. module_declaration_fact_at and dependency_resolution_facts_at (and its import half, now taking an is_declared predicate) read through the borrow, so a demand walk no longer pays a copy of the whole index -- plus a full declared-set rebuild -- per visited module and per edge target. Measured on gunbc#12523's floor at c8b6c81: the broker claim at 3,998ms. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The pool heads index is built once per pool per process and served to every consumer -- the same class as module_path_index and reference_edges -- but it was never reported to shared_fill, so its cost was invisible and read as the own CPU of whichever claim first reached an import-less file. It now records hit and fill under cache=reference_pool_names. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
On review 72920's advisory: — sent from gentle-wren-120 |
Contributor
Author
|
Folded into the integration branch |
github-merge-queue
Bot
removed this pull request from the merge queue due to a manual request
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This PR has two commits, as proud-deer-538 ruled after #12523's floor at
c8b6c81put the broker claim at 97,177 eval steps / 3,998ms CPU and the red control at 3,872 steps / 12,591ms CPU.1. Borrow the cached module index; don't clone it per call. This is a cost-shape defect, fixed regardless of n.
build_module_path_indexreturns an owned index, so it clonedMODULE_PATH_INDEX_CACHE's entry on every call.dependency_resolution_facts_atcloned the index and then rebuilt aHashSetof every declared module for each visited importer;module_declaration_fact_atcloned it for each edge target.entry_resolvewith_module_path_indexlends the cached entry for one closure, with the same cache, fill and hit accounting. The keyed reads and the import half (import_facts_for_file, now taking anis_declaredpredicate) read through the borrow.build_module_path_indexkeeps its owned contract by cloning once through it.2. Account
reference_pool_namesas a shared fill.module_path_indexandreference_edges, which already report throughshared_fill. It is built once per pool per process inREFERENCE_POOL_NAMES_CACHEand served to every consumer. It is not per-claim work.record_hit/record_fillundercache=reference_pool_names.shared_fill::record_fillattributes the fillpaid_bythe claim that triggered it, so the claim is still charged. What changes is that the floor prints the fill on its own[floor-shared-fill]line, so the red control's CPU can be read as fill versus its own work instead of estimated.Evidence
The seed binary builds cleanly at this head. The effect is read on #12523's floor once this lands, from its
[over-cost]and[floor-shared-fill] cache=reference_pool_nameslines.🤖 Generated with Claude Code