Skip to content

docs(perf): 온디바이스 쿼리 프로파일러 설계 스펙 (LOC-65)#69

Merged
dev07060 merged 2 commits into
mainfrom
docs/loc-65-query-profiler-spec
May 31, 2026
Merged

docs(perf): 온디바이스 쿼리 프로파일러 설계 스펙 (LOC-65)#69
dev07060 merged 2 commits into
mainfrom
docs/loc-65-query-profiler-spec

Conversation

@dev07060

Copy link
Copy Markdown
Owner

무엇 / 왜 (설계 스펙, 문서 only)

실기에서 쿼리 단계별 지연을 분해해 진짜 병목을 찾기 위한 프로파일러 설계. 브레인스토밍 + 설계 리뷰 반영 산출물.

핵심 (리뷰 반영 후 확정)

  • Approach C(단계적): Phase1 coarse(Rust 0변경) baseline → 지배 버킷만 Phase2 드릴다운.
  • 세그먼트: embed / activate(컬렉션 스위치 비용) / search / hydrate + query_metrics I/O + FFI 오버헤드 수식.
  • 2레인: Unfiltered(f32 HNSW+BM25 RRF) / Filtered(i8 exact-scan).
  • Cold/Warm 3분류 + A→B→A 스위치 시나리오 필수(순수 warm만 재면 가짜 초록).

검증된 전제 (코드 인용)

One-Active-Collection 싱글톤 / 스위치 시 BM25 전체 재토큰화(디스크 영속 X) + HNSW 디스크 재로드(Box::leak) / 활성 컬렉션 내 쿼리는 BM25 재토큰화 0회(0.18.4) / filtered→i8 exact-scan. 설계리뷰의 'BM25가 search 안에 숨어 HNSW로 오인' 주장은 정정(activate는 별도 호출).

문서

docs/perf/ondevice-query-profiler/{DESIGN.md,README.md}. vector-math-refactor 저널 패턴 미러. Linear: 프로젝트 + LOC-65.

다음

스펙 리뷰 후 writing-plans로 구현 계획 → PR 단위 분해. 머지는 본인(CI green 후).

Brainstorming output for a real-device RAG query-latency profiler.
Approach C (phased): coarse Dart-only baseline (no Rust change) then drill
into the dominant bucket. Grounded in verified architecture facts:
one-active-collection singleton, collection-switch rebuilds BM25 (full
re-tokenize, no disk persist) + reloads HNSW from disk (Box::leak), active
collection has zero per-query BM25 tokenization (0.18.4), filtered search
routes to the i8 exact-scan kernel.

Adds docs/perf/ondevice-query-profiler/{DESIGN.md,README.md}. Mirrors the
vector-math-refactor journal pattern; Linear project + LOC-65 created.
@linear-code

linear-code Bot commented May 31, 2026

Copy link
Copy Markdown

LOC-65

PR-sized decomposition (P1-P5, LOC-66..70) with TDD steps and verified
Dart/Rust signatures. Phase 1 fully specified (host-TDD utils + device
integration_test in the example app, 2 lanes, 3 cold/warm scenarios incl.
A->B->A switch, JSON/CSV export); Phase 2 gated on baseline data.

Mirrors vector-math-refactor journal; Linear LOC-66..70 created.
@dev07060 dev07060 merged commit 1993889 into main May 31, 2026
11 of 12 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.

1 participant