Improve Context Composer resolution performance - #795
Conversation
|
@w-winter feel free to make direct changes or even close the PR if irrelevant (buggy or doesn't improve speed). |
Audit disposition — evidence and current-head blocker (2026-08-14)The design contains several careful boundaries—immutable UI projections, selection-matched token reuse, candidate-local graph ranks, and manifest membership/identity witnesses—but it changes 31 files across performance, routing, accounting, and persistence. Focused tests are not enough to establish the combined behavior. Please resolve the exact-head failing app shard, visibly relaunch and sample the built executable in the intended Context Composer scenario, compare release/debug behavior, and provide measured before/after traversal, token-recount, UI-body, graph-sort, and manifest-publication evidence. I would not merge this large performance/persistence change while the final live and hosted evidence remains incomplete. |
Deep-review assessment — 2026-08-14Disposition: hold for current-head failure triage and real performance evidence. The authority-aware ideas are thoughtful: immutable UI projections, usable completed token snapshots during equivalent refresh, sparse candidate ranking, and manifest-cache reuse guarded by exact directory/file witnesses. But this is a 31-file cross-layer change, the final bundle was not visibly relaunched/PID-sampled, release-versus-debug parity remains pending, and the reviewed exact-head CI had one failing app shard. Please identify that failure, complete the live relaunch/context sampling, and publish before/after measurements for each claimed hot path. Consider splitting manifest publication caching, graph ordering, token scheduler/UI semantics, and inactive-tab routing into independent PRs; the current evidence gap is too large for one performance branch of this breadth. |
Summary
Root cause and design
Opening Context Composer could independently trigger multiple expensive whole-root traversals and token-accounting passes. Samples additionally showed SwiftUI body evaluation repeatedly rebuilding persistent binding-resolution snapshots, graph sorts repeatedly traversing path bytes, and manifest publication repeatedly scanning/checksumming/decoding the whole store.
The fix establishes explicit projection and synchronization boundaries rather than adding delays or retries:
Validation
CodeMapRootManifestStoreTests: passed (51 tests, 0 failures)WorkspaceCodemapSelectionGraphIncrementalTests: passed (13 tests, 0 failures)make dev-swift-build PRODUCT=RepoPrompt: passedmake dev-build: passed; signed debug bundle at~/Library/Application Support/RepoPrompt CE/DebugApps/RepoPrompt.appLive retest status
The final bundle is built but has not been visibly relaunched yet: the required immediate launch approval prompt timed out. Exact-context PID sampling and release/debug content-parity comparison remain pending that approval; the PR does not claim those as completed.