Skip to content

Resolver: a bare Perl call to a built-in is the built-in (#3401) - #3444

Merged
squid-protocol merged 2 commits into
mainfrom
fix/resolver-bare-call-to-method-3401
Sep 24, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
fix/resolver-bare-call-to-method-3401

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3401. The broader part is split out as #3443.

What was actually wrong

I measured each of #3401's rows on today's main:

row finding
perl/mojo/Promise.pm sub map (Popularity 7 → 12) Real false edges. Bare map( in bugzilla and spamassassin resolved unique to Mojo's sub, which sits in a different repository. Perl's named operators take precedence over a user sub of the same name: that sub is reachable only as $x->map, &map or Mojo::Promise::map.
swift/alamofire/Response.swift func map (4 → 5) Not a map edge. The method has parent_class_name DataResponse/DownloadResponse, so a bare call can't reach it (bucket.free excludes owned methods). A call inside an extension of that type resolves through class, which is correct. The golden popularity comes from edges in the whole-crucible scan that I didn't attribute; they're noted in #3443.
lua/redis/printf.lua function printf (0 → 3) Correct, as the issue says. Lua has no printf built-in, so it's a real global. Kept (test).
zig/zig/main.zig pub fn log Not built-in shadowing: Zig's log is std.log, qualified. Unchanged.

Fix (call_resolver.py)

  • _BARE_BUILTINS[lang] lists the names that a bare call always means as the language's built-in. For such a call the resolver returns none/external, as it does for any library call, even in the file that defines a same-named sub.
  • Only Perl is listed. Languages where a user definition can shadow a built-in (Python, Lua, JS) are deliberately left out.
  • Qualified and receiver calls are unaffected.

Checks

Test plan

  • test_bare_perl_builtin_never_links_to_a_same_named_sub (cross-repo and same-file) and test_a_redefinable_name_still_resolves (Lua printf): 28 passed in test_call_resolver.py
  • pytest tests/: 11,108 passed
  • ruff / mypy audits clean

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

squid-protocol and others added 2 commits September 23, 2026 22:06
Mojo's Promise.pm defines `sub map`. Every bare `map(` in bugzilla and
spamassassin (language-crucible) resolved `unique` to it, a confident
edge into a different repository, which inflated Promise.pm's Popularity
Rank from 7 to 12. Perl's named operators and built-in functions take
precedence over a user sub of the same name; that sub is reachable only as
`$x->map`, `&map` or `Mojo::Promise::map`.

call_resolver: _BARE_BUILTINS[lang] lists the names a bare call always
means as the built-in. For such a call the resolver returns step
none/external, as for any library call. Only Perl is listed. Languages
where a definition can shadow a built-in (Python, Lua, JS) are not, so
redis's global `function printf` still resolves (test).

Golden masters re-blessed: 10 substantive differences. Promise.pm Popularity
Rank and blast radius 12 -> 7, restoring the pre-#3361 value; the rest are
composition z-scores and network_macro ripples.
call_graph_accuracy --ci within tolerance; ground-truth ledger unchanged.
The broader cross-package `unique` problem (bare `remove`/`all` into Mojo)
and the unattributed Swift row are filed as #3443.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
…l-to-method-3401

# Conflicts:
#	tests/golden_master_audit/2_global_ecosystem_summary/network_macro.json
#	tests/golden_master_audit/4_high_value_forensic_report/systemic_bottlenecks.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/network_macro.json
#	tests/golden_master_zero_dep_audit/4_high_value_forensic_report/systemic_bottlenecks.json
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 2252fe6 into main Sep 24, 2026
30 checks passed
@squid-protocol
squid-protocol deleted the fix/resolver-bare-call-to-method-3401 branch September 24, 2026 02:27
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.

Resolver: a bare call to a built-in links confidently to a same-named method (#3361 x #3388)

1 participant