Skip to content

Reuse fetched PPR neighbor cache entries#703

Merged
mkolodner-sc merged 1 commit into
mainfrom
mkolodner/ppr-neighbor-cache-reuse
Jul 13, 2026
Merged

Reuse fetched PPR neighbor cache entries#703
mkolodner-sc merged 1 commit into
mainfrom
mkolodner/ppr-neighbor-cache-reuse

Conversation

@mkolodner-sc

@mkolodner-sc mkolodner-sc commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Moves fetched PPR neighbor rows into the persistent per-state neighbor cache immediately.

Previously, pushResiduals() kept newly fetched neighbor lists in a temporary fetched map for the current push, while older neighbor lists lived in _neighborCache. That meant the push loop had to check both places, and a node that re-entered the frontier later could still trigger another lookup if its neighbor row had not been promoted into _neighborCache.
Now, every fetched (node_id, edge_type_id) row is written to _neighborCache before residuals are pushed. After that, both drainQueue() and the residual-push loop use _neighborCache as the single source of truth for known adjacency.

Example: Example: suppose node u is fetched and pushed in iteration 1. Later, residual flows back to u through another path and u re-enters the frontier. Before this change, u’s adjacency may not have been retained unless it matched the old promotion path. With this change, drainQueue() sees u’s neighbor list in _neighborCache and avoids re-fetching it.

The PPR math is unchanged; this only avoids redundant neighbor fetches and simplifies the push path by removing the split between “newly fetched” and “previously cached” neighbor rows.

@kmontemayor2-sc kmontemayor2-sc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Matt!

Comment thread gigl-core/core/sampling/ppr_forward_push.cpp
@mkolodner-sc mkolodner-sc added this pull request to the merge queue Jul 13, 2026
Merged via the queue into main with commit b6edda5 Jul 13, 2026
7 checks passed
@mkolodner-sc mkolodner-sc deleted the mkolodner/ppr-neighbor-cache-reuse branch July 13, 2026 23:03
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.

3 participants