Skip to content

algo: table-driven GDS registry for icebug algorithms - #130

Merged
adsharma merged 1 commit into
fix/gds-graph-name-signaturefrom
feat/gds-table-driven-registry
Oct 16, 2026
Merged

adsharma merged 1 commit into
fix/gds-graph-name-signaturefrom
feat/gds-table-driven-registry

Conversation

@adsharma

Copy link
Copy Markdown
Contributor

Stacks on #127.

Problem

Each icebug algorithm needed its own gds_*.cpp integration file (~80-160 lines of near-identical bridge code). With 220+ algorithms in icebug, that approach does not scale.

Design

One catalog table (algo/src/function/gds_registry.cpp): each algorithm is a single row — CALL name, output column, parameter signature (a Specs... pack), extra-arg kind (NONE / SOURCE_LIST / SINGLE_SOURCE), graph mode (UNDIRECTED / DIRECTED), and a NetworKit invocation lambda. No new file, no CMake edit, no extension-load edit per algorithm.

  • gds_generic_algo.h: three shared builders — makeNodeScoreFunc (double/node: centrality, distances), makePartitionFunc (int64/node from a Partition), makeEmbeddingFunc (float/double vector/node). Handles CALL binding, CSR bridge, GraphR construction, result streaming.
  • gds_generic_params.h: GDSGenericParams<Specs...> reuses OptionalParam<Spec> for parsing/literal-evaluation/validate(), plus REQUIRED support for ctor-mandatory knobs (e.g. CutClustering alpha).
  • gds_param_specs.h: reusable knob specs (normalized true/false variants, Katz alpha/beta, Leiden gamma/iterations, PLP theta/maxiter with -1=none sentinel, FastRP dim/seed/normalization for when the vendor prebuilt ships FastRP.hpp).
  • Directed mode adds buildDirectedCSR (out/in scan pair; always scans — the pinned CSR is fwd-only).

Content

  • Migrates the 5 existing functions with identical names/params/semantics (-465 lines of per-file code).
  • Adds 11 rows: GDS_BETWEENNESS, GDS_DEGREE, GDS_CLOSENESS, GDS_HARMONIC, GDS_KATZ, GDS_EIGENVECTOR, GDS_CORE_DECOMPOSITION, GDS_CONNECTED_COMPONENTS, GDS_PLP, GDS_CUT_CLUSTERING, GDS_BFS_DISTANCE.
  • Fixes GDS_PPR binding: LIST-typed extras now set inferInputTypes (the binder cannot build a LogicalType from a bare LIST ID) — un-breaks the 2 gds_ppr e2e tests that fail on the base branch too.
  • New gds_registry.test (exact values for deterministic algos, structural assertions for PLP/CutClustering).

Verification

55/55 algo e2e tests pass locally (53 existing + 2 new cases), clang-format-18 clean on the touched C++ files.

Follow-ups (need new builders, deliberately out of scope): global scalars, edge scores, link prediction, SCD, generators.

@adsharma
adsharma added this pull request to stack #131 October 16, 2026 15:52
Replace the one-file-per-algorithm GDS integration with a catalog table
(gds_registry.cpp): each icebug algorithm is one row supplying its CALL
name, output column, parameter signature (Specs pack), extra-arg kind,
graph mode, and a NetworKit invocation lambda. Shared builders in
gds_generic_algo.h cover three shapes (per-node double, per-node int64
partition, per-node embedding); GDSGenericParams<Specs...> reuses
OptionalParam for parsing/validation so no params code is written per
algorithm. Migrates the 5 existing functions with identical semantics
and adds 11 rows (betweenness, degree, closeness, harmonic, katz,
eigenvector, core, connected components, PLP, cut clustering with a
REQUIRED alpha, directed single-source BFS distances).

Also fixes GDS_PPR binding on main: LIST-typed extras now use
inferInputTypes (binder cannot build a LogicalType from a bare LIST
ID), which un-breaks the 2 gds_ppr e2e tests. New gds_registry.test
covers the added rows. 55/55 algo e2e tests pass.
@adsharma
adsharma force-pushed the feat/gds-table-driven-registry branch from 385a47d to 6fc7627 Compare October 16, 2026 15:53
@adsharma
adsharma merged commit 62084ce into main Oct 16, 2026
2 checks passed
@adsharma
adsharma deleted the feat/gds-table-driven-registry branch October 16, 2026 16:30
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.

1 participant