Skip to content

Call graph: a call to a different same-named function in another scope (Scope::X -> free X, C# explicit interface impl) is dropped as if it were recursion #5628

Closed

Description

@squid-protocol

Problem

A function's call to itself, and a qualified method's call to a same-named function in another scope, are missing from calls_out_to.

port (engine 0e2bf4ade) self-recursion not recorded qualified caller -> same-named other function missed
linuxdoom 3 (R_RenderBSPNode, P_RecursiveSound, P_CrossBSPNode) 0
chocolate-doom 24 0
dsda-doom 21 0
odamex 236 2
eternity 114 3
doom3-bfg 163 15
doomsday 544 87
gzdoom 652 515 (e.g. src/common/2d/v_draw.cpp:1511 _Screen::VirtualToRealCoords -> free VirtualToRealCoords)

Likely cause (confirm)

gitgalaxy/core/detector.py:1295 _drop_nested_declaration_calls (#3360 C5) drops a callee when a unit of that leaf name starts inside the caller's line range. The caller's own definition always starts inside its own range, so its own leaf name is always dropped: that removes true recursion, and (because it compares leaf names) any call to X from Scope::X.

Acceptance

Found by the DOOM corpus call-graph consensus check (#5620, #5457): near-identical ports vote on each call edge, and an independent body oracle re-extracts calls from source. Licensed ports only.

🤖 Generated with Claude Code

Activity

  1. added
    bug
    metrics
    core-engine
    priority: high
    scope:core
    needs:doom-corpus
    on Oct 19, 2026
  2. squid-protocol commented on Oct 19, 2026

    @squid-protocol
    OwnerAuthor

    Same defect in C#: an explicit interface implementation calling the same-named method loses the call, e.g. helion Core/Graphics/Fonts/Font.cs:65 IEnumerable IEnumerable.GetEnumerator() => GetEnumerator(); (also VertexAllocator.cs:130, ArchiveMapiterator.cs:95, ConsoleCommands.cs:107). Include a C# test.

    🤖 Generated with Claude Code

  3. changed the title [-]Call graph: self-recursion and calls to a same-named function in another scope are dropped (_drop_nested_declaration_calls counts the unit's own start as nested)[/-] [+]Call graph: a call to a different same-named function in another scope (Scope::X -> free X, C# explicit interface impl) is dropped as if it were recursion[/+] on Oct 20, 2026
  4. squid-protocol commented on Oct 20, 2026

    @squid-protocol
    OwnerAuthor

    Owner ruling (2026-10-19): split.

    1. Self-recursion stays dropped per #3265 step 0: state the calls_out contract (what counts as a call) #3327 (docs/calls_out_rule_contract.md stands, test_calls_out_contract_3327 stays). The DOOM call-graph oracle/consensus (Call-graph validation for C/C++: independent body oracle + family consensus on the DOOM corpus (the Graph Accuracy Audit only covers Python/TS/Java) #5630 tooling) will ignore self-edges instead of scoring them as misses; queued separately on Call-graph validation for C/C++: independent body oracle + family consensus on the DOOM corpus (the Graph Accuracy Audit only covers Python/TS/Java) #5630.
    2. This issue is now part 2 only: a call to a different same-named unit in another scope (Scope::X -> free X, gzdoom 515 / doomsday 87; C# explicit interface impl IEnumerable.GetEnumerator() => GetEnumerator()) is a real bug, not recursion. Narrow the calls_out (cpp/ts/c#): generic calls name<T>( missed; cpp own Class::method( header and Type var(args) counted as calls #3644 guard (detector.py ~10307) and the c != self_name check: keep the edge when a distinct unit of that name exists in another scope; still drop when the only candidate is the caller itself or resolution is ambiguous. Keep #3327 follow-up: nested declarations captured as calls (contract C5) #3360 nested-declaration drops. Tests: C++ Scope::f -> free f, the C# explicit-interface case, direct recursion still dropped, #3327 follow-up: nested declarations captured as calls (contract C5) #3360 shapes. One clarifying line in the contract doc. Golden re-bless with the drift explained.

    🤖 Generated with Claude Code

  5. 3 remaining items

  6. squid-protocol commented on Oct 21, 2026

    @squid-protocol
    OwnerAuthor

    Churn run 5628-20261021T0411Z (host nyx) ended without a PR. Slice 1 already on main (#5698/#5788); no PR. Queued cross-file slice; leaf-named-language probe recorded as sibling gap.

  7. squid-protocol commented on Oct 21, 2026

    @squid-protocol
    OwnerAuthor

    PR #5826 (slice 2 of 2) merged. Detector/resolver changes are done, but the acceptance line 'DOOM port counts go to ~0 under the independent body oracle' was not re-run in that PR. Leaving this open until the oracle is re-run and the counts are recorded.

  8. squid-protocol commented on Oct 21, 2026

    @squid-protocol
    OwnerAuthor

    Claimed by promoter-bot host nyx, lease renewed 2026-10-21T12:51Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove the claim:nyx label.

  9. added
    scope:frontier
    and removed
    scope:core
    on Oct 21, 2026
  10. squid-protocol commented on Oct 21, 2026

    @squid-protocol
    OwnerAuthor

    Acceptance met on main (#5698, #5788, #5826, #5871): the oracle re-run in #5871 shows 0 misses where leaf(caller) == callee on all five ports (issue table was 2/3/15/87/515). Block- and expression-bodied C# explicit interface impls are both tested. Self-recursion stays dropped per the 2026-10-19 ruling, which replaces that part of the original ask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclaim:nyxcore-enginemetricsneeds:doom-corpuspriority: highscope:frontier

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions