Skip to content

tri_comparison_reconcile.py: name-only rank pairing manufactures spurious args/line discrepancy shapes for repeated names (overloads, build, constructor) #2359

Closed

Description

@squid-protocol

Summary

tri_comparison_reconcile.py pairs each tool's occurrences of a given name by rank
(1st-with-1st, 2nd-with-2nd) with no scope/position disambiguation. Where one name has several
unrelated definitions in a file — method overloads, build across different classes,
constructor across different classes, a property name reused in two object literals — the
reconciler can line up tool A's reading of definition #1 against tool B's reading of definition
#2 and record a cross-tool "disagreement" even though every individual reading was correct for
its own definition site. This manufactures spurious args (and, if line is ever scored,
start-line) discrepancy shapes that cost investigation time and slightly distort the args
agreement rate.

Evidence (already in the ledger, as verdicts on the affected shapes)

  • csharp SetCurrentSolution (roslyn/Workspace.cs): 4 real overloads with 1 / 6 / 4 / 5
    parameters. Every tool's every reading (ctags 6, gitgalaxy 1, tree_sitter 1, ctags 4,
    gitgalaxy 6, tree_sitter 6) independently matches some real overload's true count — the
    ledger shape csharp/function/args/agree[gitgalaxy,tree_sitter]_vs[ctags] only exists because
    rank-pairing compared different overloads' readings against each other. (Verdict recorded
    2026-08, still_reproduces: true.)
  • javascript jquery event.js: two unrelated setup/trigger property pairs (lines
    441/458, 1-param; lines 759/774, 0-param). Name-only pairing across the whole file produces a
    spurious per-name args mismatch depending on each tool's internal ordering. Ledger shape
    javascript/function/args/agree[gitgalaxy,tree_sitter]_vs[ctags], verdict "comparison-
    methodology artifact, not a real defect in any of the three tools".

An all-language probe (2026-08-27) also saw this heavily in dart (build across Flutter
widgets) and typescript (constructor) on the start-line comparison.

Why it matters

  • Every one of these shapes has to be investigated and hand-annotated as "not a real
    disagreement" — pure overhead.
  • It puts a soft ceiling on the args agreement metric: a language with many same-named overloads
    (csharp, dart) can't cleanly reach 100% even when all three tools are individually correct.
  • It blocks promoting args from an unranked found-count to a ranked/badged panel — the
    denominator is polluted by non-disagreements.

Possible directions

  • Disambiguate a repeated name within a file by nearest-line before rank-pairing (pair the
    occurrence at line L in tool A with the closest-line occurrence in tool B, not the same
    rank), falling back to rank order only when the tools genuinely can't be aligned positionally.
    GitGalaxy classes carry no line (schema fact) so the class path stays name-multiset-only.
  • Or: when a name's occurrence count differs across tools OR any pair of same-name occurrences
    is more than N lines apart, treat that name as "ambiguous in this file" and exclude it from
    the args/line comparison (still counted for existence), rather than risk a bad pairing.

Scope

Tri-comparison tooling only (tests/tools/tri_comparison_reconcile.py). No core-engine change.
Existence reconciliation is largely unaffected (a spurious pairing there still agrees the symbol
exists); the fix is about the args/line sub-comparison that runs only on existence-consensus
slots.

Activity

  1. added
    refactor
    testing
    priority: low
    on Aug 27, 2026
  2. added this to the v2.4.9 milestone on Aug 31, 2026
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

    priority: lowrefactortesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions