docdrift / data /benchmark.json
ollymcbride4's picture
Deploy 4b02a69: round 7 fixes
a1e7884 verified
Raw History Blame Contribute Delete
18.8 kB
{
"headers": [
"Method",
"True drifts found",
"Findings",
"Precision",
"Tokens"
],
"rows": [
[
"Symbol check alone",
"24 of 45 (19 of 33 on the 9-repo union)",
43,
"58.1%",
"0 (no model calls)"
],
[
"Whole-repo Beam alone",
"11 of 45 (11 of 33 on the 9-repo union)",
19,
"57.9%",
"4,424,575"
],
[
"Hybrid (symbol + whole-repo Beam triage)",
"34 of 45 (22 of 33 on the 9-repo union)",
60,
"75%",
"~9.2M tokens (two whole-repo passes over 12 libraries)"
],
[
"Hybrid + repro-confirmed (strict)",
"30 of 45 (19 of 33 on the 9-repo union)",
41,
"92.7%",
"~9.3M tokens (two whole-repo passes plus repro scripts)"
],
[
"Chunked Beam (~32k chunks) (9-repo union)",
"15 of 33",
25,
"60%",
"3,529,945"
],
[
"Chunked Beam (~128k chunks) (9-repo union)",
"9 of 33",
13,
"69.2%",
"3,342,201"
]
],
"notes_markdown": "- The **45-drift reference set** is the union of what the methods found, so it favours them. Labels were checked against the source by an AI reviewer. The stored field is still `hand_verdict`.\n- Beam triage judged **56** candidates and rejected **0** of 32 true candidates, while removing **15** of 24 false or unclear ones. 11 of 12 libraries were triaged; structlog failed; cattrs needed 2 calls.\n- **2 false + 1 unclear (werkzeug S38, S39 false; S41 unclear)** received a strict repro badge.\n- structlog: Beam's triage reply had no JSON, so its 6 candidates are shown untriaged.\n- Chunked Beam alone found **11** local docstring/prose drifts the hybrid misses.\n- The strict repro rule was set after the first repro run.\n- No prompt caching was observed on triage calls (each billed the full ~300–400k pack).\n- Both whole-repo passes (first sweep + hybrid triage) cost about **9.2M** tokens (4,424,575 + 4,739,392 = 9,163,967). End-to-end including repro is **9,302,105 (~9.3M)** (4,424,575 + 4,739,392 + 138,138). The cheaper symbol-only-candidate variant was not run.\n- The local-file vs whole-repo ablation spent **1,948,469** extra tokens. That ledger is not part of the 9.3M hybrid end-to-end.\n- The docs-pass + 32k docstring-chunk extra pass spent **7,713,453** extra tokens. That ledger is not part of the 9.3M hybrid end-to-end.\n- The matched-cost retrieval control spent **3,957,434** extra tokens. That ledger is not part of the 9.3M hybrid end-to-end.\n- The tomlkit `docdrift run` recording spent **185,842** extra tokens. Matched-cost controls spent 3,957,434 + 7,528,878 (extension). Together with the recording that is **11,672,154**, not part of the 9.3M hybrid end-to-end.",
"funnel": [
{
"step": "Symbol check",
"true": 24,
"detail": "0 Beam tokens"
},
{
"step": "Beam triage",
"true": 34,
"detail": "rejected 0 of 32 true; removed 15 of 24 false/unclear"
},
{
"step": "Strict repro",
"true": 30,
"detail": "38 of 41 badges were real; 2 false + 1 unclear (werkzeug S38, S39 false; S41 unclear)"
}
],
"recall": {
"max_probe_tokens": 947446,
"far_hits": [
5,
6
],
"chunk_far": [
0,
6
],
"focused_tokens": 4755853,
"chunk_baseline_tokens": 1000174,
"focused_multiplier": 4.8,
"docstring_pooled": "1/32 pooled over 2 seeds (0/18 + 1/14)",
"chart": "assets/recall_vs_distance.png",
"source": "results_live/recall/",
"buckets": [
"~1k",
"~10k",
"~50k",
"~100k",
"~200k",
"~400k",
"700k+"
],
"default_series": [
{
"id": "focused_seed1",
"label": "focused whole-context",
"points": [
0.25,
0.0,
0.25,
0.75,
0.0,
0.25,
0.8333333333333334
]
},
{
"id": "whole_seed1",
"label": "whole-repo",
"points": [
0.0,
0.0,
0.0,
0.5,
0.0,
0.0,
0.5
]
},
{
"id": "chunk128k_seed1",
"label": "chunked 128k",
"points": [
0.25,
0.0,
0.5,
0.5,
0.0,
0.0,
0.0
]
}
]
},
"chart_present": true,
"ablation": {
"available": true,
"headers": [
"Metric",
"Whole-repo (reused hybrid)",
"Local-file only",
"Whole-repo, subset (27)",
"Local, subset (27)",
"Whole-repo rerun, subset (27)"
],
"rows": [
[
"True candidates kept",
"32/32",
"32/32",
"13/13",
"13/13",
"13/13"
],
[
"False/unclear candidates rejected",
"15/24",
"15/24",
"9/14",
"12/14",
"10/14"
],
[
"Precision (kept that are true)",
"0.78 (32/41)",
"0.78 (32/41)",
"0.722 (13/18)",
"0.867 (13/15)",
"0.765 (13/17)"
],
[
"Verdict accuracy",
"0.839",
"0.839",
"0.815",
"0.926",
"0.852"
],
[
"Citation hits gold file:line (gradable)",
"41/52",
"34/52",
"19/26",
"19/26",
"22/26"
],
[
"Right verdict + gold citation",
"39/52",
"33/52",
"17/26",
"19/26",
"20/26"
],
[
"Citation verified (quote matches source)",
"54/56",
"52/56",
"25/27",
"26/27",
"27/27"
],
[
"Cross-file cases: right verdict",
"26/30",
"26/30",
"12/13",
"12/13",
"12/13"
],
[
"Cross-file cases: right verdict + citation",
"25/30",
"14/30",
"12/13",
"8/13",
"12/13"
],
[
"Evidence outside local context: right verdict",
"12/13",
"12/13",
"4/4",
"4/4",
"4/4"
],
[
"Evidence outside local context: right verdict + citation",
"11/13",
"0/13",
"4/4",
"0/4",
"4/4"
],
[
"Beam tokens",
"4,022,532 (11 calls; 4,331,995 as spent incl. a cattrs re-send)",
"830,527 (56 calls; 848,654 as spent incl. 1 re-send)",
"—",
"—",
"1,099,815"
]
],
"claim": "Long context didn't make verdicts more accurate here; it made them cite the real evidence across files, which is what we verify and show maintainers.",
"caveats": [
"n=56 judged candidates (structlog excluded; its hybrid triage failed).",
"Labels and gold file:line were checked against the source by an AI reviewer, not a human maintainer.",
"Whole-repo is one batched call per repo; local is one call per candidate.",
"Local was given every file the candidate already named.",
"6 of 56 disagreements split 3-3. Stability rerun: 26/27 verdicts matched.",
"Whole-repo used 4,022,532 tokens vs 830,527 for local (~4.8×). This ablation run's own ledger is 1,948,469 tokens over 60 calls; that is extra experimental cost, not part of the 9.3M hybrid end-to-end.",
"Matched-cost retrieval control: 3,888,241 attributable / 3,957,434 as spent (57 calls; same 56 candidates). Extra experimental cost, not part of the 9.3M hybrid end-to-end.",
"Pre-registered matched-cost extension: 7,528,878 tokens (63 more items). Extra experimental cost, not part of the 9.3M hybrid end-to-end."
],
"n": 56,
"disagreements": 6,
"stability_agree": 26,
"stability_n": 27,
"whole_tokens": 4022532,
"local_tokens": 830527,
"token_multiplier": 4.8,
"ablation_ledger_tokens": 1948469,
"ablation_ledger_calls": 60,
"cross_file_cite_whole": "25/30",
"cross_file_cite_local": "14/30",
"outside_cite_whole": "11/13",
"outside_cite_local": "0/13",
"accuracy_whole": "0.839",
"accuracy_local": "0.839",
"accuracy_whole_subset": "0.815",
"accuracy_local_subset": "0.926",
"outside_cite_whole_subset": "4/4",
"outside_cite_local_subset": "0/4",
"subset_note": "On the 27-item rerun subset, local-only scored higher on verdict accuracy (0.926 vs 0.815). Whole-repo's advantage is citation: 4/4 vs 0/4 when the proof lives outside the candidate's files.",
"matched_available": true,
"why_matched_cost_note": "**Is it the whole repo, or just more tokens?** We gave a retrieval baseline the **same** Beam budget as whole-repo triage. That came to 3,957,434 against 4,022,532 tokens as spent (3,888,241 attributable; 96.7% of whole-repo) over the same 56 candidates. For each candidate, it got the local files plus the symbol definitions, imports and BM25 matches that fit in about 56k tokens.\n\nVerdict accuracy came out the same (46/56 against 47/56). Grounding still favoured the whole repo: the right verdict **and** the right cross-file line in 25/30 cases, against 19/30 for retrieval. Where the evidence lives outside the files the doc points at, the figures are 11/13 against 6/13. Retrieval pulled in importers or re-exports rather than the defining file in 5 of 13 outside-local items.\n\nThat gap is suggestive, not proven, at this sample size (exact McNemar p = 0.070). We pre-registered the test and report it as \"not shown at this n\".\n\n**Pre-registered extension.** We then added 63 items (57 planted renames, 6 real structlog candidates), frozen before any Beam call (design sha256 42f6b6fe…c996). Pooled over 78 cross-file items, the right verdict **and** the right line came out 52/78 for the whole repo against 38/78 for retrieval (exact McNemar p = 0.0094). Verdict accuracy still did not differ (108/119 against 105/118). The new items alone give p = 0.096 (\"not shown at this n\"), and the pooled result relies on one pre-registered re-send of a whole-repo call that failed to parse (p = 0.18 without it). The honest takeaway: whole-repo context doesn't make Beam **judge** better, but it helps Beam **point at the right line** more often, for no more spend than retrieval.",
"cross_file_cite_matched": "19/30",
"outside_cite_matched": "6/13",
"accuracy_matched": "0.821",
"matched_tokens": 3888241,
"matched_ledger_tokens": 3957434,
"matched_ledger_calls": 57,
"matched_mcnemar_p": "0.070",
"gold_file_retrieved": "8/13",
"gold_file_missed": 5,
"accuracy_frac_matched": "46/56",
"accuracy_frac_whole": "47/56",
"matched_ext_available": true,
"matched_ext_cross_whole": "52/78",
"matched_ext_cross_matched": "38/78",
"matched_ext_p": "0.0094",
"matched_ext_tokens": 7528878,
"matched_ext_outside_whole": "38/61",
"matched_ext_outside_matched": "25/61",
"matched_ext_outside_p": "0.0146"
},
"beamv3": {
"available": true,
"title": "Catching what one whole-repo call misses",
"claim": "32k docstring chunks recovered 7 of the 11 drifts hybrid missed; the docs-focused whole-context pass recovered 1; 3 prose-doc drifts are still missed. Union coverage 34 → 42 of 45. Marginal cost ~140k tokens per extra drift for 32k chunks vs ~1.5M for the docs pass. Precision of the new findings is a lower bound: 18.5% for hybrid + 32k-chunk new items (60.0% among labelled); most are unlabelled and are not counted as true. 7 new true drifts sit outside the labelled 45 (checked against the source by an AI reviewer). Stability repeat: 18/19 verdicts agreed.",
"recipe": "Recommended: symbol check + whole-repo Beam triage, plus 32k docstring chunks if you want more coverage at lower precision.",
"headers": [
"mode",
"findings",
"true",
"false",
"unclear",
"unlabelled",
"precision LB",
"among labelled",
"of 45",
"extra of 45 vs hybrid",
"new (AI)",
"tokens",
"tokens / distinct true",
"marginal tokens / extra drift"
],
"rows": [
[
"Hybrid (existing, for reference)",
"60",
"45",
"-",
"-",
"-",
"75.0%",
"-",
"34",
"-",
"-",
"4,739,392 (triage pass only)",
"139,394",
"-"
],
[
"Hybrid + repro strict (existing)",
"41",
"38",
"-",
"-",
"-",
"92.7%",
"-",
"30",
"-",
"-",
"4,877,530",
"-",
"-"
],
[
"(a) docs-focused pass alone",
"43",
"17",
"8",
"2",
"16",
"39.5%",
"63.0%",
"15",
"1",
"2",
"4,485,924",
"263,878",
"-"
],
[
"(b) py32k docstring chunks alone",
"72",
"18",
"3",
"5",
"46",
"25.0%",
"69.2%",
"13",
"7",
"5",
"1,680,568",
"93,365",
"-"
],
[
"Hybrid + (a): new items only",
"26",
"4",
"4",
"2",
"16",
"15.4%",
"40.0%",
"35",
"1",
"2",
"9,225,316",
"249,333",
"1,495,308"
],
[
"Hybrid + (b): new items only",
"65",
"12",
"3",
"5",
"45",
"18.5%",
"60.0%",
"41",
"7",
"5",
"6,419,960",
"139,564",
"140,047"
],
[
"Hybrid + (a) + (b): new items only",
"91",
"16",
"7",
"7",
"61",
"17.6%",
"53.3%",
"42",
"8",
"7",
"10,905,884",
"222,569",
"411,099"
],
[
"Hybrid + v3 new items strict-confirmed by repro",
"17",
"4",
"0",
"0",
"13",
"23.5%",
"100.0%",
"36",
"2",
"2",
"11,344,203",
"298,532",
"1,651,203"
]
],
"caveats": [
"This is a Benchmark-tab experiment, not a headline number. Headline coverage stays 34 of 45.",
"Precision LB = labelled-true / all findings. Unlabelled findings are not counted as true.",
"'Among labelled' is biased upward: the labelled items are the ones that hit known drifts.",
"15 new-item labels were checked against the source by an AI reviewer at the pack ref, not a human maintainer. Unclear counts as not-true.",
"3 still-missed drifts are prose-doc: C:attrs-py2-reprs, C:httpx-sslcontext, C:mm-quotes-400.",
"Whole-repo is one call per repo; the extra pass is one call per 32k Python-docstring chunk; docs is one focused whole-context call per repo.",
"This run's own ledger is 7,713,453 tokens over 168 calls. That is extra experimental cost, not part of the 9.3M hybrid end-to-end.",
"The shipped CLI is still symbol check + one whole-repo triage. 32k docstring chunks are an experimental extra pass (`scripts/beamv3.py`), not a `--docstring-chunks` flag."
],
"recovered": 8,
"missed": 11,
"py32k_extra_of_45": 7,
"docs_extra_of_45": 1,
"still_missed": [
"C:attrs-py2-reprs",
"C:httpx-sslcontext",
"C:mm-quotes-400"
],
"union_of_45": 42,
"hybrid_of_45": 34,
"new_ai_verified": 7,
"py32k_precision_lb": "18.5%",
"py32k_precision_labelled": "60.0%",
"py32k_marginal": 140047,
"docs_marginal": 1495308,
"stability_agree": 18,
"stability_n": 19,
"ledger_tokens": 7713453,
"ledger_calls": 168
},
"token_footnote": "~9.2M tokens (two whole-repo passes over 12 libraries). 4,424,575 first sweep + 4,739,392 hybrid triage. +138,138 for repro scripts = 9,302,105 end to end. Extra experimental runs, not in the 9.3M: ablation 1,948,469; beam v3 7,713,453; matched-cost control 3,957,434; matched-cost extension 7,528,878; tomlkit CLI run 185,842.",
"pack_coverage": {
"available": true,
"headers": [
"Library",
"Files packed",
"Tokens packed",
"Cap",
"Truncated",
"Skipped (binary/undecodable)",
"Last packed file"
],
"rows": [
[
"starlette",
"119",
"327,836",
"400,000",
"yes",
"0",
"tests/middleware/test_middleware.py"
],
[
"httpx",
"89",
"327,864",
"400,000",
"yes",
"0",
".github/PULL_REQUEST_TEMPLATE.md"
],
[
"click",
"73",
"327,831",
"400,000",
"yes",
"0",
"tests/test_types/test_Path.py"
],
[
"structlog",
"115",
"318,657",
"400,000",
"no",
"3",
"tests/processors/__init__.py"
],
[
"nox",
"103",
"294,382",
"400,000",
"no",
"0",
"tests/resources/sym_dir/sym_file.txt"
],
[
"arrow",
"50",
"280,937",
"400,000",
"no",
"0",
"tests/__init__.py"
],
[
"cattrs",
"170",
"262,894",
"400,000",
"no",
"0",
"tests/strategies/__init__.py"
],
[
"marshmallow",
"96",
"247,224",
"400,000",
"no",
"0",
"tests/__init__.py"
],
[
"attrs",
"116",
"327,857",
"400,000",
"yes",
"1",
".github/workflows/codspeed.yml"
],
[
"jinja",
"105",
"300,733",
"400,000",
"no",
"0",
"tests/res/__init__.py"
],
[
"werkzeug",
"138",
"327,823",
"400,000",
"yes",
"6",
".github/pull_request_template.md"
],
[
"pydantic-settings",
"56",
"311,093",
"400,000",
"no",
"0",
"tests/example_test_config.json"
]
],
"note": "truncated: true means the packer hit the remaining-budget cutoff while files were still in the queue. skipped_paths only records binary or undecodable files, so the dropped remainder is not listed. 5 of 12 first-sweep packs hit the remaining-budget cutoff (starlette, httpx, click, attrs, werkzeug). The packer puts tests, CI and examples last; exact dropped paths were not recorded in the traces. Starlette packed 119 files (327,836 of a 400,000 token cap), including test files; the last packed file was tests/middleware/test_middleware.py."
},
"recall_extra": true
}