Skip to content

cpp call graph: name template conversion operators as the engine does (Part of #3784) - #6490

Merged
squid-protocol merged 1 commit into
mainfrom
churn/3784-20261024T1537Z
Oct 24, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
churn/3784-20261024T1537Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #3784. Test/doc/baseline only: no engine change, no golden bless.

What changed

  • tests/tools/clang_callgraph.py: a template conversion operator is named without its template arguments (operator Box, not operator Box<int>), as the engine names it.
  • Test for it, regenerated cpp baseline (judged 1739 -> 1741, unmapped 1691 -> 1680; precision, recall and resolution recall unchanged), docs/graph_accuracy.md C++ section.

Class / Sibling gaps

Class: reference-adapter naming that differs from the engine's, so a def cannot be mapped by (path, name, line). Fixed here: template conversion operators (small: 11 links). Sibling gaps, not fixed:

  • gtest TEST(suite, name) bodies (6,117 of 6,409 caller_unmapped). I implemented the adapter naming; mapping them dropped confident precision 91.1 -> 79.1 and resolution recall 63.8 -> 56.5 (gate fails), so it is NOT in this PR. Cause: fmt::format(...) calls from test bodies resolve at the qualified step to formatter<X>::format in test/format-test.cc (525 wrong links, 242 qualified, 155 import, 102 file). Pre-existing resolver defect, hidden while callers were unmapped. A detector def_shape=signature for TEST bodies did not help (the targets are real methods), so I dropped it.
  • Engine ::name qualifier loss (detector._extract_name, 20 functions in fmt), needs a golden bless.
  • Template-overload line mismatches; not_extracted/other (gtest EXPECT_* macro callees, static_cast conversion calls); TYPED_TEST bodies are not extracted by the engine; objective-c reference.

Remaining slices

  1. Resolver: stop the qualified/import/file steps picking an unrelated same-name member for ns::f(...). 2. Then the gtest adapter naming (GTEST_MACRO on the TestBody line, 2nd macro argument). 3. ::name loss.

Plan deviation

The plan was adapter-only naming of gtest bodies plus conversion operators. The gtest half fails the gate for the reason above, so the PR shrank to the conversion operators.

Lessons for agents

Mapping many previously caller_unmapped edges surfaces resolver errors that were hidden; check the wrong samples' targets before attributing a precision drop to the new naming.

Cross-repo: none.

🤖 Generated with Claude Code

… (Part of #3784)

The libclang adapter spelled `operator Box<int>`; the engine says `operator Box`. Strip the
template arguments like constructors. Document why gtest TEST bodies stay unmapped.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 24, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 24, 2026 15:59
@squid-protocol
squid-protocol enabled auto-merge (squash) October 24, 2026 16:03
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol merged commit 26670a2 into main Oct 24, 2026
51 checks passed
@squid-protocol
squid-protocol deleted the churn/3784-20261024T1537Z branch October 24, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant