Repository navigation
algo: table-driven GDS registry for icebug algorithms - #130
Merged
adsharma merged 1 commit intoOct 16, 2026
Merged
Conversation
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
force-pushed
the
feat/gds-table-driven-registry
branch
from
October 16, 2026 15:53
385a47d to
6fc7627
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacks on #127.
Problem
Each icebug algorithm needed its own
gds_*.cppintegration 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 (aSpecs...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 aPartition),makeEmbeddingFunc(float/double vector/node). Handles CALL binding, CSR bridge, GraphR construction, result streaming.gds_generic_params.h:GDSGenericParams<Specs...>reusesOptionalParam<Spec>for parsing/literal-evaluation/validate(), plusREQUIREDsupport 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).buildDirectedCSR(out/in scan pair; always scans — the pinned CSR is fwd-only).Content
-465lines of per-file code).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.GDS_PPRbinding: LIST-typed extras now setinferInputTypes(the binder cannot build aLogicalTypefrom a bareLISTID) — un-breaks the 2gds_ppre2e tests that fail on the base branch too.gds_registry.test(exact values for deterministic algos, structural assertions for PLP/CutClustering).Verification
55/55algo e2e tests pass locally (53 existing + 2 new cases),clang-format-18clean on the touched C++ files.Follow-ups (need new builders, deliberately out of scope): global scalars, edge scores, link prediction, SCD, generators.