|
18 | 18 | SearchCombo, |
19 | 19 | create_search_service, |
20 | 20 | _create_fastembed_provider, |
| 21 | + skip_if_needed, |
21 | 22 | ) |
22 | 23 |
|
23 | 24 |
|
@@ -134,6 +135,7 @@ async def test_similarity_score_spread(sqlite_engine_factory, tmp_path): |
134 | 135 | If the top relevant result and the worst irrelevant result have similar scores, |
135 | 136 | the similarity formula is too compressed to be useful. |
136 | 137 | """ |
| 138 | + skip_if_needed(DIAG_COMBO) |
137 | 139 | provider = _create_fastembed_provider() |
138 | 140 | service = await create_search_service( |
139 | 141 | sqlite_engine_factory, DIAG_COMBO, tmp_path, embedding_provider=provider |
@@ -189,6 +191,7 @@ async def test_observation_noise_vs_entity(sqlite_engine_factory, tmp_path): |
189 | 191 | A common issue: observations like "Dark cocoa powder gives richer flavor" |
190 | 192 | can match broadly because they lack parent context. |
191 | 193 | """ |
| 194 | + skip_if_needed(DIAG_COMBO) |
192 | 195 | provider = _create_fastembed_provider() |
193 | 196 | service = await create_search_service( |
194 | 197 | sqlite_engine_factory, DIAG_COMBO, tmp_path, embedding_provider=provider |
@@ -244,6 +247,7 @@ async def test_rrf_fusion_preserves_strong_vector_match(sqlite_engine_factory, t |
244 | 247 | This is the core claim of issue #577 — that RRF dilutes strong vector scores. |
245 | 248 | Let's verify with a controlled corpus. |
246 | 249 | """ |
| 250 | + skip_if_needed(DIAG_COMBO) |
247 | 251 | provider = _create_fastembed_provider() |
248 | 252 | service = await create_search_service( |
249 | 253 | sqlite_engine_factory, DIAG_COMBO, tmp_path, embedding_provider=provider |
@@ -307,9 +311,12 @@ async def test_rrf_fusion_preserves_strong_vector_match(sqlite_engine_factory, t |
307 | 311 | async def test_similarity_formula_analysis(sqlite_engine_factory, tmp_path): |
308 | 312 | """Analyze the raw distance-to-similarity mapping for real queries. |
309 | 313 |
|
310 | | - The current formula: similarity = 1 / (1 + distance) |
311 | | - This test dumps raw distances so we can evaluate alternative formulas. |
| 314 | + Production formulas are backend-specific: |
| 315 | + - SQLite: similarity = max(0, 1 - L2²/2) for normalized embeddings |
| 316 | + - Postgres: similarity = max(0, 1 - cosine_distance) |
| 317 | + This test compares old and new mappings for diagnostics. |
312 | 318 | """ |
| 319 | + skip_if_needed(DIAG_COMBO) |
313 | 320 | provider = _create_fastembed_provider() |
314 | 321 | service = await create_search_service( |
315 | 322 | sqlite_engine_factory, DIAG_COMBO, tmp_path, embedding_provider=provider |
@@ -353,6 +360,7 @@ async def test_similarity_formula_analysis(sqlite_engine_factory, tmp_path): |
353 | 360 | @pytest.mark.benchmark |
354 | 361 | async def test_min_similarity_filters_noise(sqlite_engine_factory, tmp_path): |
355 | 362 | """Verify that min_similarity actually removes low-quality matches.""" |
| 363 | + skip_if_needed(DIAG_COMBO) |
356 | 364 | provider = _create_fastembed_provider() |
357 | 365 | service = await create_search_service( |
358 | 366 | sqlite_engine_factory, DIAG_COMBO, tmp_path, embedding_provider=provider |
@@ -419,6 +427,7 @@ async def test_min_similarity_filters_noise(sqlite_engine_factory, tmp_path): |
419 | 427 | @pytest.mark.benchmark |
420 | 428 | async def test_chunking_produces_reasonable_chunks(sqlite_engine_factory, tmp_path): |
421 | 429 | """Verify that the chunking logic produces chunks with enough context.""" |
| 430 | + skip_if_needed(DIAG_COMBO) |
422 | 431 | provider = _create_fastembed_provider() |
423 | 432 | service = await create_search_service( |
424 | 433 | sqlite_engine_factory, DIAG_COMBO, tmp_path, embedding_provider=provider |
|
0 commit comments