How accurate are code-graph call edges?

I scored the call edges that codegraph and code-graph-rag produce against compiler-backed references, on the builds of Nov 17 and on their latest releases.

Result. I scored codegraph and code-graph-rag on Nov 17, and again on their latest releases, with only the tool builds changed. Both runs are scored here under the current scoring rules, SPEC version 7.0 (see "Scoring changes since Nov 17"). On the two held-out repositories (not as fresh as planned, see the erratum), codegraph's average precision went from 96.9% to 99.4% and its recall from 92.7% to 95.2%. code-graph-rag's precision stayed at about 98.6%. Its recall depends on its Go type checker, which it uses by default when Go 1.27.2 or newer is installed and which my first runs left off (see the Go checker erratum). With the checker off its held-out recall went from 88.0% to 90.4%, and with it on from 93.2% to 95.4%. This post shows both. All of codegraph's held-out gain is on httpx, a repository one of its fixes came from, so it is not blind evidence.

Precision here covers the edges I could check: an edge is scored only where the reference resolves that call site, and guessed edges are left out. With the Go checker off, most of code-graph-rag's remaining recall gap is edges it labels as heuristic, which graph-assay does not count. With the checker on, none of that gap is left in the two Go repositories. Counting each caller and callee pair once, held-out precision in the rerun was 99.4% for codegraph and 93.5% for code-graph-rag.

graph-assay is a benchmark I maintain. It scores the call edges that code-graph tools produce against SCIP indexes built by compiler-backed indexers. A call edge counts as right when it reaches the definition SCIP resolves at that call site.

Data. Eight repositories from graph-assay's preregistered corpus (five dev, three held-out, at pinned commits), each tool's Nov 17 build and its latest release (codegraph 1.6.7, code-graph-rag 0.7.180), all scored on Dec 3, 2026 under SPEC 7.0. Every number below comes from the results-2026-12 release.

Baseline run (Nov 17): held-out results #

The held-out repositories are meant to be indexed only for published tables (that did not hold for all of them, see the erratum); the dev repositories are the ones used to build the scorer. This was the fourth held-out run, all on Nov 15 to 17. Results from the earlier runs prompted two scorer rules, each re-checked on dev (see Caveats). Call sites, precision / recall, in percent, re-scored under SPEC 7.0:

Repository Language codegraph code-graph-rag, Go checker off code-graph-rag, Go checker on
httpx Python 93.8 / 87.0 97.3 / 87.9 97.3 / 87.9
cobra Go 100.0 / 98.5 99.6 / 88.2 100.0 / 98.5
Held-out average 96.9 / 92.7 98.5 / 88.0 98.6 / 93.2

The checker only changes Go results, so the Python rows are the same in both code-graph-rag columns. The scorer's tables use code-graph-rag's default, the checker on; the averages with it off are the mean of the two rows above, so they have no interval.

Guessed edges are not scored for either tool. codegraph's guessed edges and code-graph-rag's heuristic edges are reported apart and left out of precision. For code-graph-rag, a call site found only by a heuristic edge also does not count as found. If those sites counted, its held-out recall would be about 96.8% with the checker off and 97.1% with it on. So these numbers measure the edges each tool stands behind and SCIP can check, not its whole output. In httpx, SCIP gives no answer for 616 of codegraph's 2,011 call edges and 1,403 of code-graph-rag's 4,968, and 340 of code-graph-rag's are reads of Python properties, which SPEC 7.0 leaves out; precision there covers 1,395 and 1,862 edges. In cobra, with the checker off, it covers 2,205 of codegraph's 2,651 and 2,151 of code-graph-rag's 3,139; most of the rest are struct literals, which are out of scope, and code-graph-rag's heuristic edges. Heuristic edges are a large share of code-graph-rag's output: 919 of 4,968 call edges in httpx and 545 of 3,139 in cobra with the checker off (227 with it on).

With only two scored held-out repositories, the averages and their 95% intervals say little on their own (codegraph 93.8 to 100.0 / 87.0 to 98.5; code-graph-rag with the checker on 97.3 to 100.0 / 87.9 to 98.5). Read the per-repository rows.

Erratum (Dec 1, 2026): the held-out repositories were not all unseen #

graph-assay's corpus file says it was registered on Nov 5 "before any held-out repo was indexed or read". Checking my own records before publishing, I found that is not true for two of the three. No score changes; what the held-out label means does.

I found no earlier use of any of them with code-graph-rag. I searched my issues and pull requests in both tools' repositories, my planning notes and codegraph's evaluation list, so use that left no record there would not show up. The scorer was not blind either: results from earlier held-out runs prompted two of its rules (see Caveats).

So read "held-out" here as "not used as a dev repository", not as a blind test. The codegraph held-out average mixes httpx with cobra; the rows are more informative. The preregistered corpus file stays unchanged as the record, with this erratum beside it, and a blind run needs new repositories (graph-assay#108).

Erratum (Dec 1, 2026): code-graph-rag's Go type checker was off #

code-graph-rag can add call edges from Go's own type checker (go/types) to its usual parsing. Its documentation says this is on by default (GO_FRONTEND=auto) when Go 1.27.2 or newer is on the PATH. My benchmark ran code-graph-rag with a PATH that had no Go on it, and the Go in my image was 1.25.4, older than it asks for. So it used its parser-only mode in both runs, and I described that as default settings. That was my mistake, not a fault in code-graph-rag.

graph-assay's reproduction image now installs that Go, so code-graph-rag runs with the checker on by default, and CGQA_CGR_GO_FRONTEND=treesitter turns it off (see Reproduce). Every table in this post shows both settings. The checker changes only the two Go repositories, mux and cobra. On Dec 1 I ran mux and cobra three times per setting; the three runs of each setting gave the same scores.

Read the "on" scores with care. The reference for Go is scip-go, which also uses go/types, so "on" measures agreement between two programs that use the same type checker. It is not an independent check. "On" also needs Go 1.27.2 or newer and, the first time, a download of the checker's modules; someone without those gets the "off" result. Indexing takes about two to three times as long with the checker on, on both mux and cobra, in the Dec 1 runs. (I give the ratio, not seconds: the Dec 3 runs shared the machine with other work, which slows every timing.)

codegraph has no comparable setting, so it has one column.

Baseline run (Nov 17): dev results #

The dev repositories were used while building the scorer, so treat them as a second look; the held-out results are the headline. Call sites, precision / recall, in percent, re-scored under SPEC 7.0:

Repository Language codegraph code-graph-rag, Go checker off code-graph-rag, Go checker on
requests Python 82.7 / 86.6 99.3 / 86.1 99.3 / 86.1
click Python 98.5 / 90.9 98.0 / 84.8 98.0 / 84.8
mux Go 88.7 / 82.6 99.0 / 69.6 100.0 / 96.2
express JavaScript 97.1 / 100.0 96.4 / 97.8 96.4 / 97.8
Dev average 91.8 / 90.0 98.2 / 84.6 98.4 / 91.2

On the function-pair track (each caller and callee pair counted once), codegraph scores 96.8 / 94.0 held-out and 90.6 / 93.2 dev. code-graph-rag scores 92.8 / 88.0 held-out and 81.2 / 85.1 dev with the checker off, and 93.3 / 92.8 and 81.7 / 89.1 with it on. Its lowest pair precision is in click (67.5%) and express (64.1%); see "Where the weakest numbers come from".

Scoring changes since Nov 17 (SPEC 5.0 to 7.0) #

The Nov 17 results, and the notice I sent both maintainers that day, were scored under SPEC 5.0. Every number in this post is re-scored under SPEC 7.0 from the same tool builds and reference indexes. Three changes move the numbers here, and each applies to every tool the same way:

Under SPEC 5.0 the held-out averages were: codegraph 96.9 / 92.8 (baseline) and 99.4 / 95.3 (rerun); code-graph-rag 98.6 / 88.1 and 98.8 / 90.4 with the checker off, and 98.8 / 93.3 and 98.8 / 95.5 with it on.

Rerun on the latest releases #

Builds: codegraph 1.6.7 (commit 1dd70eb2, released Nov 30) and code-graph-rag 0.7.180 from PyPI (released Dec 1). Only the tool builds changed: the same scorer (SPEC 7.0), corpus, reference indexers and image recipe as the re-scored baseline. Call sites, precision / recall, in percent, with the re-scored Nov 17 figure in brackets:

Repository Language codegraph 1.6.7 code-graph-rag 0.7.180, Go checker off code-graph-rag 0.7.180, Go checker on
httpx Python 98.8 / 92.0 (93.8 / 87.0) 97.3 / 92.3 (97.3 / 87.9) 97.3 / 92.3 (97.3 / 87.9)
cobra Go 100.0 / 98.5 (100.0 / 98.5) 100.0 / 88.5 (99.6 / 88.2) 100.0 / 98.5 (100.0 / 98.5)
Held-out average 99.4 / 95.2 (96.9 / 92.7) 98.6 / 90.4 (98.5 / 88.0) 98.6 / 95.4 (98.6 / 93.2)
95% interval, held-out 98.8 to 100.0 / 92.0 to 98.5 97.3 to 100.0 / 92.3 to 98.5
requests Python 84.6 / 91.0 (82.7 / 86.6) 99.3 / 90.2 (99.3 / 86.1) 99.3 / 90.2 (99.3 / 86.1)
click Python 99.6 / 92.6 (98.5 / 90.9) 97.7 / 88.6 (98.0 / 84.8) 97.7 / 88.6 (98.0 / 84.8)
mux Go 99.2 / 92.7 (88.7 / 82.6) 99.0 / 69.6 (99.0 / 69.6) 100.0 / 96.2 (100.0 / 96.2)
express JavaScript 98.8 / 100.0 (97.1 / 100.0) 96.4 / 97.8 (96.4 / 97.8) 96.4 / 97.8 (96.4 / 97.8)
Dev average 95.5 / 94.1 (91.8 / 90.0) 98.1 / 86.6 (98.2 / 84.6) 98.3 / 93.2 (98.4 / 91.2)
95% interval, dev 88.3 to 99.4 / 91.4 to 98.1 97.0 to 99.6 / 89.4 to 97.0

Function pairs, precision / recall: codegraph 99.4 / 96.7 held-out and 95.0 / 95.5 dev; code-graph-rag 93.2 / 90.8 held-out and 81.5 / 87.3 dev with the checker off, 93.5 / 95.4 and 82.0 / 91.3 with it on. In httpx, precision covers 1,401 of codegraph's 2,017 call edges and 1,933 of code-graph-rag's 4,935; the rest are heuristic edges, property reads or calls SCIP gives no answer for. If code-graph-rag's heuristic-only sites counted (52 in httpx, 25 in requests, 99 in click, 4 in express, and with the checker off 216 in cobra and 106 in mux), its held-out recall would be about 96.9% (checker off) and 97.1% (on), and its dev recall about 90.5% and 95.2%.

The held-out repositories are not blind for codegraph. codegraph 1.6.4 and 1.6.6 fix six issues I filed: #2957 (from httpx, see the erratum) and #3237 before the corpus was registered on Nov 5, and four follow-ups on Nov 21, after the baseline. Any codegraph gain on httpx may partly reflect fixes aimed at that repository, so do not read the rerun's held-out rows as a blind test. The next blind run needs new held-out repositories.

What moved. codegraph's dev gain is mostly mux (88.7 / 82.6 to 99.2 / 92.7), most likely the Go new(T) fix in #3237, and its held-out gain is all httpx (inferred, not traced). code-graph-rag's recall rises on httpx, requests and click, where many sites that only a heuristic edge reached now have an exact one (inferred: heuristic-only sites fall from 119 to 52, 67 to 25 and 188 to 99). In ky, which is diagnostic and in no average, codegraph's recall falls from 76.3 to 74.3: it loses 62 .extend() calls that it used to link by unique name (codegraph#3572 covers part of that).

What was measured in the baseline run #

Where the weakest numbers come from #

Counts below are verified. Causes are my reading of them unless I say they were confirmed. Counts marked "Nov 17" come from the SPEC 5.0 scoring and were not recounted under 7.0; the rules that changed (above) touch few of these sites.

codegraph

code-graph-rag

Since the baseline run. Both codegraph issues named above were fixed in codegraph 1.6.4 (#2957 and #3237). Four related issues I filed later were fixed in 1.6.6 (#3443, #3445, #3446 and #3448). The baseline numbers include none of these fixes; the rerun does.

Caveats #

Disclosure and the maintainers #

I contribute to codegraph: I have filed issues and sent PRs there, and I have filed issues on code-graph-rag. I run graph-assay because I want these tools to be accurate, and a benchmark of each tool helps everyone who needs to know their agents are working from a correct code graph. I will be adding more tools.

Two other benchmarks score code-graph tools against compiler-grade references, repowise-bench and PipesHub's codegraph benchmarks. Both are run by vendors whose own tool is in the comparison. graph-assay preregisters its corpus, pins every build and publishes the command to reproduce each run, so anyone can check the numbers, including the codegraph ones.

repowise-bench reports codegraph 1.5.0 (measured in August) at 0.929 precision and 0.763 recall on cobra, far below the cobra row here. I ran its own scoring code on the codegraph 1.6.7 index from this rerun, against its Go reference built on graph-assay's cobra commit: 0.999 precision and 0.751 recall. The precision gap closes because 1.6.7 is a newer build; the recall gap is a difference in what counts as a call. Of the 511 edges its reference has and codegraph lacks, 442 go to unnamed function literals, which codegraph makes no nodes for, and 68 exist only through interface or function-value dispatch, which its reference fans out to every possible target. The one left over is a call graph-assay also counts as missed.

Results were shared with both maintainers on Nov 17, ahead of publication, and I sent code-graph-rag's maintainer the Go checker correction on Dec 2. Responses will be added here. Since Nov 17, codegraph has shipped fixes for both issues named in that notice (1.6.4), with follow-up fixes in 1.6.6; the rerun above measures them.

Reproduce #

The full tables, per-site and per-pair results, fixture verdicts and conformance logs are in the graph-assay release for this run, results-2026-12. To reproduce the baseline builds under SPEC 7.0:

git clone https://github.com/inth3shadows/graph-assay && cd graph-assay
git checkout fd05dcd0006130562358833143b556791ef718ea
docker build --platform linux/amd64 -t graph-assay-repro .
mkdir -p out-dev out-heldout
docker run --rm --security-opt seccomp=unconfined -v "$PWD/out-dev:/results" graph-assay-repro --split dev
docker run --rm --security-opt seccomp=unconfined -v "$PWD/out-heldout:/results" graph-assay-repro --split heldout --publish

That runs code-graph-rag with its Go checker on. Adding -e CGQA_CGR_GO_FRONTEND=treesitter to docker run turns it off. For the rerun builds, check out the tag results-2026-12 instead (release) and run the same commands.

Corrections will be logged and dated in the graph-assay repository. New releases: I'll re-score new releases of either tool. If you maintain one and want a run, open an issue.

The takeaway #

On the edges that can be checked, both tools are right more than 98% of the time on average on the held-out repositories in the rerun, and for both, calls they miss cost more than edges they get wrong. Both improved since Nov 17: codegraph mainly where fixes targeted known cases (Go new(T) on dev, httpx on held-out), code-graph-rag in recall. With code-graph-rag's Go checker on, its held-out recall (95.4%) is about the same as codegraph's (95.2%), but half of that average comes from cobra, where it shares a type checker with the reference; with the checker off it is 90.4%. Two held-out repositories, one of them not fresh for codegraph, are too few to rank the tools. The next run needs new repositories.

Corrections #

Later corrections will be listed here with their date.

Questions or corrections: [email protected] · All writing