Repository navigation
Benchmark call-graph accuracy (#3332) + two resolver fixes it found - #3378
Merged
Merged
Conversation
#3265 step 5. Level 1, tests/tools/call_graph_accuracy.py: precision/recall of each function's calls_out_to against tree-sitter call nodes. It uses one crucible scan and 11 C-style languages, with both sides following the #3327 contract. The baseline is committed and --ci gates a drop of more than 0.5pp. - Most languages score 85-99% on both precision and recall. - Lost precision is #3359's keyword/annotation captures. - Lost recall is #3361's built-in filter. - ruby recall is 33.7% (paren-less calls; filed #3377). Level 2, tests/tools/call_graph_resolution.py: - python vs pyan3 on the crucible repos: confident links 96.0% precision / 4.0% wrong-target; ambiguous links 85.9% / 14.1%. That 3.5x gap is the evidence for keeping ambiguous links out of the graph. Resolution recall is 30.9% of the pyan edges whose name was extracted. - COBOL vs the hand-verified answer keys: 434/434 confident PERFORM links land on a real, live unit of the same program. Resolver fixes, each found by Level 2 and pinned by a test that fails before it: - A class name shared by several files (zopeneditor's SAM1 and SAM1LIB both declare PROGRAM-ID SAM1) resolved to the first file's method. It now prefers the caller's own file, then the nearest. zopeneditor goes 34.9% -> 100%. - An untyped receiver (`self.body.gen()`) was confident whenever a visible file defined the method, even on ~40 classes. It is now confident only when exactly one visible class defines it, and `receiver` (ambiguous) otherwise. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Runs call_graph_accuracy.py --ci on PRs that touch extraction, the tool or its baseline, with the same pinned crucible and fork fallback as the tree-sitter accuracy audit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
Author
|
Update: the token now has the |
Contributor
2 of 12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#3265 step 5. It publishes the first accuracy numbers for the call graph, and fixes the two resolver bugs those numbers exposed.
Level 1: callee-name extraction (
tests/tools/call_graph_accuracy.py)calls_out_toagainst tree-sitter call nodes. The tree-sitter side names each callee by its rightmost identifier, attributes it to the innermost function, and applies the #3265 step 0: state the calls_out contract (what counts as a call) #3327 rules (constructors and macros count, recursion is dropped).tree_sitter_accuracy_auditowns function detection.--cifails a drop of more than 0.5 pp.Where the gaps come from (
--samples Nprints them):func(612), phpforeach/elseif/unset, csharpforeach/static, rustpub(/let (, java@Annotation(, pythonin (/not (.isinstance,len,assert,map.?/!names, which is new and filed as #3332 follow-up: ruby calls_out misses paren-less calls and ?/! method names (Level-1 recall 33.7%) #3377.Level 2: resolution correctness (
tests/tools/call_graph_resolution.py)Python vs pyan3. pyan3 is already in requirements, runs on the crucible's six repos, and gives 14.6k edges. It is a reference, not an oracle.
self.body, which the engine deliberately treats as ambiguous.def decorator(nested inside each route method. The engine captures the nested declaration as a call (#3327 follow-up: nested declarations captured as calls (contract C5) #3360) and links it to a sibling method's closure. #3327 follow-up: nested declarations captured as calls (contract C5) #3360 removes this class at extraction.COBOL vs the hand-verified answer keys (
mainframe_corpus.py fetch+scan): every confident PERFORM link must land on a real, live unit of the same program.Two resolver bugs Level 2 found (each pinned by a test that fails before the fix)
SAM1.cblandSAM1LIB.cblboth declarePROGRAM-ID SAM1, and SAM1LIB's own PERFORMs resolved into SAM1.cbl because the owner index kept one definition per name. It now keeps all of them and prefers the caller's own file, then the nearest. zopeneditor went 34.9% → 100%. The same fix covers two same-named classes in different packages.Nodes.py,self.body.generate_execution_code()was marked confident because the caller's own file defines the method, on about 40 classes. It's now confident only when exactly one visible class defines the method, andreceiver(ambiguous) otherwise.Not in this PR
call-graph-accuracy-audit.ymlis written and actionlint-clean, but the push token lacks theworkflowscope. It follows oncegh auth refresh -s workflowis done.test_calls_out_contract_3327.py.The full suite passes, the golden crucible is unchanged, and the
ruff,mypyanddead_keyaudits are clean. Per CLAUDE.md, these are the first published numbers, and no README or badge claim is made here.Closes #3332
🤖 Generated with Claude Code