A vector index built on TurboQuant, written in Rust with Python bindings
This report presents the forensic synthetic code analysis of RyanCodrai/turbovec, a Python project with 12,688 GitHub stars. SynthScan v2.0 examined 22,073 lines of code across 114 source files, recording 436 pattern matches distributed across 11 syntactic categories. The overall adjusted score of 18.7 places this repository in the Moderate AI signal band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 436 distinct pattern matches across 11 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | turbovec-python/python/turbovec/haystack.py | 306 | def count_documents_by_filter(self, filters: Dict[str, Any]) -> int: | CODE |
| LOW | turbovec-python/python/turbovec/haystack.py | 316 | def count_unique_metadata_by_filter( | CODE |
| LOW | turbovec-python/python/turbovec/haystack.py | 352 | def get_metadata_field_min_max(self, metadata_field: str) -> Dict[str, Any]: | CODE |
| LOW | turbovec-python/python/turbovec/haystack.py | 372 | def get_metadata_field_unique_values( | CODE |
| LOW | turbovec-python/python/turbovec/haystack.py | 505 | async def delete_all_documents_async(self) -> None: | CODE |
| LOW⚡ | turbovec-python/python/turbovec/haystack.py | 517 | async def count_documents_by_filter_async(self, filters: Dict[str, Any]) -> int: | CODE |
| LOW⚡ | turbovec-python/python/turbovec/haystack.py | 522 | async def count_unique_metadata_by_filter_async( | CODE |
| LOW⚡ | turbovec-python/python/turbovec/haystack.py | 532 | async def get_metadata_fields_info_async(self) -> Dict[str, Dict[str, str]]: | CODE |
| LOW⚡ | turbovec-python/python/turbovec/haystack.py | 537 | async def get_metadata_field_min_max_async( | CODE |
| LOW⚡ | turbovec-python/python/turbovec/haystack.py | 545 | async def get_metadata_field_unique_values_async( | CODE |
| LOW⚡ | turbovec-python/python/turbovec/haystack.py | 555 | async def embedding_retrieval_async( | CODE |
| LOW | turbovec-python/python/turbovec/agno.py | 425 | def _handles_for_content_hash(self, content_hash: str) -> List[int]: | CODE |
| LOW | turbovec-python/python/turbovec/agno.py | 478 | def _resolve_filter_to_handles( | CODE |
| LOW | turbovec-python/python/turbovec/agno.py | 621 | def get_supported_search_types(self) -> List[SearchType]: | CODE |
| LOW | turbovec-python/python/turbovec/langchain.py | 92 | def _select_relevance_score_fn(self) -> Callable[[float], float]: | CODE |
| LOW | turbovec-python/python/turbovec/langchain.py | 260 | def similarity_search_with_score( | CODE |
| LOW | turbovec-python/python/turbovec/langchain.py | 270 | async def asimilarity_search_with_score( | CODE |
| LOW | turbovec-python/python/turbovec/langchain.py | 282 | def similarity_search_by_vector( | CODE |
| LOW | turbovec-python/python/turbovec/langchain.py | 292 | async def asimilarity_search_by_vector( | CODE |
| LOW | turbovec-python/python/turbovec/langchain.py | 377 | def max_marginal_relevance_search( | CODE |
| LOW | turbovec-python/python/turbovec/langchain.py | 387 | def max_marginal_relevance_search_by_vector( | CODE |
| LOW | turbovec-python/python/turbovec/langchain.py | 399 | async def amax_marginal_relevance_search( | CODE |
| LOW⚡ | turbovec-python/tests/test_llama_index.py | 59 | def test_lazy_dim_locked_on_first_add(): | CODE |
| LOW⚡ | turbovec-python/tests/test_llama_index.py | 66 | def test_from_params_without_dim_is_lazy(): | CODE |
| LOW⚡ | turbovec-python/tests/test_llama_index.py | 71 | def test_persist_and_load_lazy_uncommitted_store(tmp_path): | CODE |
| LOW⚡ | turbovec-python/tests/test_llama_index.py | 114 | def test_ref_doc_id_preserved_through_query(): | CODE |
| LOW⚡ | turbovec-python/tests/test_llama_index.py | 124 | def test_empty_query_returns_empty(): | CODE |
| LOW⚡ | turbovec-python/tests/test_llama_index.py | 132 | def test_k_larger_than_ntotal_is_clamped(): | CODE |
| LOW⚡ | turbovec-python/tests/test_llama_index.py | 139 | def test_query_without_embedding_raises(): | CODE |
| LOW⚡ | turbovec-python/tests/test_llama_index.py | 146 | def test_mismatched_dim_raises(): | CODE |
| LOW⚡ | turbovec-python/tests/test_llama_index.py | 152 | def test_persist_and_from_persist_path_roundtrip(tmp_path): | CODE |
| LOW⚡ | turbovec-python/tests/test_llama_index.py | 825 | def test_delete_nodes_no_args_is_noop(): | CODE |
| LOW⚡ | turbovec-python/tests/test_llama_index.py | 832 | def test_to_dict_from_dict_roundtrip(): | CODE |
| LOW⚡ | turbovec-python/tests/test_llama_index.py | 842 | def test_to_dict_from_dict_lazy_store(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 36 | def test_from_params_creates_index(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 46 | def test_constructor_no_index_is_lazy(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 84 | def test_add_and_query_returns_nodes(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 99 | def test_metadata_and_text_roundtrip(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 168 | def test_from_persist_dir_loads_default_namespace(tmp_path): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 184 | def test_from_persist_dir_with_custom_namespace(tmp_path): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 196 | def test_delete_by_ref_doc_id_removes_every_matching_node(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 212 | def test_delete_by_missing_ref_doc_id_is_noop(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 219 | def test_delete_nodes_by_node_id(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 233 | def test_add_upsert_replaces_same_node_id(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 245 | def test_add_upsert_dim_mismatch_preserves_existing_node(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 275 | def test_query_with_eq_filter(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 288 | def test_query_with_in_filter(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 305 | def test_query_with_and_filter(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 323 | def test_query_with_or_filter(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 342 | def test_query_filter_no_matches_returns_empty(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 356 | def test_query_filter_selective_returns_top_k_from_matches(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 376 | def test_query_with_node_ids_filter(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 391 | def test_query_with_doc_ids_filter_matches_ref_doc_id_only(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 417 | def test_query_with_node_ids_and_filters_intersect(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 439 | def test_query_ne_filter_treats_missing_key_as_no_match(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 460 | def test_query_text_match_is_case_sensitive(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 497 | def test_query_text_match_insensitive_folds_case(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 523 | def test_query_text_match_raises_type_error_on_non_string_operands(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 540 | def test_query_all_operator_matches_set_subset(): | CODE |
| LOW | turbovec-python/tests/test_llama_index.py | 562 | def test_query_any_operator_matches_set_intersection(): | CODE |
| 289 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | turbovec/build.rs | 1 | // Emit BLAS link directives so downstream binaries (tests, examples, and | COMMENT |
| LOW | turbovec/tests/tqplus_calibration.rs | 1 | //! Wave-6 regression tests for the TQ+ calibration state machine. | COMMENT |
| LOW | turbovec/tests/concurrent_search.rs | 1 | //! Integration tests for concurrent search on a shared `TurboQuantIndex`. | COMMENT |
| LOW | turbovec/tests/filtering.rs | 1 | //! Correctness tests for slot-mask filtering on `TurboQuantIndex` and the | COMMENT |
| LOW | turbovec/tests/input_validation.rs | 1 | //! Input-validation tests for `TurboQuantIndex` and `IdMapIndex`. | COMMENT |
| LOW | turbovec/tests/swap_remove.rs | 1 | //! Correctness of `TurboQuantIndex::swap_remove`. | COMMENT |
| LOW | turbovec/tests/distortion.rs | 1 | //! Statistical validation of quantizer distortion. | COMMENT |
| LOW | turbovec/tests/kernel_correctness.rs | 1 | //! Correctness harness for the SIMD scoring kernels. | COMMENT |
| LOW | turbovec/tests/lazy_init.rs | 1 | //! Tests for lazy index construction on `TurboQuantIndex` and `IdMapIndex`. | COMMENT |
| LOW | turbovec/tests/rotation.rs | 1 | //! Correctness tests for the rotation matrix generator. | COMMENT |
| LOW | turbovec/examples/dump_state.rs | 1 | //! Dump the rotation matrix and Lloyd-Max codebook for a given (dim, bits) to | COMMENT |
| LOW | turbovec/examples/kernel_xtest.rs | 1 | //! Cross-arch kernel parity smoke-test. | COMMENT |
| LOW | turbovec/examples/kernel_xtest.rs | 61 | // Dump per-query top-K as `qi <tab> rank <tab> idx`. Scores are | COMMENT |
| LOW | turbovec/src/io.rs | 1 | //! Read/write TurboVec index files. | COMMENT |
| LOW | turbovec/src/error.rs | 1 | //! Errors returned by the user-facing add and construct paths. | COMMENT |
| LOW | turbovec/src/error.rs | 21 | use std::fmt; | COMMENT |
| LOW | turbovec/src/error.rs | 41 | /// `vectors.len()` is not a whole multiple of `dim`. | COMMENT |
| LOW | turbovec/src/encode.rs | 1 | //! Encode vectors: normalize, rotate, calibrate, quantize, bit-pack, scale. | COMMENT |
| LOW | turbovec/src/encode.rs | 41 | /// floor: at ~200 samples the calibration noise eats the precision gain | COMMENT |
| LOW | turbovec/src/encode.rs | 241 | } | COMMENT |
| LOW | turbovec/src/lib.rs | 1 | //! TurboQuant implementation for vector search. | COMMENT |
| LOW | turbovec/src/lib.rs | 21 | //! | COMMENT |
| LOW | turbovec/src/lib.rs | 61 | const ROTATION_SEED: u64 = 42; | COMMENT |
| LOW | turbovec/src/lib.rs | 81 | COMMENT | |
| LOW | turbovec/src/lib.rs | 121 | bit_width: usize, | COMMENT |
| LOW | turbovec/src/lib.rs | 221 | rotation: OnceLock::new(), | COMMENT |
| LOW | turbovec/src/lib.rs | 321 | // Rotation, boundaries, and centroids remain valid (they only depend | COMMENT |
| LOW | turbovec/src/lib.rs | 381 | } | COMMENT |
| LOW | turbovec/src/lib.rs | 401 | /// query coordinate is non-finite (NaN, +Inf, -Inf) or has | COMMENT |
| LOW | turbovec/src/lib.rs | 641 | // would see `existing = None` (the lazy-first-add signal), | COMMENT |
| LOW | turbovec/src/search.rs | 1 | //! SIMD-accelerated search pipeline. | COMMENT |
| LOW | turbovec/src/search.rs | 21 | /// Process-global. Tests sample before/after a single search to verify | COMMENT |
| LOW | turbovec/src/search.rs | 381 | // | COMMENT |
| LOW | turbovec/src/search.rs | 1261 | // is the binding one: `FLUSH_EVERY * max_lut <= 65535` ⇒ max_lut ≤ 255. | COMMENT |
| LOW | turbovec/src/search.rs | 1341 | // A pair-level skip short-circuits two 32-vector blocks. | COMMENT |
| LOW | turbovec/src/id_map.rs | 1 | //! Stable external IDs on top of [`TurboQuantIndex`]. | COMMENT |
| LOW | turbovec/src/id_map.rs | 21 | //! | COMMENT |
| LOW | turbovec/src/id_map.rs | 81 | /// Returns the same errors as | COMMENT |
| LOW | turbovec/src/id_map.rs | 181 | COMMENT | |
| LOW | .cargo/config.toml | 1 | # Target the x86-64-v3 microarchitecture level on all x86_64 builds. | COMMENT |
| LOW | turbovec-python/build.rs | 1 | fn main() { | COMMENT |
| LOW | turbovec-python/python/turbovec/agno.py | 121 | self.dimensions: int = embedder.dimensions | COMMENT |
| LOW | turbovec-python/tests/test_agno.py | 1021 | db.create() | COMMENT |
| LOW | turbovec-python/src/lib.rs | 241 | /// Remove the vector with external id `id`. Returns `True` if it was | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | turbovec-python/python/turbovec/llama_index.py | 6 | CODE | |
| LOW | turbovec-python/python/turbovec/haystack.py | 16 | CODE | |
| LOW | turbovec-python/python/turbovec/_persist.py | 16 | CODE | |
| LOW | turbovec-python/python/turbovec/agno.py | 10 | CODE | |
| LOW | turbovec-python/python/turbovec/agno.py | 15 | CODE | |
| LOW | turbovec-python/python/turbovec/__init__.py | 1 | CODE | |
| LOW | turbovec-python/python/turbovec/__init__.py | 1 | CODE | |
| LOW | turbovec-python/python/turbovec/langchain.py | 9 | CODE | |
| LOW | turbovec-python/python/turbovec/_dedup.py | 20 | CODE | |
| LOW | turbovec-python/tests/test_llama_index.py | 1 | CODE | |
| LOW | turbovec-python/tests/test_dedup.py | 2 | CODE | |
| LOW | turbovec-python/tests/test_haystack.py | 2 | CODE | |
| LOW | turbovec-python/tests/test_haystack.py | 946 | CODE | |
| LOW | turbovec-python/tests/test_security.py | 9 | CODE | |
| LOW | turbovec-python/tests/test_id_map.py | 2 | CODE | |
| LOW | turbovec-python/tests/test_agno.py | 2 | CODE | |
| LOW | turbovec-python/tests/test_langchain.py | 1 | CODE | |
| LOW | turbovec-python/tests/test_index.py | 7 | CODE | |
| LOW | turbovec-python/tests/test_filtering.py | 2 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | turbovec/examples/kernel_xtest.rs | 96 | // ─── Tiny deterministic PRNG (xoshiro256** seeded via splitmix64) ──────── | COMMENT |
| MEDIUM | turbovec/src/encode.rs | 185 | // ─── Norm and scale (aarch64) ──────────────────────────────────────────────── | COMMENT |
| MEDIUM | turbovec/src/encode.rs | 227 | // ─── Norm and scale (fallback) ─────────────────────────────────────────────── | COMMENT |
| MEDIUM | turbovec/src/encode.rs | 243 | // ─── Fused quantize + scale + pack (aarch64) ──────────────────────────────── | COMMENT |
| MEDIUM | turbovec/src/encode.rs | 355 | // ─── Fused quantize + scale + pack (fallback) ─────────────────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | turbovec-python/python/turbovec/llama_index.py | 678 | __all__ = ["TurboQuantVectorStore"] | CODE |
| LOW | turbovec-python/python/turbovec/haystack.py | 747 | __all__ = ["TurboQuantDocumentStore"] | CODE |
| LOW | turbovec-python/python/turbovec/_persist.py | 55 | __all__ = ["check_persisted_handles"] | CODE |
| LOW | turbovec-python/python/turbovec/agno.py | 686 | def update_metadata(self, content_id: str, metadata: Dict[str, Any]) -> None: | CODE |
| LOW | turbovec-python/python/turbovec/agno.py | 788 | __all__ = ["TurboQuantVectorDb"] | CODE |
| LOW | turbovec-python/python/turbovec/__init__.py | 3 | __all__ = ["IdMapIndex", "TurboQuantIndex"] | CODE |
| LOW | turbovec-python/python/turbovec/langchain.py | 558 | __all__ = ["TurboQuantVectorStore"] | CODE |
| LOW | turbovec-python/python/turbovec/_dedup.py | 71 | __all__ = ["DuplicatePolicy", "resolve_duplicates"] | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | turbovec-python/tests/test_llama_index.py | 895 | # store into a LlamaIndex pipeline (RAG, query engine, etc.), so it | COMMENT |
| MEDIUM⚡ | turbovec-python/tests/test_langchain.py | 475 | # Tier 4: dim is inferred from the embedding model, no explicit param. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | turbovec/tests/kernel_correctness.rs | 23 | /// which makes the self-query invariant below robust. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | turbovec/src/pack.rs | 26 | // Step 1: Extract packed nibble bytes per vector per group | COMMENT |
| LOW | turbovec/src/pack.rs | 57 | // Step 2: Pack into platform-specific layout | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | turbovec/src/pack.rs | 26 | // Step 1: Extract packed nibble bytes per vector per group | COMMENT |
| LOW | turbovec/src/pack.rs | 57 | // Step 2: Pack into platform-specific layout | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | turbovec-python/python/turbovec/haystack.py | 336 | CODE | |
| LOW | benchmarks/create_diagrams.py | 51 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | turbovec-python/python/turbovec/agno.py | 61 | CODE | |
| LOW | turbovec-python/tests/test_llama_index.py | 968 | CODE |