Skip to content

Call-graph accuracy: measure zig, dart, haskell, perl (Part of #3641) - #6401

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

squid-protocol merged 1 commit into
mainfrom
churn/3641-20261024T0720Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #3641 (step 2, calls half), after #6396.

call_graph_accuracy.py now scores callee names for zig, dart, haskell and perl against tree-sitter call nodes (language-crucible). Measured, raw, all shapes unvalidated:

lang functions precision recall TP FP FN
zig 3539 98.2% 92.6% 19147 352 1539
dart 1734 95.7% 95.0% 2428 109 128
haskell 142 44.2% 27.4% 103 130 273
perl 943 87.9% 56.6% 2573 353 1971

Class / Sibling gaps

Class: tree-sitter-comparable languages whose calls call_graph_accuracy.py does not yet score, where the grammar has no call_expression-shaped node. Covered here: zig, dart, haskell, perl (each with its own harness reader and tests, incl. string/comment decoys). Harness mechanisms: perl call node types plus shift-style func1op built-ins; haskell leftmost apply function and the $ infix (other operators are no call); zig FnCallArguments with the preceding sibling as callee, @ dropped as the engine does; dart argument_part with identifier / .x / ?.x / ..x selector callee, new/const constructors; zig and dart bodies are siblings of the signature and are attributed to it. Sibling gaps (not here, no burned-estate program needs any): apex, fortran, matlab, objective-c, powershell, tcl, groovy, solidity, ada, scheme, makefile calls remain unmeasured. Engine leads surfaced, not fixed (engine code untouched): haskell calls_out is weak (locals/params as calls, forM-style applies missed); perl misses paren-less method calls and counts some scalars; dart misses generic constructor calls Foo<T>(...); zig drops @import (likely a dependency, not a call).

Notes

  • Harness faults found by the first run and fixed before seeding: zig builtin sigil (@intCast vs engine intCast, 2.6k fake FPs), dart ?.call( and cascades, perl shift.
  • Perl defined/exists/ref/keys and haskell constructors (Just x) count as calls on the tree-sitter side (built-ins and constructors count per #3327 follow-up: built-ins are calls -- trim _CALLS_OUT_GLOBAL_IGNORE to keywords (contract C2) #3361); whether the engine's side should is a ledger question, left unvalidated.
  • Ledger: new-language entries only (4956 added lines, 0 removed); the old languages' entries are untouched. Baseline: additions only.
  • Gates: pr_gates.py --fast 7/7; test_call_graph_accuracy.py + test_graph_coverage_chart.py + tree-wide guards pass. Engine untouched, so no golden bless.

🤖 Generated with Claude Code

Step 2 of the epic, calls half. call_graph_accuracy.py scores callee names for four more
tree-sitter-comparable languages. Each grammar spells a call differently: perl has
function/method/ambiguous/func1op call nodes, haskell a curried apply chain plus the `$`
infix, zig a FnCallArguments list whose callee is the sibling before it (builtin sigil
dropped, as the engine does), dart an argument_part after an identifier or (null-aware,
cascade) selector. zig FnProto and dart *_signature hold no body, so the body sibling is
attributed to the signature. Baseline and ledger seeded (new shapes only, all unvalidated).

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 07:31
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol enabled auto-merge (squash) October 24, 2026 07:33
@squid-protocol
squid-protocol merged commit e78e45d into main Oct 24, 2026
53 checks passed
@squid-protocol
squid-protocol deleted the churn/3641-20261024T0720Z branch October 24, 2026 07:44
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