Skip to content

perf: scope dead-code reads and prepare bounded outlines - #1147

Draft
zzet wants to merge 43 commits into
mainfrom
perf/scoped-dead-code-outline
Draft

zzet wants to merge 43 commits into
mainfrom
perf/scoped-dead-code-outline

Conversation

@zzet

@zzet zzet commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Bound dead-code and outline requests scanned data from the whole store, so unrelated repositories increased latency. This change carries exact workspace/project/repository scope into database reads and caches immutable outline responses by graph and analysis identity. Mutations invalidate prepared summaries and restore exact queries. Cross-repository callers and interfaces remain valid usage evidence.

Dead-code analysis now reads interface evidence only for actual method candidates and their receiver types. Candidate queries exclude proven stub/external declarations before usage checks and hydration. An eligible-only workspace index prevents rejected global declarations from growing scan cost; raw scope reads retain their original behavior and legacy metadata remains subject to the decoded eligibility check.

Schema migrations 41 and 42 add the two indexes in place and explicitly preserve valid analysis. Older, mixed, unknown and rebuild transitions retain conservative invalidation. Failure/retry tests preserve the rule that the final schema stamp follows all required postconditions.

Validation on c14bd2ad266f2638e6a6db2575b1879063c7796a:

  • Focused analysis, graph, SQLite and MCP race checks pass, including planner registries, scope/mask parity, generation visibility, migration preservation and bulk-index fallback.
  • The rejected-global scan benchmark remains flat at about 214 microseconds with zero or 10,000 unrelated flagged declarations.
  • The real-store three-pair diagnostic passes: median paired ratio 1.148230; ratio of separate medians 1.179444. All calls succeed and graph/analysis states remain unchanged.
  • Full SQLite race validation passed: 3,261 passing records, zero failures and seven documented platform/helper/opt-in skips. All prescribed pinned formatting, lint (zero issues), vet, CGO, workflow, tidy and module checks passed before the normal push. Hosted CI is pending.

Draft: final-head acceptance still requires the reference n=15 six-store and single-repository comparisons, outline thresholds, unbound output identity, actual-edit cache invalidation and green CI. Earlier-head n=15 results are historical and do not replace these checks.

Closes #1002.

zzet added 19 commits October 27, 2026 03:54
@zzet zzet added this to the v0.64.12 milestone Oct 27, 2026
zzet added 8 commits October 29, 2026 23:18
* origin/main: (152 commits)
  test: hash symlink fixture bytes without text filters
  test: use tagged switch for documentation content cases
  ci: retain affected tests for verified documentation changes
  test: await catalog daemon serve admission before returning
  test(daemon): join restarted relay before closing host transport
  test(indexer): document checked persistence outside delta staging
  feat(llm): add llm.buzz gateway preset
  test(indexer): use promoted batch writer in publication failure control
  test(daemon): bind repair failure injection to the tracked restart configuration
  test(daemon): use resolved index defaults for restart failure fixture
  test(daemon): use the registered Go parser package in restart fixture
  fix(indexer): resume canceled test projections on unchanged startup
  test(indexer): cover successful cancellable projection repair across groups
  fix(indexer): stop canceled warmup test projection between complete groups
  fix(plugin): emit each workflow once as a namespaced skill
  Keep sidecar shutdown from starting implicit SQLite checkpoints
  Share SQLite physical close-checkpoint policy between stores
  test(cli): separate short socket from owned escape-hatch data
  test(cli): retain bounded daemon logs on escape-hatch failure
  test(mcp): retire collision worker before missing-owner retry
  ...

# Conflicts:
#	internal/mcp/server.go
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.

Make dead_code and outline cost follow the scoped repo, not the whole store

1 participant