fix(embed-candle): address round-1 review

- commit track-spec + meta-spec/plan into branch (HIGH: dangling `amends:` ref)
- inline parity evidence (cosine 1.0, max_abs_diff 2.01e-7) into HOTFIXES +
  release notes; drop refs to deleted IMPL_REPORT/SPIKE_REPORT (MEDIUM)
- model guard: reject non-e5-large `model` before the 2GB download so
  model_id() can't mislabel vectors (MEDIUM) + unit test
- parity test now covers BOTH query: and passage: prefixes (MEDIUM)
- guard encodings.first() index; document zero-attention/pooling invariant;
  clarify embed_batch prefixing doc (LOW)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-01 16:54:20 +00:00
parent 1011c75fff
commit 6ec4e6809f
7 changed files with 339 additions and 16 deletions

View File

@@ -27,9 +27,9 @@ config 로 줄일 surface 가 없었고, fastembed 4.9 의 ORT 바인딩은 이
provider 를 추가하기로 결정. candle 의 CPU 백엔드는 글로벌 rayon 풀 크기로
스레드를 정하므로, 한 번의 `rayon::ThreadPoolBuilder::build_global` 캡으로
스레드를 NUMA-안전한 수로 묶을 수 있다. **재색인 0 목표**(`embedding_version`
유지) — Phase 0 스파이크(`SPIKE_REPORT.md`, 커밋 76841af)가 candle vs
onnxruntime **코사인 1.000000** 패리티를 입증했고, 본 Track 1 구현의 패리티
테스트로 차원별 max 절대오차를 재실측해 확정.
유지) — Phase 0 스파이크(커밋 76841af)가 candle vs onnxruntime **코사인
1.000000** 패리티를 입증했고, 본 Track 1 구현의 패리티 테스트로 차원별 max
절대오차를 재실측해 확정.
**무엇을 건드렸나.**
- 신규 crate `crates/kebab-embed-candle``kebab_core::Embedder` 구현
@@ -46,9 +46,12 @@ onnxruntime **코사인 1.000000** 패리티를 입증했고, 본 Track 1 구현
- 스파이크 crate `crates/spike-embed-candle` 제거(학습은 production 으로 흡수됨).
- 버전 0.21.1 → **0.22.0** (신규 config surface — pre-1.0 minor bump).
**패리티 증거.** Phase 0 스파이크 cosine 1.000000 (10문장 한/영 혼합). 본
Track 1 의 `#[ignore]` 패리티 테스트 결과(max abs diff)는
`/build/out/kebab-worktrees/embed-candle/IMPL_REPORT.md` 에 기록.
**패리티 증거.** candle vs `FastembedEmbedder`(onnxruntime), 동일 10문장
(한/영 혼합, e5 `passage:`/`query:` prefix): **cosine_min = 1.000000,
차원별 max 절대오차 = 2.01e-7** (f32 커널 반올림 수준 — 랭킹 영향 임계보다
약 50배 작음). 재현: `cargo test -p kebab-embed-candle --release -- --ignored
--nocapture` (`crates/kebab-embed-candle/tests/parity.rs`, 모델 ~2GB 필요라
CI 기본 제외). 이 수치가 `embedding_version` 유지(재색인 0) 결정의 근거.
**호환성.** fastembed default 경로의 동작/벡터 불변. `embedding_version`
유지 → 기존 색인 재사용(재색인 0). wire schema 변경 없음. 옛 config.toml 은