{
  "config": {
    "bottleneck_under_test": "Engine::vector_search (crates/core/src/engine.rs, ~lines 1112-1126): when pre_filter is Some and HNSW is built, the engine runs a full state.for_each_entity(...) O(n) scan to materialize a HashSet<EntityId> of filter matches BEFORE consulting the HNSW graph, regardless of corpus size vs. match count.",
    "corpus": "1024-center Gaussian mixture, sigma 0.15 (models real embedding cluster structure), same generator as vector_scale_bench.rs",
    "dims": 384,
    "filter_field": "tenant_bucket: integer uniform over 0..1000, independent of embedding cluster assignment",
    "filter_shape": "Filter::Lt(\"tenant_bucket\", threshold) \u2014 selects a scalar-bounded subset, the tenant/kind-scoped RAG shape",
    "hnsw_params": "ef_construction=200 ef_search=100 (instant-distance defaults)",
    "k": 10,
    "scale_note": "KYNETRA_BENCH_N env var controls N; default 100000 for a fast (~1-2 min) representative run; set to 1000000 for the full-scale gate run.",
    "vectors": 100000
  },
  "environment": {
    "arch": "aarch64",
    "hardware": "Cortex-X925, 121 GB RAM",
    "host": {
      "logical_cpus": 20,
      "rustc_version": "rustc 1.97.1 (8bab26f4f 2026-07-14)",
      "uname": "Linux spark-417d 6.17.0-1026-nvidia #26-Ubuntu SMP PREEMPT_DYNAMIC Thu Jun 25 00:57:17 UTC 2026 aarch64 aarch64 aarch64 GNU/Linux"
    },
    "operating_system": "linux",
    "scope": "local"
  },
  "kpi_gate": {
    "baseline_p99_ms_at_0_1pct_selectivity": 8.075,
    "description": "BASELINE ONLY (no gate yet) \u2014 this is the pre-optimization number the flagship 10x filtered-vector-search work (W1) must beat by ~10x at 0.1% selectivity (the tenant-scoped-RAG case), without recall regressing.",
    "target_p99_ms_10x": 0.807
  },
  "measurements": [
    {
      "id": "corpus_generation_secs",
      "value": 0.218
    },
    {
      "entities_per_sec": 42479.817,
      "id": "entity_insert_secs",
      "value": 2.354
    },
    {
      "id": "hnsw_build_secs",
      "value": 16.846
    },
    {
      "id": "rss_mb_after_build",
      "value": 969
    },
    {
      "avg_hits_returned": 10.0,
      "id": "filtered_vector_search/unfiltered_reference",
      "matches": 100000,
      "p50_ms": 0.179,
      "p95_ms": 0.266,
      "p99_ms": 0.382,
      "queries": 1000,
      "recall_at_10_vs_brute_force": 1.0,
      "selectivity_measured": 1.0,
      "selectivity_nominal": 1.0
    },
    {
      "avg_hits_returned": 0.048,
      "id": "filtered_vector_search/selectivity_0.1pct",
      "matches": 103,
      "p50_ms": 6.018,
      "p95_ms": 6.978,
      "p99_ms": 8.075,
      "queries": 1000,
      "recall_at_10_vs_brute_force": 0.004,
      "selectivity_measured": 0.001,
      "selectivity_nominal": 0.001
    },
    {
      "avg_hits_returned": 0.412,
      "id": "filtered_vector_search/selectivity_1pct",
      "matches": 988,
      "p50_ms": 7.264,
      "p95_ms": 8.111,
      "p99_ms": 8.749,
      "queries": 1000,
      "recall_at_10_vs_brute_force": 0.042,
      "selectivity_measured": 0.01,
      "selectivity_nominal": 0.01
    },
    {
      "avg_hits_returned": 4.105,
      "id": "filtered_vector_search/selectivity_10pct",
      "matches": 9806,
      "p50_ms": 8.135,
      "p95_ms": 9.944,
      "p99_ms": 10.782,
      "queries": 1000,
      "recall_at_10_vs_brute_force": 0.435,
      "selectivity_measured": 0.098,
      "selectivity_nominal": 0.1
    }
  ],
  "origin": {
    "build": "release",
    "kind": "measured",
    "tool": "examples/filtered_vector_bench.rs"
  },
  "prefilter_scan_scaling_check": {
    "description": "Two runs at different N, same selectivity (0.1%), to distinguish whether p99 tracks corpus size N (consistent with the O(n) for_each_entity scan) or the filter's match count (consistent with a match-proportional cost).",
    "n_100000": {
      "matches_at_0_1pct": 103,
      "p99_ms": 8.075,
      "unfiltered_p99_ms": 0.382,
      "vectors": 100000
    },
    "n_25000": {
      "matches_at_0_1pct": 29,
      "p99_ms": 3.095,
      "unfiltered_p99_ms": 0.892,
      "vectors": 25000
    },
    "within_n_100000_evidence": {
      "note": "At FIXED N=100000, filtered p99 is nearly flat across match counts spanning 100x (103 vs 9806 matches) while being ~20-28x the unfiltered p99 \u2014 this isolates corpus size N, not match count, as the dominant cost, consistent with an O(n) pre-filter scan that runs regardless of selectivity.",
      "selectivity_0_1pct": {
        "matches": 103,
        "p99_ms": 8.075
      },
      "selectivity_10pct": {
        "matches": 9806,
        "p99_ms": 10.782
      },
      "selectivity_1pct": {
        "matches": 988,
        "p99_ms": 8.749
      },
      "unfiltered_reference_p99_ms": 0.382
    }
  },
  "recorded_at": "2026-07-24",
  "schema": "kynetra.benchmark/v1",
  "status": "local_evidence",
  "suite": "filtered_vector_search_baseline"
}
