Skip to content

fix(resolve): cache parallel snapshot lookups - #237

Merged
sunerpy merged 1 commit into
mainfrom
codex/fix-resolution-snapshot-cache
Aug 27, 2026
Merged

sunerpy merged 1 commit into
mainfrom
codex/fix-resolution-snapshot-cache

Conversation

@sunerpy

@sunerpy sunerpy commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace per-node inheritance-edge reads with two bulk kind queries
  • add bounded single-flight caches for snapshot file contents, import mappings, and re-exports
  • avoid cloning whole source files when only readability is needed

Performance rationale

On the reported index, the old adjacency setup issued about 750,574 point queries for 375,287 nodes to retrieve 7,715 inheritance edges. The new path issues two indexed queries. Parallel resolution now reads and parses a given source file once per resident cache entry instead of once per unresolved reference.

Validation

  • make ci
  • snapshot/store equivalence: 0 mismatches
  • concurrent cache regression: 16 callers, exactly one file load/import parse/re-export parse
  • golden artifacts unchanged

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.80240% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/codegraph-resolve/src/snapshot_context.rs 98.52% 4 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #237      +/-   ##
==========================================
+ Coverage   95.34%   95.35%   +0.01%     
==========================================
  Files         141      141              
  Lines       79148    79452     +304     
==========================================
+ Hits        75464    75765     +301     
- Misses       3684     3687       +3     
Files with missing lines Coverage Δ
crates/codegraph-resolve/src/context.rs 98.47% <ø> (ø)
crates/codegraph-resolve/src/import_resolver.rs 96.34% <100.00%> (ø)
crates/codegraph-resolve/src/types.rs 100.00% <100.00%> (ø)
crates/codegraph-store/src/queries.rs 98.47% <100.00%> (+0.03%) ⬆️
crates/codegraph-resolve/src/snapshot_context.rs 97.85% <98.52%> (+0.60%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sunerpy
sunerpy merged commit 2b51d68 into main Aug 27, 2026
7 checks passed
@sunerpy
sunerpy deleted the codex/fix-resolution-snapshot-cache branch August 27, 2026 08:18
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.

1 participant