Skip to content

v6.4.2

Choose a tag to compare

@magicdrive magicdrive released this 13 Oct 09:33
· 225 commits to main since this release
bab9b1e

Ark v6.4.2 - Go Semantic Accuracy Phase 2 — Method Resolution Fidelity

This release significantly improves Ark's Go semantic resolution accuracy, expanding method reference support while preserving strict resolution soundness.

Across five fixed Go corpora and 92,323 independently evaluated references, overall reference recall improved from 92.69% to 99.32%, with zero incorrect Exact or Strong resolutions and zero incorrect OutsideRepository classifications.

Highlights

Go Method Resolution

Ark now resolves a much broader range of Go method references using declared type information rather than relying on method names alone.

Key improvements include:

  • Receiver chain resolution — Resolves methods through function return types, struct fields, package variables, element types, and chained expressions.

  • Method values and expressions — Supports value.Method, Type.Method, (*Type).Method, and instantiated generic receivers.

  • Promoted methods — Resolves methods inherited through embedded types, respecting Go's promotion depth, shadowing, and ambiguity rules.

  • Interface methods — Recognizes interface method declarations and resolves statically selected interface methods without incorrectly attributing them to concrete implementations.

  • Generics — Resolves methods on instantiated generic receiver types to their original declarations.

  • Cross-package resolution — Improves method identity and reference resolution across package boundaries.

  • Conservative fallback — Ambiguous or insufficiently typed references remain candidates or unresolved rather than being incorrectly classified as Strong.

Accuracy Improvements

Measured against an independent go/types oracle:

Metric | Before | After -- | -- | -- Overall reference recall | 92.69% | 99.32% Method reference recall | 55.50% | 96.71% Method value recall | 0.00% | 91.02% Method expression recall | 3.96% | 97.03% Promoted method recall | 0.00% | 80.77% Generic method recall | 68.07% | 100.00% Cross-package method recall | 23.91% | 94.02%

On the fixed common reference set:

  • 6,122 additional correctly resolved references

  • Zero previously correct resolutions lost

  • Zero incorrect Exact resolutions

  • Zero incorrect Strong resolutions

  • Zero incorrect OutsideRepository classifications

Interface method resolution also reached 84.40% recall across 1,019 newly eligible references.

These measurements use fixed corpora and independent compiler-based reference oracles. Category-specific figures are reported on comparable reference sets.

Reference Identity and Soundness

Reference IDs now incorporate the full source span, including the ending position.

Previously, distinct references sharing the same starting position could generate identical IDs, potentially associating one reference with another reference's resolution result.

This release:

  • Fixes reference ID collisions caused by overlapping source expressions.

  • Enforces reference ID uniqueness during index construction.

  • Reports reference_id_collision diagnostics when duplicate IDs are encountered.

  • Preserves deterministic reference IDs across repeated indexing and cache restoration under equivalent conditions.

  • Strengthens reference identity and MCP contract regression tests across supported languages.

Compatibility Note

The id values returned by find_references will change across all supported languages.

These IDs are opaque reference identifiers, not persistent public identifiers. They should not be stored or assumed stable across Ark versions.

The response field structure and ID format remain unchanged.

Validation

The implementation was validated with:

  • Independent go/types oracle comparisons across five Go corpora.

  • 92,323 fixed, comparable reference cases.

  • Go method semantic test matrices covering receiver types, promotion, interfaces, generics, scope, and ambiguity.

  • Unit tests, race detector tests, go vet, and staticcheck.

  • Deterministic corpus and cache consistency checks.

  • Negative tests and mutation testing.

  • Cross-language reference identity and MCP contract regression tests.

  • Independent reviews focused on Go semantics, soundness, compatibility, and performance.

Performance

The additional semantic analysis introduces some overhead:

  • Cold indexing: approximately 5–7% slower in the measured corpora.

  • Cache restoration: approximately 18–32% slower.

  • Warm indexing remains largely unchanged.

These costs are primarily associated with additional reference evidence and resolution processing. Future optimizations will target these paths without weakening semantic correctness.

Known Limitations

The following cases remain conservatively unresolved or are not yet fully supported:

  • Methods selected through type parameter constraints.

  • Some chains involving external types or functions.

  • Certain interface-return chains and type-switch bindings.

  • Method values are not yet included in find_references output, even when their resolutions are available internally.

Ark continues to prioritize soundness over speculative resolution.


This release moves Ark closer to compiler-informed Go code intelligence, delivering substantially higher reference recall without sacrificing resolution correctness.