Skip to content

feat(gds): support Personalized Page Rank in query engines native execution path - #351

Closed
dhruvkjain wants to merge 1 commit into
hydra-db:mainfrom
dhruvkjain:ppr
Closed

dhruvkjain wants to merge 1 commit into
hydra-db:mainfrom
dhruvkjain:ppr

Conversation

@dhruvkjain

@dhruvkjain dhruvkjain commented Nov 26, 2026 •

Copy link
Copy Markdown

Summary

Adds personalized PageRank to the native GDS execution path.
gds.pageRank.stream and gds.pageRank.write now accept a sourceNodes list in their configuration.

CALL gds.pageRank.stream('g', { sourceNodes: [4, 2] })
YIELD nodeId, score
RETURN nodeId, score

Implementation details : Personalized runs calls use a new PageRank path: a Rust FP32 power iteration over the same ordinal edges, with teleport mass split across sourceNodes.

It matches the existing pagerank semantics i.e. sinks teleported in full, scores summing to 1, absolute L1 convergence at tolerance, None when max_iterations passes, so a uniform source list reproduces the existing scores.
Parallel pairs collapse to one edge, as in GraphBLAS's FIRST build.

calls without sourceNodes uses LAGr_PageRank path.
Invalid source lists are rejected at parse time, ids outside the projection error at execution time, and budget checks run inside the kernel.

Files changed :

  • src/sparse_kernel/lagraph.rs : personalized_pagerank power iteration and deduplicated_adjacency CSR build.
  • src/query/gds_procedure.rs : sourceNodes parsing, validation, and to_cypher() round-trip.
  • src/shard/gds_procedure.rs : path dispatch and id-to-ordinal resolution.
  • src/sparse_kernel/mod.rs : re-export only.

Testing :

  • As there were no common test , I added 16 new unit tests (9 kernel, 4 parser, 3 ordinal resolution), including an equivalence test that a uniform sourceNodes list converges to LAGr_PageRank's scores within tolerance.
  • Kernel tests run against GraphBLAS 7.4.4 and LAGraph 1.0.2 in WSL
  • cargo fmt --check and cargo check --lib --tests pass on Windows.

Linked issue

Closes #340

AI Assistance

Model Effort
DeepSeek v4.1 (opencode) Max

Checklist

  • Implements an issue a maintainer has /approved.
  • Small and scoped to that issue.
  • Breaking changes described below, or none.

Breaking changes

None.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dhruvkjain
dhruvkjain requested a review from a team November 26, 2026 05:50
@github-actions

Copy link
Copy Markdown

This PR has no linked approved issue. Open an issue, get it discussed and /approved by a maintainer, then link it here with Closes #N. Closing for now; reopen once linked. (Fastest help: the #pr-discussion channel on Discord.)

Maintainers: reopen this PR to override the gate (it gets the gate-override label).

@github-actions

Copy link
Copy Markdown

This is PR 1 of 3 you may keep open at a time.

@github-actions github-actions Bot closed this Nov 26, 2026
@github-actions

Copy link
Copy Markdown

This PR has no linked approved issue. Open an issue, get it discussed and /approved by a maintainer, then link it here with Closes #N. Closing for now; reopen once linked. (Fastest help: the #pr-discussion channel on Discord.)

Maintainers: reopen this PR to override the gate (it gets the gate-override label).

1 similar comment
@github-actions

Copy link
Copy Markdown

This PR has no linked approved issue. Open an issue, get it discussed and /approved by a maintainer, then link it here with Closes #N. Closing for now; reopen once linked. (Fastest help: the #pr-discussion channel on Discord.)

Maintainers: reopen this PR to override the gate (it gets the gate-override label).

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.

feat(gds): support Personalized Page Rank in query engines native execution path

1 participant