{
 "generated_by": "gen_numbers.py",
 "sources": {
  "results.json": {
   "branch": "docs/embedding-behaviour-paper",
   "commit": "a1451e3456a3ee72ea37b94adcc98eeda479fe36",
   "blob": "b13575815f2ad3d7bcbc2d5dc65223305eeb30e3"
  },
  "rq3_replay_rows.json": {
   "blob": "8852b27e887456f68d9f15d97ae32e76c85f107f",
   "shipped_as": "data/replay_per_source.json (file names removed)"
  },
  "run_date": "2026-09-22",
  "api": "Gemini Developer API, generativelanguage.googleapis.com/v1beta",
  "google_genai_version_in_run": "1.75.0",
  "langchain_google_genai_in_run": "4.2.1"
 },
 "shape": {
  "n_values": [
   1,
   2,
   4,
   8,
   16,
   32,
   64,
   100
  ],
  "calls_per_shape": 21,
  "content_calls_returning_n": 21,
  "bare_calls_returning_one": 21,
  "bare_calls_with_n_ge_2": 18,
  "content_inputs_total": 485,
  "content_cos_min_over_all_calls": 0.9999999999999998,
  "content_cos_min_rounded": 1.0,
  "content_argmax_ok_all": true,
  "aggregate_vs_solo_mean_at_100": 0.629,
  "aggregate_vs_solo_mean_pct_at_100": 63,
  "aggregate_vs_mean_of_solos_at_100": 0.861,
  "aggregate_vs_solo_mean_range_n_ge_2": [
   0.62,
   0.85
  ],
  "aggregate_vs_concat_range": [
   0.98,
   0.99
  ],
  "aggregate_vs_concat_range_3dec": [
   0.984,
   0.994
  ],
  "aggregate_vs_concat_calls": 12,
  "aggregate_vs_concat_max_n": 16,
  "order_cos_forward_reversed_range": [
   0.97,
   0.98
  ],
  "order_cos_forward_reversed_range_3dec": [
   0.973,
   0.978
  ],
  "order_reps": 3,
  "per_n": {
   "1": {
    "calls": 3,
    "content_returned": [
     1
    ],
    "bare_returned": [
     1
    ],
    "content_cos_min": 0.9999999999999998,
    "content_argmax_ok": 3,
    "agg_vs_solo_mean": null,
    "agg_vs_mean_of_solos": null
   },
   "2": {
    "calls": 3,
    "content_returned": [
     2
    ],
    "bare_returned": [
     1
    ],
    "content_cos_min": 0.9999999999999999,
    "content_argmax_ok": 6,
    "agg_vs_solo_mean": 0.823,
    "agg_vs_mean_of_solos": 0.944
   },
   "4": {
    "calls": 3,
    "content_returned": [
     4
    ],
    "bare_returned": [
     1
    ],
    "content_cos_min": 0.9999999999999999,
    "content_argmax_ok": 12,
    "agg_vs_solo_mean": 0.726,
    "agg_vs_mean_of_solos": 0.919
   },
   "8": {
    "calls": 3,
    "content_returned": [
     8
    ],
    "bare_returned": [
     1
    ],
    "content_cos_min": 0.9999999999999998,
    "content_argmax_ok": 24,
    "agg_vs_solo_mean": 0.685,
    "agg_vs_mean_of_solos": 0.886
   },
   "16": {
    "calls": 3,
    "content_returned": [
     16
    ],
    "bare_returned": [
     1
    ],
    "content_cos_min": 0.9999999999999998,
    "content_argmax_ok": 48,
    "agg_vs_solo_mean": 0.647,
    "agg_vs_mean_of_solos": 0.869
   },
   "32": {
    "calls": 2,
    "content_returned": [
     32
    ],
    "bare_returned": [
     1
    ],
    "content_cos_min": 0.9999999999999998,
    "content_argmax_ok": 64,
    "agg_vs_solo_mean": 0.641,
    "agg_vs_mean_of_solos": 0.874
   },
   "64": {
    "calls": 2,
    "content_returned": [
     64
    ],
    "bare_returned": [
     1
    ],
    "content_cos_min": 0.9999999999999998,
    "content_argmax_ok": 128,
    "agg_vs_solo_mean": 0.627,
    "agg_vs_mean_of_solos": 0.863
   },
   "100": {
    "calls": 2,
    "content_returned": [
     100
    ],
    "bare_returned": [
     1
    ],
    "content_cos_min": 0.9999999999999998,
    "content_argmax_ok": 200,
    "agg_vs_solo_mean": 0.629,
    "agg_vs_mean_of_solos": 0.861
   }
  }
 },
 "speedup": {
  "solo_median_ms": 462,
  "solo_ci95_ms": [
   449,
   483
  ],
  "solo_ci_level_pct": 95,
  "solo_calls": 308,
  "n100_calls": 2,
  "n100_latency_s": [
   4.31,
   2.36
  ],
  "n100_bare_latency_s": [
   0.95,
   1.38
  ],
  "n100_bare_latency_mean_s": 1.17,
  "n100_input_tokens": [
   31384,
   33170
  ],
  "n100_ms_per_input": [
   43,
   24
  ],
  "n100_latency_mean_s": 3.33,
  "n100_ms_per_input_mean": 33,
  "ratio_by_call": [
   10.7,
   19.6
  ],
  "ratio_by_call_rounded": [
   11,
   20
  ],
  "ratio_of_mean_latency": 13.9,
  "ratio_of_mean_latency_rounded": 14,
  "ratio_by_n_32_64_100": {
   "32": [
    15.0,
    16.3
   ],
   "64": [
    11.7,
    12.9
   ],
   "100": [
    10.7,
    19.6
   ]
  },
  "f10_ad_hoc": {
   "solo_ms": 437,
   "wall_s": 2.29,
   "ms_per_input": 23,
   "ratio": 19.1,
   "ratio_rounded": 19,
   "source": "findings/F10 of the spike, one ad hoc run on 2026-09-22; no committed raw timings"
  },
  "paper_draft_figure": {
   "value": 14,
   "note": "equals the ratio of the mean of the two N=100 calls"
  },
  "verdict": "The committed data support a range of 11x to 20x from two calls at N=100, with about 14x from their mean. The 19x of F10 is one ad hoc run and sits at the top of that range. The 10.7x is the slower of the two committed calls taken alone. None of the three is wrong arithmetic; each is one draw from a noisy pair.",
  "ratio_range_rounded": [
   11,
   20
  ]
 },
 "replay": {
  "chunks_sent": 308,
  "vectors_returned": 46,
  "rows_stored": 46,
  "chunks_dropped": 262,
  "dropped_pct": 85.1,
  "dropped_pct_rounded": 85,
  "sources": 46,
  "stored_pct": 14.9,
  "stored_pct_rounded": 15,
  "sources_with_one_vector_each": 46,
  "queries": 285,
  "queries_target_chunk0": 42,
  "queries_target_later": 243,
  "query_char_range": [
   150,
   300
  ],
  "ci_level_pct": 95,
  "bootstrap_resamples": 10000,
  "rank1_correct_pct": 73,
  "rank1_correct_exact_pct": 72.6,
  "rank1_correct_ci95_pct": [
   67,
   78
  ],
  "rank1_replay_pct": 14,
  "rank1_replay_exact_pct": 14.4,
  "rank1_replay_ci95_pct": [
   11,
   19
  ],
  "rank1_diff_pp": 58.2,
  "rank1_diff_rounded_pp": 58,
  "rank1_diff_ci95_pp": [
   52.3,
   64.2
  ],
  "file1_correct_pct": 96,
  "file1_replay_pct": 96,
  "head1_correct_pct": 16,
  "head1_replay_pct": 100,
  "top10_correct_pct": 100,
  "top10_correct_exact_pct": 99.6,
  "top10_correct_ci95_pct": [
   99,
   100
  ],
  "top10_replay_pct": 15,
  "top10_replay_exact_pct": 14.7,
  "top10_replay_ci95_pct": [
   11,
   19
  ],
  "top10_diff_pp": 84.9,
  "top10_diff_rounded_pp": 85,
  "top10_diff_ci95_pp": [
   80.7,
   88.8
  ],
  "mrr_correct": 0.84,
  "mrr_replay": 0.15,
  "chunk0_targets_correct_pct": 88,
  "chunk0_targets_replay_pct": 98,
  "later_targets_correct_pct": 70,
  "later_targets_replay_pct": 0,
  "bootstrap": "10,000 resamples of queries, seed 0, percentile interval",
  "raw": {
   "correct": {
    "r1": [
     0.7263157894736842,
     0.6736842105263158,
     0.7789473684210526
    ],
    "r10": [
     0.9964912280701754,
     0.9894736842105263,
     1.0
    ],
    "rr": [
     0.8385045948203842,
     0.806515246449457,
     0.8692901002506266
    ],
    "file1": [
     0.9614035087719298,
     0.9368421052631579,
     0.9824561403508771
    ],
    "head1": [
     0.16140350877192983,
     0.11929824561403508,
     0.20350877192982456
    ]
   },
   "replay": {
    "r1": [
     0.14385964912280702,
     0.10526315789473684,
     0.18596491228070175
    ],
    "r10": [
     0.14736842105263157,
     0.10877192982456141,
     0.18947368421052632
    ],
    "rr": [
     0.1456140350877193,
     0.10526315789473684,
     0.18771929824561404
    ],
    "file1": [
     0.9578947368421052,
     0.9333333333333333,
     0.9789473684210527
    ],
    "head1": [
     1.0,
     1.0,
     1.0
    ]
   },
   "split": {
    "correct": {
     "idx0_r1": [
      0.8809523809523809,
      0.7857142857142857,
      0.9761904761904762
     ],
     "idxgt0_r1": [
      0.6995884773662552,
      0.6419753086419753,
      0.757201646090535
     ],
     "n_idx0": 42,
     "n_idxgt0": 243
    },
    "incident": {
     "idx0_r1": [
      0.9761904761904762,
      0.9285714285714286,
      1.0
     ],
     "idxgt0_r1": [
      0.0,
      0.0,
      0.0
     ],
     "n_idx0": 42,
     "n_idxgt0": 243
    }
   },
   "diff": {
    "r1": [
     0.5824561403508772,
     0.5228070175438597,
     0.6421052631578947
    ],
    "r10": [
     0.8491228070175438,
     0.8070175438596491,
     0.887719298245614
    ],
    "rr": [
     0.6928905597326649,
     0.6458218462823727,
     0.7393500417710944
    ],
    "file1": [
     0.0035087719298245723,
     -0.021052631578947434,
     0.028070175438596467
    ],
    "head1": [
     -0.8385964912280701,
     -0.8807017543859649,
     -0.7964912280701755
    ]
   }
  }
 },
 "token_density": {
  "code_n": 156,
  "code_median_b_per_tok": 3.84,
  "code_iqr_b_per_tok": [
   3.46,
   4.14
  ],
  "code_min_b_per_tok": 1.14,
  "prose_n": 152,
  "prose_median_b_per_tok": 3.7,
  "prose_iqr_b_per_tok": [
   3.31,
   4.12
  ],
  "hex_n": 20,
  "hex_median_b_per_tok": 1.15,
  "hex_iqr_b_per_tok": [
   1.15,
   1.16
  ],
  "uuid_n": 20,
  "uuid_median_b_per_tok": 1.1,
  "uuid_iqr_b_per_tok": [
   1.09,
   1.1
  ],
  "inflation_ratio_code_over_hex": 3.3,
  "inflation_ratio_code_over_uuid": 3.5,
  "total_inputs_checked": 348,
  "utf8_byte_bound_holds_all": 348,
  "utf8_byte_bound_ratio": 1.0,
  "tokenizer_identity_sample": 31,
  "tokenizer_identity_matched": 31
 },
 "truncation": {
  "docs_per_model": 2,
  "series": {
   "gemini-embedding-2": {
    "published_cap": 8192,
    "last_position_read": 8156,
    "first_position_ignored": 8191,
    "points": [
     {
      "type": "code",
      "pos_tokens": 1146,
      "cos": 0.97773312033128
     },
     {
      "type": "code",
      "pos_tokens": 4347,
      "cos": 0.993596271625422
     },
     {
      "type": "code",
      "pos_tokens": 7682,
      "cos": 0.9848239262998351
     },
     {
      "type": "code",
      "pos_tokens": 7949,
      "cos": 0.9869314389865746
     },
     {
      "type": "code",
      "pos_tokens": 8156,
      "cos": 0.9348494753550952
     },
     {
      "type": "code",
      "pos_tokens": 8240,
      "cos": 1.0
     },
     {
      "type": "code",
      "pos_tokens": 8438,
      "cos": 1.0
     },
     {
      "type": "code",
      "pos_tokens": 9107,
      "cos": 1.0
     },
     {
      "type": "prose",
      "pos_tokens": 1042,
      "cos": 0.9967095695376876
     },
     {
      "type": "prose",
      "pos_tokens": 4290,
      "cos": 0.9964211461717516
     },
     {
      "type": "prose",
      "pos_tokens": 7449,
      "cos": 0.9982075944562689
     },
     {
      "type": "prose",
      "pos_tokens": 7963,
      "cos": 0.998257666222469
     },
     {
      "type": "prose",
      "pos_tokens": 8191,
      "cos": 1.0000000000000002
     },
     {
      "type": "prose",
      "pos_tokens": 8232,
      "cos": 1.0000000000000002
     },
     {
      "type": "prose",
      "pos_tokens": 8440,
      "cos": 1.0000000000000002
     },
     {
      "type": "prose",
      "pos_tokens": 9003,
      "cos": 1.0000000000000002
     }
    ]
   },
   "gemini-embedding-001": {
    "published_cap": 2048,
    "last_position_read": 2038,
    "first_position_ignored": 2042,
    "points": [
     {
      "type": "code",
      "pos_tokens": 353,
      "cos": 0.9962081595382634
     },
     {
      "type": "code",
      "pos_tokens": 1146,
      "cos": 0.9981965976697633
     },
     {
      "type": "code",
      "pos_tokens": 2109,
      "cos": 1.0
     },
     {
      "type": "code",
      "pos_tokens": 1987,
      "cos": 0.9915222503894114
     },
     {
      "type": "code",
      "pos_tokens": 2038,
      "cos": 0.9872002334785751
     },
     {
      "type": "code",
      "pos_tokens": 2066,
      "cos": 1.0
     },
     {
      "type": "code",
      "pos_tokens": 2125,
      "cos": 1.0
     },
     {
      "type": "prose",
      "pos_tokens": 400,
      "cos": 0.9991876970798985
     },
     {
      "type": "prose",
      "pos_tokens": 1303,
      "cos": 0.9995301474739915
     },
     {
      "type": "prose",
      "pos_tokens": 1901,
      "cos": 0.9995776305867472
     },
     {
      "type": "prose",
      "pos_tokens": 1991,
      "cos": 0.9997659437785182
     },
     {
      "type": "prose",
      "pos_tokens": 2042,
      "cos": 0.9999999999999999
     },
     {
      "type": "prose",
      "pos_tokens": 2075,
      "cos": 0.9999999999999999
     },
     {
      "type": "prose",
      "pos_tokens": 2110,
      "cos": 0.9999999999999999
     }
    ]
   }
  },
  "v2_bounds": [
   8156,
   8191
  ],
  "v1_bounds": [
   2038,
   2042
  ],
  "guard_ceilings_tokens": [
   8160,
   2038
  ],
  "autotruncate_false_v2_status": [
   400
  ],
  "autotruncate_false_v1_status": [
   200
  ],
  "autotruncate_docs_per_model": 2,
  "autotruncate_v2_doc0_count_tokens": 9580,
  "autotruncate_v2_doc0_error_actual_tokens": 9579,
  "autotruncate_v2_doc10_count_tokens": 9788,
  "autotruncate_v2_doc10_error_actual_tokens": 9787,
  "longdoc_null": {
   "docs": 10,
   "queries_before_cap": 45,
   "queries_past_cap": 36,
   "whole_before_pct": 96,
   "whole_past_pct": 89,
   "whole_past_ci95_pct": [
    78,
    97
   ],
   "chunked_before_pct": 100,
   "chunked_past_pct": 94,
   "chance_pct": 10,
   "misses_past_cap": 4,
   "docs_holding_all_misses": 1
  }
 },
 "external_verified": {
  "accessed": "2026-09-29",
  "google_embeddings_guide": {
   "url": "https://ai.google.dev/gemini-api/docs/embeddings",
   "page_updated": "2026-09-17",
   "quotes": [
    "Adding multiple inputs directly to the `contents` parameter produces one aggregated embedding for all inputs",
    "Wrapping each input in a `Content` object and passing them in the `contents` parameter returns separate embeddings for each entry.",
    "The system silently truncates inputs that exceed this limit."
   ],
   "input_tokens": {
    "gemini-embedding-2": 8192,
    "gemini-embedding-001": 2048
   }
  },
  "google_embeddings_api_reference": {
   "url": "https://ai.google.dev/api/embeddings",
   "page_updated": "2026-08-28",
   "autoTruncate": "Optional. Whether to silently truncate the input content if it's longer than the maximum sequence length."
  },
  "google_cloud_notebook_issue": {
   "url": "https://github.com/GoogleCloudPlatform/generative-ai/issues/2721",
   "number": 2721,
   "opened": "2026-03-11",
   "closed": "2026-03-11",
   "maintainer_reply": "this is by design",
   "docs_and_notebook_update_promised": "2026-03-19"
  },
  "langchain_google_genai": {
   "pypi": "https://pypi.org/project/langchain-google-genai/",
   "broken_versions": [
    "4.2.1",
    "4.2.2",
    "4.2.3"
   ],
   "release_4_2_1": "2026-02-19",
   "release_4_2_2": "2026-04-15",
   "release_4_2_4": "2026-05-28",
   "release_4_4_0": "2026-09-01",
   "latest_at_access": "4.4.0",
   "first_fixed": "4.2.4",
   "fix_pr": {
    "url": "https://github.com/langchain-ai/langchain-google/pull/1766",
    "number": 1766,
    "merged": "2026-05-27",
    "title": "chore(genai): Update google-genai dependency to support 2.x",
    "mentions_embeddings_in_description": false
   },
   "issue": {
    "url": "https://github.com/langchain-ai/langchain-google/issues/1704",
    "number": 1704,
    "opened": "2026-04-16",
    "state_at_access": "open",
    "title": "[BUG] GoogleGenerativeAIEmbeddings returns a single vector for batch input in v4.2.2"
   },
   "other_open_prs": [
    1708,
    1817
   ],
   "method": "unzipped each published wheel and read embeddings.py; 4.2.1 passes contents=batch, 4.2.4 and later wrap each text in a parts dict",
   "days_fix_release_to_incident_check": 113
  },
  "langchain_postgres": {
   "version_in_incident": "0.0.17",
   "release_0_0_17": "2026-02-17",
   "latest_at_access": "0.0.18",
   "release_0_0_18": "2026-09-15",
   "zip_without_strict": true,
   "method": "read vectorstores.py in both wheels; add_embeddings builds rows with zip(texts, metadatas, embeddings, ids_)"
  },
  "vertex_ai_migration": {
   "date": "2026-10-20",
   "vectors_checked": 26,
   "min_cosine_vs_developer_api": 1.0
  },
  "literature": {
   "gray_failure_year": 2017,
   "ml_data_validation_year": 2019
  }
 },
 "session_records": {
  "note": "Three sessions saw the same behaviour. Only the third is in committed result files.",
  "session_1_pipeline": {
   "what": "call through langchain-google-genai 4.2.1, bare strings, gemini-embedding-2 against gemini-embedding-001",
   "n_values": [
    1,
    2,
    5,
    8,
    32,
    100
   ],
   "returned_v2_for_n_ge_2": 1,
   "control_001_sent": 5,
   "control_001_returned": 5,
   "recorded_in": "a code comment, dated 2026-09-18 and re-measured 2026-09-22; no committed script or output"
  },
  "session_2_spike": {
   "what": "direct google-genai call, 8 chunks of about 827 characters, bare strings then Content objects, N up to 100",
   "bare_sent": 8,
   "bare_returned": 1,
   "content_n_checked": [
    5,
    8
   ],
   "content_cos_to_solo": 1.0,
   "avg_chars": 827,
   "batch_ceiling": 100,
   "over_ceiling_n": 128,
   "recorded_in": "findings/F10 of the spike, 2026-09-22; ad hoc run, no committed raw output"
  },
  "session_3_paper_run": {
   "what": "committed grid, both shapes, N from 1 to 100, 21 calls per shape, public corpus",
   "recorded_in": "results.json on branch docs/embedding-behaviour-paper, 2026-09-22"
  }
 },
 "excluded_from_release": {
  "reason": "Internal production counts from Yugabyte's ingestion database and internal repository indexing run are excluded from public release. The controlled public-corpus replay (308 chunks across 46 CPython and PyPI sources) reproduces the exact library and API code paths without exposing internal table row counts or job logs."
 }
}
