Skip to content

Native graph engine: shared CSR graph index + parity/benchmark harness #3034

Closed

Description

@squid-protocol

Part of #3033.

Scope

Build the integer-indexed CSR index once from _resolve_edges(); add a test-only parity harness (networkx as oracle, seeded random graphs plus the crucible graph) and a benchmark script.

Move the existing _pagerank to the index. Keep its float-summation order unless a scoped golden diff shows no movement.

Acceptance criteria

  • The index is used by PageRank
  • The parity harness exists
  • Native PageRank beats nx.pagerank's warm 4.3 ms on the crucible graph (it is 10.2 ms today)
  • Both golden masters are unchanged
  • This one must land first

Relevant baseline

operation networkx notes
pagerank 4.3 ms (scipy) native _pagerank today: 10.2 ms (dict-of-str). Must beat nx once on integer arrays.

Networkx conventions to match

  • PageRank uses scipy's implementation via nx.pagerank when scipy is available
  • Native port must match the Pagerank algorithm's output exactly

Activity

  1. added
    enhancement
    metrics
    core-engine
    on Sep 14, 2026
  2. squid-protocol commented on Sep 14, 2026

    @squid-protocol
    OwnerAuthor

    Revised by the tailoring decisions on #3033 (2026-09-14).

    The parity harness must support two oracle modes:

    • strict: networkx's current call, for metrics whose definition is unchanged: SCC, articulation points, assortativity, Louvain
    • tailored: networkx computing the NEW definition, for example
      • nx.betweenness_centrality(G): exact, unweighted
      • per-source nx.single_source_shortest_path_length for directed reachable-pair path length
      • uncapped nx.descendants / nx.ancestors

    Acceptance is unchanged otherwise. Also add a work-budget helper (deterministic, e.g. V×(V+E) ≤ threshold, never wall-clock) that every metric uses instead of node-count cutoffs.

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

    core-engineenhancementmetricsperformance

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions