feat(evals): add C++ multi-language retrieval eval and fix namespace-dropped C++ caller qns#556
Conversation
…dropped C++ caller qns
|
@greptile review |
Greptile SummaryThis PR adds a C++ retrieval eval and fixes C++ namespaced caller attribution. The main changes are:
Confidence Score: 5/5The changes appear safe to merge based on the focused eval and caller attribution updates. No blocking correctness issues were identified in the reviewed changes, and the PR includes targeted regression coverage for the namespace caller-name behavior.
What T-Rex did
Reviews (5): Last reviewed commit: "fix(evals): grade C++ calls only when li..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request introduces a C++ call-graph retrieval evaluation harness comparing tree-sitter-based call resolution against a libclang oracle, and fixes a bug where namespaces were dropped from C++ caller qualified names. A review comment was kept which identifies an issue in the libclang initialization loop where a failure to load a candidate prevents trying subsequent candidates.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
T-Rex pricing update — T-Rex was free through June 2026. Effective July 1, 2026, T-Rex adds 2 credits on top of the standard 1-credit review (3 total). T-Rex settings |
Greptile SummaryThis PR adds a C++ retrieval eval and fixes namespaced C++ caller attribution. The main changes are:
Confidence Score: 5/5The changes are well-scoped to C++ call attribution and evaluation tooling, with targeted tests covering the namespace caller-name fix and eval fixture behavior. No code issues were identified in the reviewed changes, and the implementation aligns the call pass with the definition pass while keeping the new eval logic documented and tested.
What T-Rex did
|
|
@greptile review |
|
@greptile review |
|
@greptile review |
Summary
Adds the C++ multi-language retrieval eval (cgr's C++
CALLSvs an independentlibclangoracle) and fixes the dominant cgr bug it surfaced: the call pass dropped the enclosingnamespacefrom C++ caller qualified names.The eval
For each first-party C++ function/member function, which files call it. cgr's C++
CALLSedges (reduced to(caller_file, callee_simple_name)) are graded against call sites extracted bylibclang, over the same first-party name universe. cgr parses C++ with tree-sitter by default (CPP_FRONTEND=libclangoff), solibclangis an independent oracle. Nocompile_commands.jsonis needed: each source is parsed directly with the SDK sysroot, the SDK'slibc++headers, and first-party include dirs; a TU that still errors abstains (held out of the gradedcoveredset on both sides). Both the C and C++ oracles now pin a systemlibclangwhose clang version matches the SDK'slibc++(the pip wheel's older clang cannot parse current C++ standard headers).The bug (root cause)
The definition pass binds a C++ free function or class inside a
namespaceto a namespaced qn (module.ns.fn,module.ns.Class), but the call pass built the enclosing caller's qn without the namespace (module.fn,module.Class.method). Every suchCALLSedge's source pointed at a node that does not exist, so the call never attached. Onleveldb(all innamespace leveldb), 904 of 1227 C++ call sources dangled.Fix: route both the free-function qn (
_build_nested_qualified_nameignorednamespace_definitionancestors) and the class qn through the samecpp_utils.build_qualified_namethe definition pass uses, so caller and node qns always agree. Same family as the Go/Java/Rust caller-qn fixes.RED → GREEN:
test_cpp_namespace_call_caller_qn.pyasserts a namespaced free function and a namespaced inline method attribute their calls to the namespaced caller node; it failed before the fix.Result on
leveldb(40/42 core sources parse cleanly)Dangling C++ call sources: 904 → 251. The oracle grades a call only when libclang resolves its callee to a first-party declaration (
child.referenced), sostd::calls whose simple name collides with a first-party method are not counted.Remaining tail (documented in
evals/README.md, not scoped away)operator=,operator[]):libclangcounts them as method calls; cgr models them asbuiltin.cpp.*— a metric difference, not a misresolution.size,data,empty,clear,begin,end): cgr's name-only fallback binds an externalstd::call to a same-named first-party method; the oracle correctly treats it as external.DB::Open): needs C++ receiver type inference (C++ is not yet in the typed-language set), the same deeper gap as the Go/Java/Rust tails. Follow-on.Full suite: 4242 passed, 12 skipped. ruff/ty clean.