Skip to content

Call graph (rust): a self receiver reaches impl methods (Part of #3772) - #6448

Merged
squid-protocol merged 6 commits into
mainfrom
churn/3772-20261024T1057Z
Oct 24, 2026
Merged

squid-protocol merged 6 commits into
mainfrom
churn/3772-20261024T1057Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

Level 2 call graph, Rust (#3785): rust-analyzer SCIP is the reference. Rust impl methods carry no parent_class_name (class_start covers only struct/enum/union/trait), so self.m() fell through the resolver's methods-only bucket and resolved to none. For rust, a self receiver now searches bucket.all, so it reaches impl methods through the normal file/import/unique ladder.

serde-rs/json vs rust-analyzer before after
reference edges linked 432 651
recall 39.9% 60.1%
confident precision 92.1% 93.8%

No gated metric dropped. The widening is gated by _IMPL_SELF_LANGS = {"rust"}; a parametrized test pins that python, java and javascript are unchanged.

Rejected: widening every receiver for rust took external from 40 to 138 and precision to about 71%, so only self is widened.

Class / Sibling gaps

Class: a receiver whose owner the extractor does not record (impl blocks), so the method bucket excludes the target. Fixed here for self receivers in rust. Remaining siblings: (1) typed receivers (let x: Foo then x.m()) and Foo::m() path calls to impl methods need an impl-owner map in by_owner; (2) trait-method dispatch through generics; (3) CI gate and toolchain hook for the rust reference. Burned-estate programs needing these: none (call-graph work, no mainframe estate involved).

Golden

Re-blessed with golden-lock.sh crucible_check.py --update --yes. Only graph-derived files move (fan_in, fan_out, pagerank, llm_brief): the new rust edges change fan counts and global PageRank normalisation, which also shifts rounding in other languages' PageRank at the 1e-5 level. No extraction field moves.

Gates

pr_gates.py --fast 7/7, --ratchets 9/9, call_resolver tests (95) and the pre-PR guard tests (301 total) pass, rust resolution baseline regenerated.

Facts checked: the box had no rust toolchain; installed rustup 1.90.0 and rust-analyzer into scratch to reproduce.

Checklist: partial [c:b43cf8a0] -- CI gate and toolchain hook, typed receivers/owners left
Checklist: partial [c:a15ba693] -- known-pattern row added for rust self.m(); other languages' rows not touched

Lessons for agents

  • The box has no rust toolchain: rustup into a scratch RUSTUP_HOME/CARGO_HOME, add rust-analyzer, then import_graph_accuracy.py --fetch-only rust before triage.
  • Widening all receivers for rust regresses precision badly; widen self only.
  • call_graph_resolution.py takes --regenerate, not --write-baseline.

🤖 Generated with Claude Code

squid-protocol and others added 2 commits October 24, 2026 07:01
Rust impl methods carry no owner, so self.m() had no class to walk and
resolved to none: 239 of the 424 resolved_outside edges on serde-rs/json.
A self receiver in rust now reaches any definition; other receivers stay
closed. Recall vs rust-analyzer 39.9% -> 60.1%, confident precision
92.1% -> 93.8%.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…3772)

Only fan_in/fan_out/pagerank and the LLM brief move: the new rust
self.m() edges change fan counts and global PageRank normalisation.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 24, 2026
…057Z

# Conflicts:
#	tests/golden_master_audit/12_scan_output_snapshots/llm_brief.json
#	tests/golden_master_zero_dep_audit/12_scan_output_snapshots/llm_brief.json
@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 11:25
@squid-protocol

Copy link
Copy Markdown
Owner Author

PR #6448 @ 350a8a9: 1 failed check(s)

== squid-protocol.gitgalaxy (action_required) -- dirty
https://github.com/squid-protocol/gitgalaxy/runs/120859612883
repro: git merge origin/main (then regenerate generated files with their tools; see the PR worker rules)
log tail:
This PR conflicts with main, so no checks ran. Merge origin/main into it and regenerate generated files with their tools (never hand-merge them), then push.

@squid-protocol squid-protocol added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 24, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@squid-protocol
squid-protocol enabled auto-merge (squash) October 24, 2026 11:30
@squid-protocol squid-protocol removed 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

CI shepherd: the head of this PR (c24be65) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then).

@squid-protocol squid-protocol added shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Oct 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol enabled auto-merge (squash) October 24, 2026 11:39
squid-protocol and others added 2 commits October 24, 2026 07:51
…057Z

# Conflicts:
#	tests/golden_master_audit/12_scan_output_snapshots/llm_brief.json
#	tests/golden_master_audit/6_parsed_files_scanned_artifacts/files/11_scan_db_snapshot/pagerank.json
#	tests/golden_master_zero_dep_audit/12_scan_output_snapshots/llm_brief.json
#	tests/golden_master_zero_dep_audit/6_parsed_files_scanned_artifacts/files/11_scan_db_snapshot/pagerank.json
…3772)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@squid-protocol squid-protocol removed 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

CI shepherd: the head of this PR (2031c35) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then).

@squid-protocol squid-protocol added shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md labels Oct 24, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol enabled auto-merge (squash) October 24, 2026 12:00
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

1 similar comment
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol merged commit 3ccd24a into main Oct 24, 2026
60 checks passed
@squid-protocol
squid-protocol deleted the churn/3772-20261024T1057Z branch October 24, 2026 12:17
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