Skip to content

perf: bound large retrieval snapshot reads - #355

Merged
suguanYang merged 2 commits into
mainfrom
perf/wangbinqi/retrieval-hydration-job-id
Aug 31, 2026
Merged

suguanYang merged 2 commits into
mainfrom
perf/wangbinqi/retrieval-hydration-job-id

Conversation

@suguanYang

Copy link
Copy Markdown
Contributor

Summary

  • Bound the small-corpus probe to top_k + 1 rows so it never downloads every serving manifest just to decide routing.
  • Use revision-pinned normalized section/chunk reads for large namespaces instead of transferring hundreds of compressed manifests over asyncpg.
  • Keep manifest loading for small namespaces and batch manifest reads for bounded payloads.

Validation

  • Focused retrieval contracts: 12 passed.
  • Ruff: passed.
  • Pyright: 0 errors.
  • No production writes; production read-only reproduction was used only for diagnosis.

This addresses the timeout observed before map-nav/LLM execution when a namespace contains hundreds of active revisions.

_REVISION_GROUP_SIZE,
load_nav_snapshot,
)
import shared.services.retrieval.nav_snapshot as nav_snapshot_module
@suguanYang
suguanYang merged commit 5162d0a into main Aug 31, 2026
6 checks passed
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.

2 participants