Skip to content

Call-graph gates: measurement first (stale baselines, gin + flask lanes, fmt gtest scope, C include scorer, per-kind reporting, edge-kind contract) (Part of #8161) - #8162

Merged
squid-protocol merged 6 commits into
mainfrom
callgraph/measurement-first
Nov 9, 2026
Merged

squid-protocol merged 6 commits into
mainfrom
callgraph/measurement-first

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

PR 1 of 4 for #8161: measurement first, so the engine fixes in PRs 2–4 are judged against correct numbers. Six self-contained commits; gate tooling, baselines and docs only, no engine code.

  1. Regenerate the stale c, cpp and typescript call-graph baselines. The gate fails only on drops, so gains never landed. --ci passed first, and every number matches CI main's nightly run 42489024273.
    • c: recall 36.7 → 47.5.
    • cpp: 22.0 → 26.8.
    • ts: 60.6 → 68.8. TS confident precision had been 0.1 pp from its floor.
  2. Score fmt's bundled test/gtest/ as vendored. This is a gate-scope rule (callgraph_vendored); engine vendoring is unchanged.
    • cpp reference edges 9711 → 3311, recall 30.9.
    • Confident precision drops to 85.8%, which is fmt's own number once googletest's easy agreements are out.
  3. Add gin to the Go call-graph gate (go_toolchain pin go1.26.10) and flask as a Python corpus lane next to the crucible lane.
    • The Go numbers now include a multi-package repo: recall 70.4, gin alone 63.9.
    • flask: 99.7 precision, 40.4 recall.
  4. C import scorer: an angle-bracket include searches only the include path the repo shows. Only C moves: precision 99.9 → 92.8. The 62 false edges it exposes are <errno.h> → include/uv/errno.h style; fixing them is engine work for PR 3.
  5. Per-kind reporting: precision and recall per resolver step and fcall kind. libclang reference edges are labelled named / ctor / dtor / conversion / operator / macro. Report-only; no new gate.
  6. The edge-kind contract in docs/calls_out_rule_contract.md, docs/import_rule_contract.md and docs/graph_accuracy.md: every edge has a kind and a confidence, metrics are reported per kind, and open questions become labelled kinds. This covers C platform variants → variant, and C++ implicit calls → ctor / operator / macro.

Tests:

  • All tool test files touched pass with the reference tools present.
  • pr_gates.py --fast: 8 of 9 gates green.
  • affected: 10,140 passed, 1 failed (test_committed_fidelity_table_is_fresh_against_the_corpus). It reads a stale local keyword-rosetta checkout; this branch doesn't touch it.

CI cost (not measured; please read before admitting):

  • The go and python gates gain gin and flask.
  • Go 1.24 fetches go1.26.10 on first use (about 70 MB).
  • Editing callgraph_refs.py invalidates the reference cache, so the first run rebuilds every reference.

🤖 Generated with Claude Code

https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

squid-protocol and others added 6 commits November 9, 2026 07:40
… (Part of #8161)

The gate fails only on drops, so recall gains on main never reached these files and
the floors sat far below what main measures (TS confident precision was 0.1 pp from
failing on a baseline that no longer described main). Each was checked first with
`--ci` (passes) and against CI main's nightly graph-accuracy-audit run 42489024273:

  c           recall 36.7 -> 47.5, resolution recall 49.4 -> 51.8,
              confident judged 4266 -> 6313, reference edges 11617 -> 13285,
              confident precision 100.0 -> 100.0
  cpp         recall 22.0 -> 26.8, resolution recall 61.3 -> 66.1,
              confident precision 92.2 -> 93.1 (strict 82.0 -> 84.2),
              ambiguous precision 41.1 -> 39.1, judged 2319 -> 2790
  typescript  recall 60.6 -> 68.8, resolution recall 77.9 -> 88.6,
              confident precision 99.9 -> 99.5, ambiguous 35.8 -> 20.5,
              judged 1613 -> 1840

Every percentage equals CI's. C's reference edge count is 13285 here and 13284 on
the CI runner (one libclang edge, host system headers); no gated rate moves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF
…8161)

Two thirds of the cpp gate's reference edges (6,400 of 9,711) were googletest's own
internals: fmt ships googletest amalgamated in `test/gtest/` (gmock-gtest-all.cc plus
headers) with no license file of its own, so aperture's VendorDirectoryDetector, which
needs a foreign license or a known library name, cannot tell it from fmt's tests and
the engine scans it. yaml-cpp's `test/googletest-1.16.0/` carries googletest's LICENSE
and is already excluded.

Fixed at the gate, not in the engine: adding `gtest` to the engine's known library
names would also move fmt's import-graph numbers and any other scan holding such a
directory. A corpus entry may now list `callgraph_vendored` directories;
callgraph_refs.reference_graph drops every reference def, edge and external call with
an end in one (the reference still parses them, so a test's include of the bundled
framework still resolves; the cached contract is unchanged), and call_graph_resolution
and callgraph_triage skip engine links touching them.

cpp baseline, fmt only, old -> new:
  reference edges     9711 -> 3311
  recall              26.8 -> 30.9   (overload-blind 27.0 -> 31.6)
  resolution recall   66.1 -> 55.8
  confident precision 93.1 -> 85.8   (strict 84.2 -> 75.5, judged 2790 -> 1193)
  ambiguous precision 39.1 -> 32.7

Precision falls because gtest's internal calls were easy agreements that hid fmt's own
error rate; 85.8% is the number for fmt's code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF
cobra is one package and language-crucible's Python samples are flattened, so neither
corpus can show the engine's multi-package Go gaps (package = directory, scoping order)
or Python's package-import gaps. Both gates now carry a repo that does.

Go: gin-gonic/gin @ 43fe48e8 joins tests/import_graph_corpus.json. Its go.mod says
`go 1.26.0`, which the gate's Go 1.24 refuses, so a corpus entry may pin
`go_toolchain` (a GOTOOLCHAIN value). gin runs under go1.26.10, the release the
engine-tuning study measured it with; cobra keeps `local`. callgraph_refs.go_contract
runs the helper under the pin: a binary of that name on PATH is used, else the go
command fetches that exact release from the module proxy (CI: setup-go's 1.24 does,
no workflow step changes; header comment updated). The pin is part of the reference
cache key (Reference.repo_pin).

Python: Reference.extra_corpora scores further corpora as lanes of the same gate.
python keeps language-crucible as its main corpus (flat keys, unchanged) and adds the
import-graph corpus as the `import_graph` lane, its own baseline section, gated on its
own. flask is that lane; fastapi and httpx are marked "callgraph": false (import graph
only). graph_accuracy_plan: call-python now reads the import corpus too.

Baselines, old -> new:
  go (cobra -> cobra + gin)
    confident precision 99.3 -> 98.7 (strict 91.1 -> 90.3), judged 1367 -> 3355
    recall 82.9 -> 70.4, resolution recall 89.1 -> 80.0
    ambiguous precision 100.0 -> 61.2, reference edges 1636 -> 4706
    (gin alone, as the study measured: precision 98.4, recall 63.9, 1993 judged)
  python crucible lane: unchanged (99.9 / recall 51.2 / resolution 97.8)
  python import_graph lane (new, flask): confident precision 99.7 (305 judged),
    recall 40.4, resolution recall 89.2, recall with all kinds 60.8, 752 reference edges
  import graph (gin is in the shared corpus):
    go   files 186 -> 284, imports 121 -> 149, precision/recall 100/100 unchanged
    swift recall 72.9 -> 98.8 (engine edges 302 -> 716): a stale baseline, not this
         change -- CI main's nightly run 42489024273 already measures 716 / 98.8
  every other language reproduces its baseline exactly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF
…h (Part of #8161)

The C rule matched `<x.h>` to any repo file ending in /x.h, as if every directory
were an -I dir. So libuv's `#include <errno.h>` (libc's) counted as resolving to
include/uv/errno.h, and the engine's edge for it scored as correct. libuv builds
with -Iinclude: that file is reachable only as `uv/errno.h`.

An angle include now resolves only through an include root the repo shows: the repo
root, a directory named include/ or inc/, or a directory one of the repo's own
multi-segment includes resolves through (fmt's `"gtest/gtest.h"` makes test/gtest/
one). Quoted includes keep the including file's directory first and then any
directory: the project's own -I dirs and Xcode header maps are build configuration
the corpus does not carry, and every quoted suffix match in the corpus checked out as
real (libuv's src/ headers, SDWebImage's Private/). The Objective-C framework rule is
unchanged.

Import baseline, old -> new: only c moves.
  c  resolvable imports 873 -> 811, precision 99.9 -> 92.8 (FP 1 -> 63),
     recall 100.0 unchanged, hub overlap@10 1.0 -> 0.9, Spearman 1.0 -> 0.886
  The 62 statements that left: 61 libuv `<errno.h>` and hiredis sockcompat.h's
  `<poll.h>` (system poll.h, not hiredis's adapters/poll.h). The engine still draws
  an edge for each, so they are now its false positives: engine work for later in
  #8161, not changed here. cpp (fmt) and objective-c (SDWebImage, Texture) resolve
  every angle include through include/ or the root and do not move; no other
  language uses this rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF
…es by call kind (Part of #8161)

Report-only: no gate threshold, gated metric or baseline changes.

call_graph_resolution now reports, for every language and lane:
  - per resolver step (class, qualified, typed, file, import, unique; nearest,
    unseen, receiver, overload): verdicts, precision, strict precision, unmapped,
    and the share of reference edges a link of that step lands on (an ambiguous
    step's: what promoting it would add);
  - per fcall kind (call, decorator, reference): confident precision and recall share;
  - the recall the ambiguous links alone would add;
  - where the reference labels its edges: the reference's edges by call kind with
    the engine's linked / missed count per kind, and named-call, labelled-kinds and
    full-reference recall.

clang_callgraph labels each edge from its call sites' cursors: `ctor`, `dtor`,
`conversion` (the callee's CursorKind), `operator` (an `operator...` callee, written
`a + b`), `macro` (the call sits in a MACRO_INSTANTIATION -- the TU is now parsed
with the detailed processing record -- whose invocation text does not spell the
callee: `CALL_F(1)` expanding to `f(1)`; `CHECK(f(2))` spells f and stays named),
else `named`. An edge with several sites takes the best kind. The contract gains an
optional `edge_kinds` list of the edges that are not `named`; defs, edges, external
and fatal were checked identical to the previous contract on libuv, hiredis and fmt.

What it shows on the gate corpus (fmt with gtest vendored):
  c    named 10623 edges, recall 45.6%; macro 2662, recall 55.0%  (full 47.5%)
  cpp  named 1909, recall 47.1%; ctor 625, 12.5%; macro 364, 12.6%;
       operator 238, 0.0%; conversion 175, 0.0%  (labelled kinds 8.8%, full 30.9%)
  cpp's weakest confident step is `file` (74.7% precision, 383 judged).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF
… and a confidence (Part of #8161)

Docs only. The principle the owner approved with epic #8161 (2026-11-09), written
into the two rule contracts:

- docs/calls_out_rule_contract.md, "Edge kinds": an fcall edge's kind (call,
  transfer, decorator, reference) and confidence (the resolver step); metrics are
  reported per kind; a study declares the kinds it uses; an open question becomes
  a labelled kind, never no-link and never one guess. The two recorded questions:
  C platform variants -> a future `variant` kind (today a `tie`, no edge; PR 3),
  and C++ calls the text does not name -> `ctor` / `operator` / `macro` (plus
  `conversion`, `dtor` as the libclang reference already labels them; PR 4). C3
  (a constructor, conversion or macro written by name is a `call`) is unchanged.
- docs/import_rule_contract.md, "Edge kinds": the same for file edges (import,
  fcall, call/exec); today's ambiguous-candidate no-edge cases are named as the
  backlog this rule covers, and the scorer's include-path rule makes a wrong
  `<errno.h>` edge show as a false positive.
- docs/graph_accuracy.md, "Per-kind metrics": what call_graph_resolution.py now
  reports (per step, per fcall kind, per reference call kind with named-call,
  labelled-kinds and full-reference recall), with the current C and C++ figures;
  not baselined, not gated.
- docs/function_call_graph.md: a pointer from its "Edge kinds" table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF
@squid-protocol
squid-protocol marked this pull request as ready for review November 9, 2026 13:41
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 4b23f21 into main Nov 9, 2026
95 checks passed
@squid-protocol
squid-protocol deleted the callgraph/measurement-first branch November 9, 2026 14:17
squid-protocol added a commit that referenced this pull request Nov 9, 2026
…and receivers, C/C++ include closure, system headers, C variant edges, Rust module paths (Part of #8161) (#8186)

* Rust: `impl` blocks own their methods; a tuple/unit struct's span ends at its `;` (R1+R2, Part of #8161)

`class_start` never matched `impl`, so no inherent or trait-impl method had
an owner: `Type::f()` found nothing, a bare `f()` reached impl methods
(Rust syntax never allows that) and `self.m()` reached any definition.
The few owners that did exist were accidental: a tuple or unit struct's
span ran to the NEXT `{` (usually an `impl`), so `pub struct Unit;`
owned `impl b::Thing`'s methods. Now:

- R1: the detector records each `impl [<..>] [Trait for] Type [where ..] {`
  span and gives the methods inside it `parent_class_name = Type`
  (`&'a mut a::Foo<T>` -> `Foo`; a blanket `impl<T: B> Tr for T`, or an
  unnamed `[T]` / tuple type, -> `Tr`). No class row is added.
- R2: a Rust struct's span ends at a `;` that comes before its first `{`
  at bracket depth 0 (`struct X;`, `struct X([u8; 4]);`,
  `struct X<T>(T) where ..;`). Shipped together with R1 so the
  accidentally-right owners are not lost first.
- A Rust path qualifier carries the `::` mark C++ already has (`::Other`,
  `::a.b`; `x.f()` stays `x`), so the resolver tells a path from a method
  call on a value: `Type::f()` is that in-repo type's method (`qualified`)
  or nothing in the repo (`Vec::new`, `String::from`); `m::f()` reaches a
  free function of a module the caller imports by that name, never a
  method (`walk::scan` is not `WorkerState::scan`, `std::mem::swap` is no
  repo `swap`); `self::f()`, `super::f()` (R3) and `Self::f()` as before.
- `self.m()` walks the caller's own type, then the visible METHODS only
  (`_IMPL_SELF_LANGS`, the #3785 widening to any definition, is gone: a
  same-file test-module helper is never `self`'s).
- The nested-unit rescan (`_drop_nested_unit_calls`) now marks scope
  paths as the first scan does; this also moves C++ (a nested unit's
  `ns::f()` kept its mark).

Gates (call_graph_resolution, before -> after):
- rust (serde-rs/json): confident precision 93.7 -> 98.3 (702 -> 858
  judged), strict precision 88.6 -> 91.6, ambiguous precision
  56.7 -> 69.3, recall 60.7 -> 77.8, resolution recall 61.2 -> 78.4
- cpp: recall 31.1 -> 31.2, resolution recall 54.1 -> 54.2 (1188 -> 1190
  judged); precision unchanged

Baselines regenerated; golden masters re-blessed (call edges, fan-in/out,
PageRank and their downstream ranks move on the crucible's Rust repos).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* Go: a package is its directory, and a method is owned by its receiver type (G1, Part of #8161)

The import edge names one representative file per package
(`go_modules._package_file`), and the resolver treated only that file as
visible; a qualifier was never tested against the file's import names, so
`errors.New` linked to any repo `New` in view; and Go methods had no owner,
so every `Close` in one file collapsed onto the first. Now:

- Package = directory. `extract_namespace_imports` records every Go import
  name (an alias, else the path's last element without a `/vN` or gopkg.in
  `.vN` suffix; `_` binds nothing), read from `import` declarations only.
  NetworkRiskSensor hands the resolver each name's package (`""` for one
  outside the scan). `pkg.F()` resolves among the package's non-test files
  only (several defining it: build-tag variants, a `tie`); `pkg.T.M()` to
  type T's method there; `errors.New` / `strings.NewReader` reach nothing in
  the repo. An import makes every non-test file of the package visible to
  the receiver ladder, not only the representative file.
- Receivers. A method's `parent_class_name` is its receiver type
  (`func (s *S) f(`, `func (S) f(`, `func (t *T[K]) f(`), and its receiver
  variable is recorded as `self` in its call qualifiers, so `s.g()` is the
  `class` step on S, and two types' `Close` in one file are two classes
  (`x.Close()` stays the ambiguous `receiver`). A type's methods are looked
  up in its own package only. `_OWNERLESS_METHOD_LANGS` is gone.

Gates (call_graph_resolution go, cobra + gin, before -> after): confident
precision 98.9 -> 99.5 (3397 -> 3541 judged), strict precision 94.6 ->
96.4, recall 71.4 -> 74.8, resolution recall 80.0 -> 83.9; ambiguous
precision 58.0 -> 48.4 (560 -> 473 judged: the rows the package and owner
rules settle were the easy ambiguous ones). import_graph_accuracy unchanged.

Baseline regenerated; golden masters re-blessed (Go call edges and
`namespace_imports` move on the crucible's Go repos).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* C/C++: calls see the include closure, a header's paired source, and `static` stays in its own file (X4, Part of #8161)

The resolver's `import` step looked only at a file's DIRECT includes
(`_include_closure` was used for the C++ ctor-init check alone), a body in
`foo.cc` was invisible to a caller that includes `foo.h`, and another
translation unit's `static helper` counted as a candidate, so hiredis'
`hi_malloc` (a static inline in alloc.h reached through hiredis.h) tied
with alloc.c's Windows copy. Now, for C and C++ callers:

- the visible set is the include closure, ranked by include depth (a direct
  include before one it reaches); a static inline reached through a header
  chain links `import`, and the header nobody includes no longer wins a
  `nearest` guess;
- a header's paired source file is visible one hop past the header
  (`api.h` -> `api.c` beside it; in C++ also the repo's only source of the
  stem, `include/fmt/format.h` -> `src/format.cc`), which is how a
  declaration in a header reaches its out-of-line body. C pairs only beside
  the header: across directories, libuv's `include/uv/aix.h` exposed
  `src/unix/aix.c` to Windows callers (5 confident wrong links in a trial);
- the detector marks a C/C++ `static` free function `def_shape = "static"`
  (internal linkage); the resolver drops another file's static from the
  candidates unless the caller #includes that file. A class's `static`
  method is unaffected (the mark is read on ownerless definitions only).

Gates (call_graph_resolution, before -> after):
- c (hiredis + libuv): confident judged 6653 -> 6724, precision 100.0
  (unchanged), recall 50.1 -> 50.6, resolution recall 54.6 -> 55.2
- cpp (fmt): precision 86.7 -> 89.1 (1190 -> 1335 judged), strict
  76.8 -> 79.1, ambiguous 32.4 -> 41.3, recall 31.2 -> 35.9, resolution
  recall 54.2 -> 60.9 (wrong-overload links 25 -> 40: more calls now reach
  the right file, where the overload choice is still by argument count)

Baselines regenerated; golden masters re-blessed (C/C++ `fcall` file edges,
fan-in/out and PageRank move on the crucible's C and C++ repos).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* C/C++ imports: a system header resolves only on the repo's include path (Part of #8161)

The include token keeps no quote/angle distinction, and the name search
matched a bare `errno.h` to any repo file of that name: 61 libuv files
drew an edge from `#include <errno.h>` to `include/uv/errno.h`, which libuv
only ever reaches as `"uv/errno.h"`; `<poll.h>` reached hiredis'
`adapters/poll.h` and `<mach/task.h>` reached `test/task.h` (directory part
ignored). PR 1 (#8162) fixed the scorer; this fixes the engine.

A C/C++ include naming a system header (`system_headers.is_system_header`,
with an extension) now resolves only to a file beside the includer (the
existing importer-directory step, what `-I.` gives) or to the one repo file
at `<root>/<spelled path>` whose root is on the include path the repo shows:
the repo root, an `include/` or `inc/` directory, or a directory one of the
repo's multi-segment includes resolves through -- the scorer's rule. Never
by bare name. Other includes are unchanged.

import_graph_accuracy c (libuv + hiredis), before -> after: precision
92.8 -> 100.0 (false positives 63 -> 0), engine edges 871 -> 808, recall
100.0 (unchanged), hub overlap@10 0.90 -> 1.00, hub Spearman 0.886 -> 1.0.
Other languages unchanged. call_graph_resolution c unchanged (precision
100.0, recall 50.6, resolution recall 55.2). Baseline regenerated; the
golden masters do not move (no crucible C repo shadows a system header).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* C: a call that ties across platform definitions records every candidate as a `variant` edge (C1, Part of #8161)

The owner decision recorded in #8161 and docs/calls_out_rule_contract.md
("an open question becomes a labelled kind"): libuv defines `uv__io_poll`
in linux.c, kqueue.c, sunos.c, ... and `uv_run` in src/unix/ and src/win/;
a given build links one copy, so the resolver's `tie` (no edge) hid 71% of
C's recall gap, and picking one copy would be a guess.

- `resolve_calls`: a C `tie` row stays as it is (ambiguous, no function or
  file edge), and carries `variants`: every function definition of the
  tied name, one per file, each with the platform its path names
  (`platform_of`: the file name's `-`/`_`/`.` parts first, then its
  directories nearest first -- `windows`, `unix`, `linux`, `darwin`, `bsd`
  for kqueue, `sunos`, `aix`, `zos`, ...; None when the path names none).
  Platforms an `#ifdef` alone shows are not read (no preprocessor).
- RecordKeeper stores them in a new `fcall_candidates` table
  (`src_file_id`, `src_func_id`, `callee`, `dst_file_id`, `dst_func_id`,
  `platform`; cascades off the calling file like fcall_data). Nothing
  reads them into PageRank, fan-in or the file graph: the confident graph
  is unchanged. Documented in docs/function_call_graph.md.
- `call_graph_resolution.py` judges the variant edges and reports recall
  with and without them (report-only, not gated, not baselined).

c gate (hiredis + libuv): gated metrics unchanged (precision 100.0,
recall 50.6, resolution recall 55.2); variant edges 6073 judged, 72.3%
agree with libclang's configuration, 71 unmapped; recall 50.6 without
them -> 83.7 with them. No golden master moves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

* Rust: a module path resolves through the crate's module tree, and follows a `pub use` re-export (R4, Part of #8161)

`m::f()` / `crate::m::f()` resolved only when the caller's file already had
an import edge whose stem matched, so a nested file's `crate::util::f()`, a
`super::codec::encode()` and an integration test's `engine::compute()`
found nothing. The resolver now walks the module tree the scan's paths
show (`_RustTree`; `mod m;` is `m.rs` or `m/mod.rs` in the declaring
module's directory):

- `crate::a::b::f()` from the crate root (the nearest ancestor holding
  `lib.rs` / `main.rs`), `self::m::f()` from the caller's own module,
  `super::m::f()` from its parent, `m::f()` from a child module else the
  crate root, and `cratename::f()` from a workspace crate's `src/lib.rs`
  (its directory name, `-` read as `_`); `crate::f()` is the root file's;
- the module file's free `f`, else the ONE file the module imports `f`
  from (a `pub use` re-export: a path call into a module that does not
  define `f` compiles only through one);
- a segment that is no file module ends the walk: an inline `mod m {..}`
  and an external crate (`std::mem::swap`) are not resolved this way, and
  the import-stem rule (R1) still applies after it.

Not done (a size-M follow-up): a BARE call to a name a prelude glob brings
in (`use super::*` of a crate root that `pub(crate) use`s it; casey/just's
511 `unseen` rows) -- making a crate root a barrel would expose every
`mod` it declares.

Gate (call_graph_resolution rust, serde-rs/json, which seldom calls through
paths): confident judged 858 -> 860, recall 77.8 -> 78.0, resolution recall
78.4 -> 78.6; precision 98.3, strict 91.6, ambiguous 69.3 unchanged.
Baseline regenerated; the golden masters do not move.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhoWCV984xPpQKJHfF

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant