feat(profiling): P3 per-segment query profiler timing + scenarios (LOC-68)#72
Merged
Conversation
… (LOC-68) Per-segment timing driver (embed/activate/search/hydrate) mirroring SourceRagService.searchMeta, replicating the private _indexPath (FNV-1a) and _toInt64List (FRB Int64List) helpers, with activateOnly/deleteOnDiskIndex for deterministic cold setup and hit sourceIds for fail-closed filter checks. Profile-mode requires flutter drive (flutter test hard-pins debug = fallback backend), so adds test_driver/integration_test.dart and the flutter_rust_bridge dep the profiler needs for FRB i64 lists.
…(LOC-68) Measurement entrypoint (own file, runs under flutter drive --profile): pure_cold / pure_warm (both lanes) / switching_cold, fresh DB via pre-init file delete (no clearAllData race), 15m timeout, per-row CSV log. Fail-closed: kDebugMode skip+assert, hits>0, filtered hits' sourceId in requested set. PR-P3.md + README.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P3 — 세그먼트 타이밍 + 3시나리오 × 2레인 (LOC-68)
온디바이스 RAG 쿼리 단계(embed / activate / search / hydrate)를 격리 계측하는 프로파일러 본체. DESIGN Approach C, Phase-1(Rust 0변경).
변경
example/lib/profiling/query_profiler.dart—SourceRagService.searchMeta경로 미러 + 단계별Stopwatch. 엔진 private 헬퍼 복제(_indexPathFNV-1a,_toInt64ListFRB Int64List),activateOnly/deleteOnDiskIndex로 결정적 cold 셋업, hit sourceId 반환.example/integration_test/query_profile_measure_test.dart— pure_cold / pure_warm(2레인) / switching_cold(A→B→A). 단독 파일, init 전 DB 삭제(clearAllData 비동기 재초기화-seed 경합 →database is locked회피), 15m timeout, 행단위PROFILE_CSV로그.example/test_driver/integration_test.dart+flutter_rust_bridge ^2.11.1dep.측정 방법 (중요:
flutter test아님 →flutter drive)flutter test는 빌드를 debug로 하드핀 → cargokit debug → fallback 백엔드(출시vector_faer,vector_quant_i8미적용)라 측정 무효.fail-closed:
kDebugModeskip+assert / 필터레인 hit sourceId ⊆ 요청 / 세그먼트별 N>0.실기 결과 (iPhone iOS 26.5, profile, 500 docs/collection, topK=10)
warm은 embed(ONNX) 지배(~27ms, 15–37배), cold는 activate(247ms) 지배. 상세 디바이스/방법/디버그 로그·결론: PR-P3.md · Linear LOC-68.
검증
flutter analyze클린. iPhone profile 런 green. cargo 영향 없음(Dart/example 전용). 머지는 본인.